Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Delete" tooltip is shown disabled on chips with onDeleted callback #141770

Merged
merged 1 commit into from Jan 19, 2024

Conversation

TahaTesser
Copy link
Member

fixes Disabled chips with onDeleted callback shows "Delete" tooltip on hover

Code sample

expand to view the code sample
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Example(),
    );
  }
}

class Example extends StatefulWidget {
  const Example({super.key});

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  bool _isEnable = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            RawChip(
              label: const Text('RawChip'),
              onPressed: () {},
              isEnabled: _isEnable,
              onDeleted: () {},
            ),
            FilterChip(
              label: const Text('FilterChip'),
              selected: false,
              onSelected: _isEnable ? (bool value) {} : null,
              onDeleted: () {},
            ),
            InputChip(
              label: const Text('InputChip'),
              isEnabled: _isEnable,
              onDeleted: () {},
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton.extended(
        onPressed: () {
          setState(() {
            _isEnable = !_isEnable;
          });
        },
        label: Text(_isEnable ? 'Disable' : 'Enable'),
      ),
    );
  }
}

Preview

Before After

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jan 18, 2024
@TahaTesser TahaTesser marked this pull request as ready for review January 18, 2024 11:39
Copy link
Contributor

@QuncCccccc QuncCccccc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for all the nice tests:)

@QuncCccccc QuncCccccc added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 19, 2024
@auto-submit auto-submit bot merged commit 788614d into flutter:master Jan 19, 2024
61 checks passed
@parlough
Copy link
Member

Thanks @TahaTesser! Now my chips will be properly disabled :D

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 20, 2024
flutter/flutter@684247a...ddf60fb

