samples icon indicating copy to clipboard operation
samples copied to clipboard

Custom context menu example

Open justinmc opened this issue 3 years ago • 3 comments

This a sample meant to demonstrate custom context menus and the various ways they can be used. This means the unified ability to customize the text selection toolbar in text fields and on selectable text and the right-click/long-press menu anywhere else in the app.

Screenshot from 2022-10-06 16-44-23 Screenshot from 2022-10-06 16-39-30

Must wait for https://github.com/flutter/flutter/pull/107193.

justinmc avatar Oct 06 '22 23:10 justinmc

Hey @justinmc, I'm curious what versions of Flutter this sample should compile and run with. I'm happy with master only or master + beta in experimental, but I'd like an idea of when it is intended to migrate to top level with stable availability of the used APIs.

Secondly, this sample should be added to the CI pipelines. I'm happy to either point you in the right direction, or submit a PR to your repo for the required changes...

domesticmouse avatar Oct 07 '22 02:10 domesticmouse

I've made this PR a draft for now because it requires https://github.com/flutter/flutter/pull/107193 to work, which hasn't been merged yet. Once it's merged I'll make sure this works on master and open it for review. Should I document this anywhere in the PR?

About CI, I'm happy to do the work to add it if you point me in the right direction. Thank you for commenting and helping me with this!

justinmc avatar Oct 07 '22 18:10 justinmc

Please add it to https://github.com/flutter/samples/blob/main/tool/flutter_ci_script_master.sh

domesticmouse avatar Oct 07 '22 21:10 domesticmouse

@domesticmouse This PR is now ready for review. The PR that it depended on in flutter/flutter has been merged, so it works on Flutter's master channel.

Are the CI failures anything that I should worry about?

justinmc avatar Nov 04 '22 17:11 justinmc

From the CI runs, it looks like you stripped the +x permission from the master CI script. We need the CI passing before I can land this PR.

domesticmouse avatar Nov 05 '22 03:11 domesticmouse

Maybe my editor automatically stripped that +x permission somehow? To fix it I just tried running this:

$ git update-index --chmod=+x tool/flutter_ci_script_master.sh   

And committed and pushed it. Hopefully that fixes it.

justinmc avatar Nov 07 '22 18:11 justinmc

Looks like there are still failures. What were you seeing that made you think it was a file permissions problem, is that still showing up in the test output? I can't tell what's wrong but I'm not familiar with this repo.

justinmc avatar Nov 07 '22 18:11 justinmc

Also, looking at https://github.com/flutter/samples/actions/runs/3412894076/jobs/5678974213#step:5:1 it looks like there are files in need of dart format

domesticmouse avatar Nov 07 '22 19:11 domesticmouse

Current failure: I never even thought to add tests to this, so the default "flutter create" test is still there and failing. I'll add some real tests and deleted that one.

justinmc avatar Nov 07 '22 21:11 justinmc

@domesticmouse I think this is ready to go! I realized I had never updated the default test, whoops. I added a bunch of real ones now.

justinmc avatar Nov 09 '22 00:11 justinmc