2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1385f76018ab to 704ef3399012 (1 revision) (flutter/flutter#141932)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6f6649bdfef2 to 1385f76018ab (1 revision) (flutter/flutter#141926)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4d67f267b115 to 6f6649bdfef2 (1 revision) (flutter/flutter#141920)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 53a2436cf75c to 4d67f267b115 (1 revision) (flutter/flutter#141917)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from a9b87c6288d2 to 53a2436cf75c (1 revision) (flutter/flutter#141916)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from d00e55f7f8ed to a9b87c6288d2 (3 revisions) (flutter/flutter#141914)
2024-01-20 31859944+LongCatIsLooong@users.noreply.github.com Remove more textScaleFactor references (flutter/flutter#141816)
2024-01-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 517fc2bbfa51 to d00e55f7f8ed (1 revision) (flutter/flutter#141909)
2024-01-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from f2b441a26416 to 517fc2bbfa51 (2 revisions) (flutter/flutter#141904)
2024-01-19 tessertaha@gmail.com Fix "Delete" tooltip is shown disabled on chips with `onDeleted` callback (flutter/flutter#141770)
2024-01-19 godofredoc@google.com Run module_test_ios on arm and x64 (flutter/flutter#141815)
2024-01-19 36861262+QuncCccccc@users.noreply.github.com `SearchAnchor` search view clear button only shows up when text input is not empty (flutter/flutter#141755)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC dit@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
PROGrand added a commit to mtbo-org/packages that referenced this pull request Jan 21, 2024
…lutter#5948)

Manual roll Flutter from f77f82435a97 to 684247a3c78a (39 revisions)

Manual roll requested by dit@google.com

flutter/flutter@f77f824...684247a

2024-01-19 reidbaker@google.com Use Integer instead of int in map in flutter.groovy  (flutter/flutter#141895)
2024-01-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from c953c83112ba to f2b441a26416 (4 revisions) (flutter/flutter#141894)
2024-01-19 dacoharkes@google.com Native assets: package in framework on iOS and MacOS (flutter/flutter#140907)
2024-01-19 ian@hixie.ch Revert "Make tests more resilient to Skia gold failures and refactor flutter_goldens for extensive technical debt removal (#140101)" (flutter/flutter#141814)
2024-01-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 538975f2511b to c953c83112ba (3 revisions) (flutter/flutter#141886)
2024-01-19 36861262+QuncCccccc@users.noreply.github.com Add `showDragHandle` to `showBottomSheet` (flutter/flutter#141754)
2024-01-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9a6c64de8a46 to 538975f2511b (8 revisions) (flutter/flutter#141881)
2024-01-19 goderbauer@google.com Make pumpWidget's arguments named (flutter/flutter#141728)
2024-01-19 5236035+fzyzcjy@users.noreply.github.com Tiny fix inaccurate documentations about bindings (flutter/flutter#140282)
2024-01-19 zanderso@users.noreply.github.com Roll engine to 9a6c64de8a4694cef59a338cd33ac1a9e7d23d9d (flutter/flutter#141870)
2024-01-19 engine-flutter-autoroll@skia.org Roll Packages from 83c2c4d to 129e08c (13 revisions) (flutter/flutter#141865)
2024-01-19 godofredoc@google.com Add mac_x64_ios configuration. (flutter/flutter#141828)
2024-01-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 90be25d8aac3 to d1afda52d254 (1 revision) (flutter/flutter#141825)
2024-01-19 ian@hixie.ch Move the requestKeyboard up to the widgets layer (flutter/flutter#141655)
2024-01-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from dde3ebf6551a to 90be25d8aac3 (1 revision) (flutter/flutter#141817)
2024-01-18 yjbanov@google.com enable more tests in web mode (flutter/flutter#141791)
2024-01-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9dded186bcff to dde3ebf6551a (2 revisions) (flutter/flutter#141811)
2024-01-18 davidmartos96@gmail.com Update margin between label and icon in Tab to better reflect Material specs (flutter/flutter#140698)
2024-01-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3106e08e1219 to 9dded186bcff (2 revisions) (flutter/flutter#141807)
2024-01-18 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Enable native compilation for windows-arm64 " (flutter/flutter#141809)
2024-01-18 godofredoc@google.com Run framework_tests_misc in arm64 and x64. (flutter/flutter#141797)
2024-01-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from f4a4f046b173 to 3106e08e1219 (1 revision) (flutter/flutter#141802)
2024-01-18 49699333+dependabot[bot]@users.noreply.github.com Bump actions/upload-artifact from 4.1.0 to 4.2.0 (flutter/flutter#141803)
2024-01-18 goderbauer@google.com Update labeler.yml (flutter/flutter#141697)
2024-01-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from 75400c49fa0b to f4a4f046b173 (2 revisions) (flutter/flutter#141800)
2024-01-18 polinach@google.com Reland "Remove hack from PageView." (flutter/flutter#141533)
2024-01-18 smartercallum@gmail.com ScaleGestureRecognizer pointerCount=2 for trackpad gestures (flutter/flutter#140745)
2024-01-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from de68e7612948 to 75400c49fa0b (2 revisions) (flutter/flutter#141796)
2024-01-18 15619084+vashworth@users.noreply.github.com Run `flutter_gallery_ios__start_up` test on Mac-14 in staging (flutter/flutter#141795)
2024-01-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from d80fe1cb5854 to de68e7612948 (1 revision) (flutter/flutter#141789)
2024-01-18 101587250+pbo-linaro@users.noreply.github.com Enable native compilation for windows-arm64  (flutter/flutter#137618)
2024-01-18 xilaizhang@google.com [github actions] Fix token issue on actions/checkout package (flutter/flutter#141652)
2024-01-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from b75d6d80d813 to d80fe1cb5854 (2 revisions) (flutter/flutter#141785)
2024-01-18 jesus_sguerrero@hotmail.com Revert "Native assets: roll deps" (flutter/flutter#141748)
2024-01-18 6655696+guidezpl@users.noreply.github.com Deprecate M2 curves (flutter/flutter#134417)
2024-01-18 rmolivares@renzo-olivares.dev Fix: TextField can inherit `errorStyle` from `InputDecorationTheme`. (flutter/flutter#141227)
2024-01-18 109111084+yaakovschectman@users.noreply.github.com Add check for Bank of Brazil security module to Windows Flutter Doctor validators (flutter/flutter#141135)
2024-01-18 reidbaker@google.com Fix gradle lints No semantic change should be present. (flutter/flutter#141692)
2024-01-18 engine-flutter-autoroll@skia.org Roll Packages from 1a2b780 to 83c2c4d (5 revisions) (flutter/flutter#141778)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC dit@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
...
[ci] Run Swift formatter and linter during CI formatting (flutter#5928)

Make `swift-format` CIPD package available on the `PATH` https://flutter-review.googlesource.com/c/recipes/+/54020

Run `format --no-clang-format --no-java --no-kotlin --no-dart`  on the macOS builder so it doesn't duplicate same `format` call run on Linux.

Filter out generated files until flutter/flutter#141799 is done.

Also add `swift-format lint` call during `format` command.  Fix the one casing issue it found in a test file.

Failing run:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8758535881172004177/+/u/Run_package_tests/Swift_format/stdout

Successful run:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8758492350529121249/+/u/Run_package_tests/Swift_format/stdout

Fixes flutter/flutter#41129
non-breaking change: increment lower component.

[camera]fix a sample buffer memory leak on pause resume recording (flutter#5927)

This memory leak happens when pause/resume the recording. Depending on camera resolution, about 1-2MB leaks for every resume, so it can add up pretty fast if we frequently pause/resume.

We only reference this sample buffer inside the scope of this method (e.g. directly piping into file IO), so no need to retain it again, as it's already retained and will be released afterwards by apple. (We did keep around the pixel buffer, but we already manually [retain](https://github.com/flutter/packages/blob/d7ee75ad59ad7bc45e659d0599e935e9e7981ea1/packages/camera/camera_avfoundation/ios/Classes/FLTCam.m#L403) and [release](https://github.com/flutter/packages/blob/d7ee75ad59ad7bc45e659d0599e935e9e7981ea1/packages/camera/camera_avfoundation/ios/Classes/FLTCam.m#L415) that)

Bug was introduced in flutter/plugins#1370.

*List which issues are fixed by this PR. You must list at least one issue.*

flutter/flutter#132013

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
implemented using RecordSettings with std::optional.

RecorderSettings native test added.

suggestions applied

Merge branch 'main' into camera-with-settings-platform-implementations
 indicates a new feature< according to https://dart.dev/tools/pub/versioning#semantic-versions

splitted .having

Roll Flutter from 684247a3c78a to ddf60fb08733 (12 revisions) (flutter#5949)

flutter/flutter@684247a...ddf60fb

2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1385f76018ab to 704ef3399012 (1 revision) (flutter/flutter#141932)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6f6649bdfef2 to 1385f76018ab (1 revision) (flutter/flutter#141926)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4d67f267b115 to 6f6649bdfef2 (1 revision) (flutter/flutter#141920)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 53a2436cf75c to 4d67f267b115 (1 revision) (flutter/flutter#141917)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from a9b87c6288d2 to 53a2436cf75c (1 revision) (flutter/flutter#141916)
2024-01-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from d00e55f7f8ed to a9b87c6288d2 (3 revisions) (flutter/flutter#141914)
2024-01-20 31859944+LongCatIsLooong@users.noreply.github.com Remove more textScaleFactor references (flutter/flutter#141816)
2024-01-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 517fc2bbfa51 to d00e55f7f8ed (1 revision) (flutter/flutter#141909)
2024-01-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from f2b441a26416 to 517fc2bbfa51 (2 revisions) (flutter/flutter#141904)
2024-01-19 tessertaha@gmail.com Fix "Delete" tooltip is shown disabled on chips with `onDeleted` callback (flutter/flutter#141770)
2024-01-19 godofredoc@google.com Run module_test_ios on arm and x64 (flutter/flutter#141815)
2024-01-19 36861262+QuncCccccc@users.noreply.github.com `SearchAnchor` search view clear button only shows up when text input is not empty (flutter/flutter#141755)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC dit@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
[pigeon] Improve style of generated Swift code (flutter#5938)

Cleans up our Swift output to be more idiomatic (or in a couple of cases to match swift-format` in particular):
- Don't indent `case`s in `switch`es.
- Remove some stray `;`s
- Remove `()`s around `if` conditions
- Add trailing newlines in multi-element arrays
- Fix some missing standard whitespace in a handful of places where it was missing (after named arguments, between `()` and `{`)
- Indent inside `#if` constructs.
- Two changes that are more arguable, as it's not clear that they are non-idiomatic vs just non-`swift-format`-style (and they add branching to the generator that would otherwise not be needed):
  - Don't put a trailing comma on the list element of a one-element list
  - Don't put `()` on zero-arg method calls with a trailing closure

With these changes, as far as can tell the diffs created by `swift-format` are just line wrapping.

Fixes flutter/flutter#141799
Add stubs to satisfy [FLTCamSampleBufferTests testDidOutputSampleBuffer_mustNotChangeSampleBufferRetainCountAfterPauseResumeRecording] test error.

[FLTCamSampleBufferTests testDidOutputSampleBuffer_mustNotChangeSampleBufferRetainCountAfterPauseResumeRecording] : *** -[AVAssetWriterInputPixelBufferAdaptor initWithAssetWriterInput:sourcePixelBufferAttributes:] invalid parameter not satisfying: [[input mediaType] isEqualToString:AVMediaTypeVideo] || [[input mediaType] isEqualToString:AVMediaTypeAuxiliaryPicture] (NSInvalidArgumentException)

Merge branch 'main' into camera-with-settings-platform-implementations
[pigeon] Support other hosts in generated file CI checks (flutter#5944)

Reworks Pigeon's CI validation of generated files to support multiple hosts, rather than only Linux, with the ability to set specific languages per host, to allow us to run validation for each language on whatever host it is most convenient to set up a formatter for that language, rather than having to support all languages on Linux.

See discussion in flutter#5928

Part of flutter/flutter#41129
optional integer testing

renamed to toPositiveOrNull

commented behaviour

Merge remote-tracking branch 'origin/camera-with-settings-platform-implementations' into camera-with-settings-platform-implementations

Merge branch 'main' into camera-with-settings-platform-implementations
new feature: increment last version number part.

Update platform label rules for shared iOS/macOS (flutter#5801)

Update automatic platform label rules for more implementations that are
shared between iOS and macOS.
Merge branch 'main' into camera-with-settings-platform-implementations
@TahaTesser TahaTesser deleted the disabled_chip_delete_tooltip branch January 22, 2024 08:35
@TahaTesser
Copy link
Member Author

Thanks @TahaTesser! Now my chips will be properly disabled :D

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disabled chips with onDeleted callback shows "Delete" tooltip on hover
3 participants