3431 Commits

Author SHA1 Message Date
Kostia Sokolovskyi
e8d9d9bfd5
HeroController should dispatch creation and disposal events. (#137835) 2023-11-03 20:42:47 -07:00
Michael Goderbauer
8a0f9118ea
Remove unused generic type from BottomSheet (#137791)
Fixes https://github.com/flutter/flutter/issues/137424.

The generic type argument was unused.
2023-11-03 22:25:37 +00:00
Kostia Sokolovskyi
a52f030cda
InkFeature should dispatch creation and disposal events. (#137793) 2023-11-03 12:34:16 -07:00
Qun Cheng
4a0f261b4e
Add Card.filled and Card.outlined factory methods (#136229)
Fixes #119401

This PR is to:
* add `Card.filled` and `Card.outlined` factory methods so that we can use tokens for these two types of cards to generate default theme instead of providing hard-corded values in example.
* update card.2.dart example.
* add test file for card.2.dart example.
* fix some mismatch caused by editing the auto-generated defaults by hand in navigation_bar.dart and navigation_drawer.dart.
2023-11-01 23:29:49 +00:00
auto-submit[bot]
b47e4c4acb
Reverts "Update framework_test.dart to remove ButtonBar usage and remove references from other clases" (#137731)
Reverts flutter/flutter#137550
Initiated by: Piinks
This change reverts the following previous change:
Original Description:
This PR removes `ButtonBar` usage from `framework_test.dart` class and update other references in preparation for `ButtonBar` deprecation

related to https://github.com/flutter/flutter/issues/127955
2023-11-01 22:58:19 +00:00
Taha Tesser
b1f5d96a82
Update framework_test.dart to remove ButtonBar usage and remove references from other clases (#137550)
This PR removes `ButtonBar` usage from `framework_test.dart` class and update other references in preparation for `ButtonBar` deprecation

related to https://github.com/flutter/flutter/issues/127955
2023-11-01 22:03:54 +00:00
Binni Goel
e7726ea6f2
fix. typos (#137178)
## Description

This PR fixes typos in 
- `checkbox.dart`
- `chip_test.dart`
- `color_scheme.dart`
- `color_scheme_test.dart`
- `curves.dart`
2023-10-31 23:27:03 +00:00
Taha Tesser
eba149fcc3
Revert "Update DataTable test when data row is pressed for Material 3 (#137230)" (#137407)
This reverts commit 64f31b2f1a99f394dc4a9f194a93bf8532f35b77.

*Replace this paragraph with a description of what this PR is changing
or adding, and why. Consider including before/after screenshots.*

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

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## 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].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-10-27 12:04:07 +03:00
Taha Tesser
a0e8b6aec8
Revert "Reland - Update OutlinedButton tests for Material 3 (#136809) (#137247)" (#137406)
…9) (#137247)"

This reverts commit 008a10f15898f397a7f0d1ad8e725c01ad61ab3f.

*Replace this paragraph with a description of what this PR is changing
or adding, and why. Consider including before/after screenshots.*

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

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## 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].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-10-27 12:01:51 +03:00
Taha Tesser
64f31b2f1a
Update DataTable test when data row is pressed for Material 3 (#137230)
This updates one of them M3 test to use golden test from https://github.com/flutter/flutter/pull/135901
Keeping it consistent with this [update](https://github.com/flutter/flutter/pull/136809#discussion_r1365053630)
2023-10-27 07:23:26 +00:00
Taha Tesser
008a10f158
Reland - Update OutlinedButton tests for Material 3 (#136809) (#137247)
This relands https://github.com/flutter/flutter/pull/136809 (it was reverted in https://github.com/flutter/flutter/pull/137242)
---

Updated unit tests for `CircleOutlinedButton` to have M2 and M3 versions.

More info in #127064

This also gets rid of unnecessary `fromSwatch` usage (part of https://github.com/flutter/flutter/issues/132584 documentation and test cleanup)
2023-10-27 07:20:10 +00:00
Tirth
b62da79190
Fix Typos (#137292)
Fix Small Typos.
2023-10-26 23:55:38 +00:00
Kostia Sokolovskyi
aeb500a060
AnimationController should dispatch creation in constructor. (#134839) 2023-10-26 16:23:33 -07:00
Mairramer
de4e3d67a0
fix:: trigger onTapOutside only if has focus (#136291)
Adds new feat and fix to https://github.com/flutter/flutter/issues/134341
2023-10-26 00:26:20 +00:00
Taha Tesser
d0fe9f203d
Revert "Update OutlinedButton tests for Material 3 (#136809)" (#137242)
This reverts commit d36a843335aae6f6b60acb6b6d005e47d61f1c6e
(https://github.com/flutter/flutter/pull/136809)

This fails even tho golden files were approved and `golden test` pending
was cleared and green and `autosubmit` successfully merged the PR.


```console
02:42 +4618 ~5: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following SkiaException was thrown while running async test code:
Skia Gold received an unapproved image in post-submit
testing. Golden file images in flutter/flutter are triaged
in pre-submit during code review for the given PR.

Visit https://flutter-gold.skia.org/ to view and approve
the image(s), or revert the associated change. For more
information, visit the wiki:
https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter

Debug information for Gold --------------------------------
stdout: Given image with hash 37275e74c51f98d7abd7f301c5c94ac1 for test
material.outlined_button.ink_sparkle.default
Expectation for test: 531f5fa74908d2e6db2b8fd86a6b8662 (positive)
Expectation for test: 683e368ff51d947a3d63c2a5f4568cf6 (positive)
Expectation for test: 749241ff0fa21595b2c6cb551fd40b68 (positive)
Expectation for test: aaf9ac1328614d6c9f4540308bc86f62 (positive)
Expectation for test: b31a50440c7dd31b10cacd9e7b5c6b86 (positive)
Expectation for test: c0a7c8c625b69ddc695a770f28abd403 (positive)
Expectation for test: f1f66ce931c2ef33ebcb699a637025a6 (positive)
Expectation for test: 2d32e34efc1d7ca4cd12965402fb76ff (positive)
Untriaged or negative image:
https://flutter-gold.skia.org/detail?grouping=name%3Dmaterial.outlined_button.ink_sparkle.default%26source_type%3Dflutter&digest=37275e74c51f98d7abd7f301c5c94ac1


stderr: Test: material.outlined_button.ink_sparkle.default FAIL


result-state.json: No result file found.

When the exception was thrown, this was the stack:
#0      SkiaGoldClient.imgtestAdd (package:flutter_goldens_client/skia_client.dart:243:7)
<asynchronous suspension>
#1      MatchesGoldenFile.matchAsync.<anonymous closure> (package:flutter_test/src/_matchers_io.dart:118:32)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from dart:async)

The exception was caught asynchronously.
════════════════════════════════════════════════════════════════════════════════════════════════════
02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works
02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults [E]
  Test failed. See exception logs above.
  The test description was: Material3 - OutlinedButton, OutlinedButton.icon defaults
  
02:42 +4619 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works
```

## 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].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-10-25 14:48:27 +03:00
Taha Tesser
d36a843335
Update OutlinedButton tests for Material 3 (#136809)
Updated unit tests for `CircleOutlinedButton` to have M2 and M3 versions.

More info in #127064

This also gets rid of unnecessary `fromSwatch` usage (part of https://github.com/flutter/flutter/issues/132584 documentation and test cleanup)
2023-10-25 10:06:27 +00:00
Tirth
ad448db6b5
Fix Typos (#137173)
Fix Small Typos.
2023-10-24 22:35:05 +00:00
lirantzairi
7cd6fd43a1
TextField - allow to customize cursor color in error state (#136121)
The color of the TextField's cursor in error state is the same as the error text color by default. However we should be allowed to customize it

Fixes #135580
2023-10-24 20:44:18 +00:00
Kostia Sokolovskyi
38f318b465
Cover last test/material tests with leak tracking. (#137004) 2023-10-23 14:37:43 -07:00
Tirth
2de1af40f3
Add InputDatePickerFormField.focusNode prop (#136673)
Adds `focusNode` prop to `InputDatePickerFormField` widget.

Fixes #105881
2023-10-23 17:15:08 +00:00
Taha Tesser
6c3010e7e1
Add delete button support to FilterChip (#136645)
fixes [`FilterChip` should have `DeletableChipAttributes`/`trailing` to match Material 3 spec.](https://github.com/flutter/flutter/issues/135595)

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

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

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

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

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('FilterChip'),
            const SizedBox(height: 8),
            FilterChip(
              avatar: const Icon(Icons.favorite_rounded),
              label: const Text('FilterChip'),
              selected: true,
              showCheckmark: false,
              onSelected: (bool value) {},
              onDeleted: () {},
              deleteButtonTooltipMessage: 'Delete Me!',
            ),
            const SizedBox(height: 16),
            FilterChip(
              avatar: const Icon(Icons.favorite_rounded),
              label: const Text('FilterChip'),
              onSelected: (bool value) {},
              onDeleted: () {},
            ),
            const SizedBox(height: 48),
            const Text('FilterChip.elevated'),
            const SizedBox(height: 8),
            FilterChip.elevated(
              avatar: const Icon(Icons.favorite_rounded),
              label: const Text('FilterChip'),
              selected: true,
              showCheckmark: false,
              onSelected: (bool value) {},
              onDeleted: () {},
            ),
            const SizedBox(height: 16),
            FilterChip.elevated(
              avatar: const Icon(Icons.favorite_rounded),
              label: const Text('FilterChip'),
              onSelected: (bool value) {},
              onDeleted: () {},
            ),
          ],
        ),
      ),
    );
  }
}
```

</details>

### Before

Not possible to add delete button

### After 
![Screenshot 2023-10-16 at 17 56 51](https://github.com/flutter/flutter/assets/48603081/ad751ef9-c2bc-4184-ae5f-4d1017eff664)
2023-10-23 16:19:25 +00:00
LongCatIsLooong
af129b61c5
OverlayPortal.overlayChild contributes semantics to OverlayPortal instead of Overlay (#134921)
Fixes https://github.com/flutter/flutter/issues/134456
2023-10-23 15:45:46 +00:00
Qun Cheng
40776d01f1
Allow users to customize search algorithm in DropdownMenu (#136848)
Fixes #136735

This PR is to add a searchCallback to allow users to customize the search algorithm. This feature is used to fix b/305662376 which needs an exact match algorithm.
2023-10-19 18:32:50 +00:00
Kostia Sokolovskyi
9fa9fd365c
_DefaultTabControllerState should dispose all created TabContoller instances. (#136608) 2023-10-19 10:38:19 -07:00
Greg Spencer
13a0d475f5
Convert menus to use OverlayPortal (#130534)
## Description

This converts the `MenuAnchor` class to use `OverlayPortal` instead of directly using the overlay.

## Related Issues
 - Fixes https://github.com/flutter/flutter/issues/124830

## Tests
 - No tests yet (hence it is a draft)
2023-10-18 20:13:08 +00:00
Taha Tesser
4f959b97a7
Fix Slider onChanged callback order & never calls onChangeStart on SliderInteraction.slideOnly allowed interaction (#136720)
fixes [Slider will call onChanged before onChangeStart when sliding.](https://github.com/flutter/flutter/issues/136707)

This fixes a regression from https://github.com/flutter/flutter/pull/121483

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
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> {
  double _sliderValue = 0.5;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Slider(
          // allowedInteraction: SliderInteraction.tapAndSlide,
          // allowedInteraction: SliderInteraction.tapOnly,
          // allowedInteraction: SliderInteraction.slideOnly
          // allowedInteraction: SliderInteraction.slideThumb,
          value: _sliderValue,
          onChangeStart: (newValue) {
            print("onChangeStart ......");
          },
          onChanged: (newValue) {
            print("onChanged ......");
            setState(() {
              _sliderValue = newValue;
            });
          },
          onChangeEnd: (newValue) {
            print("onChangeEnd ......");
          },
        ),
      ),
    );
  }
}
```

</details>
2023-10-18 16:25:47 +00:00
Arash
a9567313c1
[Feat] Stroke color for Slider value indicator (#135986)
Consider a scenario where the background color and indicator's background color are the same. 

Adding a stroke color to the value indicator would be a valuable for the following reasons:
- **Visual Clarity:** It would allow developers to make the value indicator stand out more against the background, making it easier for users to notice.
- **Customization:** It would provide more flexibility in customizing the appearance of the sliding widget, allowing developers to match the design requirements of their apps.
- **Accessibility:** Improved visual distinction can enhance the accessibility of the sliding widget for users with various needs.

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

Fixes #135984
2023-10-18 16:03:08 +00:00
Aakash Pamnani
941897f60b
Fixed : Empty Rows shown at last page in Paginated data table (#132646)
Fixed empty rows at the last page in paginated data table

BEFORE:
![Before](https://github.com/flutter/flutter/assets/76067278/1f1e364c-df38-462f-b9fb-868554ce04a5)

AFTER:
![After](https://github.com/flutter/flutter/assets/76067278/80648a25-e9e6-4873-805f-b18c7c6a00af)

Issues resolves : #80421
2023-10-18 15:44:31 +00:00
Dan Field
2df7244f74
Do not hold on to stale canvas reference in _RenderSegmentedButton (#136658)
Fixes https://github.com/flutter/flutter/issues/135747

Before this change, the render object was storing the `context.canvas` and using it after painting children. If those children were composited (e.g. because of an `Opacity` layer), the canvas it stored was disposed and not valid for use anymore.
2023-10-16 21:03:59 +00:00
Taha Tesser
17c664fbbd
Fix NavigationRail's indicator inkwell doesn't support transparent color. (#136359)
fixes [NavigationRail can't have a transparent Hover color because there is always opacity set](https://github.com/flutter/flutter/issues/135866)

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.green).copyWith(
          primary: Colors.transparent,
        ),
      ),
      home: const Example(),
    );
  }
}

class Example extends StatefulWidget {
  const Example({Key? key}) : super(key: key);

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

class _ExampleState extends State<Example> {
  int _selectedIndex = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('NavigationRail Example'),
      ),
      body: Row(
        children: <Widget>[
          NavigationRail(
            selectedIndex: _selectedIndex,
            onDestinationSelected: (int index) {
              setState(() {
                _selectedIndex = index;
              });
            },
            labelType: NavigationRailLabelType.all,
            destinations: const <NavigationRailDestination>[
              NavigationRailDestination(
                icon: Icon(Icons.favorite_border),
                selectedIcon: Icon(Icons.favorite),
                label: Text('First'),
              ),
              NavigationRailDestination(
                icon: Icon(Icons.bookmark_border),
                selectedIcon: Icon(Icons.book),
                label: Text('Second'),
              ),
              NavigationRailDestination(
                icon: Icon(Icons.star_border),
                selectedIcon: Icon(Icons.star),
                label: Text('Third'),
              ),
            ],
          ),
          const VerticalDivider(thickness: 1, width: 1),
          Expanded(
            child: Center(
              child: Text('Selected Index: $_selectedIndex'),
            ),
          )
        ],
      ),
    );
  }
}
```

</details>
2023-10-16 08:48:13 +00:00
Kostia Sokolovskyi
2c3db435a8
_RouterState should dispose created _RestorableRouteInformation. (#136556)
### Description
- Fixes https://github.com/flutter/flutter/issues/134205.

### Tests
- Removes ignoring the `_RestorableRouteInformation` leak from `cupertino/app_test.dart`;
- Removes ignoring the `_RestorableRouteInformation` leak from `material/app_test.dart`;
- Removes ignoring the `_RestorableRouteInformation` leak from `widgets/app_test.dart`;
- Removes ignoring the `_RestorableRouteInformation` leak from `widgets/route_notification_messages_test.dart`;
- Removes ignoring the `_RestorableRouteInformation` leak from `widgets/router_restoration_test.dart`;
- Updates `widgets/router_test.dart` to use `testWidgetsWithLeakTracking`.
2023-10-14 02:58:17 +00:00
Kostia Sokolovskyi
7d79472531
SearchAnchor should dispose created FocusNode and SearchController. (#136120) 2023-10-12 19:35:46 -07:00
Greg Spencer
22b0a62a0c
Allow TapRegion to consume tap events (#136305)
## Description

In order for `MenuAnchor` menus to be able to not pass on the taps that close their menus, `TapRegion` needed a way to consume them.  This change adds a flag to the `TapRegion`, `consumeOutsideTap` that will consume taps that occur outside of the region if the flag is set (it is false by default). The same flag is added to `MenuAnchor` to allow selecting the behavior for menus.

`TapRegion` consumes the tap event by registering with the gesture arena and immediately resolving the tap as accepted if any regions in a group have `consumeOutsideTap` set to true.

This PR also deprecates `MenuAnchor.anchorTapClosesMenu`, since it is a much more limited version of the same feature that only applied to the anchor itself, and even then only applied to closing the menu, not passing along the tap.  The same functionality can now be implemented by handling a tap on the anchor widget and checking to see if the menu is open before closing it.

## Related Issues
 - https://github.com/flutter/flutter/issues/135327

## Tests
 - Added tests for `TapRegion` to make sure taps are consumed properly.
2023-10-12 21:04:41 +00:00
Taha Tesser
f65dd3bac0
Fix chip widgets don't the apply provided iconTheme (#135751)
fixes [`Chip.iconTheme` does not apply the icon theme](https://github.com/flutter/flutter/issues/111828)

### Description
- Fix chip widgets that don't utilize the provided `iconTheme`.
- Prevent `iconTheme` with just color from overriding the default icon size.
- Add some missing M3 tests for the chip and chip theme properties.

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

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

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

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

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

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

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            RawChip(
              iconTheme: const IconThemeData(color: Colors.amber),
              avatar: const Icon(Icons.favorite_rounded),
              label: const Text('RawChip'),
              onPressed: () {},
              isEnabled: _isEnable,
            ),
            const Chip(
              iconTheme: IconThemeData(color: Colors.amber),
              avatar: Icon(Icons.favorite_rounded),
              label: Text('Chip'),
              // onDeleted: () {},
            ),
            FilterChip(
              iconTheme: const IconThemeData(color: Colors.amber),
              avatar: const Icon(Icons.favorite_rounded),
              label: const Text('FilterChip'),
              selected: false,
              onSelected: _isEnable ? (bool value) {} : null,
            ),
            InputChip(
              iconTheme: const IconThemeData(color: Colors.amber),
              avatar: const Icon(Icons.favorite_rounded),
              label: const Text('InputChip'),
              isEnabled: _isEnable,
              onPressed: () {},
            ),
            ActionChip(
              iconTheme: const IconThemeData(color: Colors.amber),
              avatar: const Icon(Icons.favorite_rounded),
              label: const Text('ActionChip'),
              onPressed: _isEnable ? () {} : null,
            ),
            ChoiceChip(
              iconTheme: const IconThemeData(color: Colors.amber),
              avatar: const Icon(Icons.favorite_rounded),
              label: const Text('ChoiceChip'),
              selected: false,
              onSelected: _isEnable ? (bool value) {} : null,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        child: const Icon(Icons.add),
      ),
    );
  }
}

```

</details>

### Before
![Screenshot 2023-09-29 at 16 59 39](https://github.com/flutter/flutter/assets/48603081/4bc32032-cff3-4237-812f-86f17ed95337)

### After

![Screenshot 2023-09-29 at 16 55 24](https://github.com/flutter/flutter/assets/48603081/05a1fc52-fb31-4790-a840-18f2e9718241)
2023-10-12 14:17:56 +00:00
Qun Cheng
6388e3d727
Floating SnackBar should always float above the bottom widgets (#136411)
Fixes #136162

This PR is to fix the floating `SnackBar` issue so that when the top of the bottom bar is higher than the top of the FAB, the snack bar will still float and not be clipped.

| Before fix | After fix |
|--------|--------|
| ![Screenshot 2023-10-11 at 1 54 30 PM](https://github.com/flutter/flutter/assets/36861262/dbe02312-1a80-4532-9bad-a8f162a6a942) | ![Screenshot 2023-10-11 at 1 54 52 PM](https://github.com/flutter/flutter/assets/36861262/68211de0-f04f-4b1a-b554-baf6a8e2f947)
 |
2023-10-12 01:17:07 +00:00
Bryan Olivares
d9c0d3ae51
SearchBar should listen to changes to the SearchController and update suggestions on change (#134337)
This PR is adding a listener to the `SearchController`, so that the `suggestionBuilder` can be updated when the `SearchController` changes. 

Another method we can possibly do is  have an update method on `SearchController`, so that the user can manually update the suggestions instead of us doing it automatically.

Fixes #132161
2023-10-12 00:55:38 +00:00
Taha Tesser
692d7ade9e
Fix FlexibleSpaceBar does compositing with near zero opacity. (#136255)
fixes [`flexible_space_bar.dart': Failed assertion: line 475 pos 12: 'needsCompositing': is not true.` is thrown when scrolling down in the list and then up](https://github.com/flutter/flutter/issues/135698)
2023-10-11 07:19:30 +00:00
Polina Cherkasova
ad05949971
Fix flakiness: finalize dropped gestures in tests to release resources, and update doc-comment. (#136136) 2023-10-10 18:11:23 -07:00
Kostia Sokolovskyi
0a6947049b
TimePickerDialog should dispose created ChangeNotifiers. (#136261) 2023-10-10 11:05:26 -07:00
Kostia Sokolovskyi
5064f782c1
Cover more test/material tests with leak tracking. (#136093) 2023-10-10 10:05:51 -07:00
Kostia Sokolovskyi
5d9983a125
RenderAnnotatedRegion should dispose created layers. (#136086) 2023-10-10 08:32:01 -07:00
chunhtai
ff73448f33
Reland "Adds a parent scope TraversalEdgeBehavior and fixes modal rou… (#134554)
…… (#134550)"

fixes https://github.com/flutter/flutter/issues/112567

This reverts commit 5900c4baa751aff8f05e820287a02b60cdd62dfa.

The internal test needs migration. cl/564746935

This is the same of original pr, no new change

## 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].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-10-09 09:10:23 -07:00
Taha Tesser
9ab091f92b
Update CircleAvatar & DataTable tests for Material 3 (#135901)
Updated unit tests for `CircleAvatar` & `DataTable` to have M2 and M3 versions.

More info in #127064
2023-10-09 10:05:28 +00:00
Bruno Leroux
a6d712497d
Update BottomSheet test for M3 + fix an issue in elevation resolution (#136071)
This PR updates unit tests from bottom sheet tests for M3 migration.

More info in https://github.com/flutter/flutter/issues/127064

It also contains in bottom_sheet.dart where a default value took precedence over a theme attribute.
2023-10-09 06:31:49 +00:00
LongCatIsLooong
ebe72d3f32
Call markNeedsPaint when adding overlayChild to Overlay (#135941)
Fixes https://github.com/flutter/flutter/issues/134656

`_skipMarkNeesLayout` was meant to only skip `markNeedsLayout` calls. Re-painting is still needed when a child gets added/removed from the `Overlay`.
2023-10-06 22:12:20 +00:00
Kostia Sokolovskyi
d76e3abf10
Fix memory leaks in DateRangePickerDialog. (#136034)
This PR mainly fixes several memory leaks in the `DateRangePickerDialog`.

### Description
- Fixes https://github.com/flutter/flutter/issues/136033 by:
    1) adding a disposal of several `RestorableValue`;
    2) creating a separate `_DayItem` stateful widget that creates/updates/disposes internal `MaterialStatesController`.
- Marks https://github.com/flutter/flutter/issues/136036.

### Tests
- Updates `test/material/date_picker_theme_test.dart` to use `testWidgetsWithLeakTracking`;
- Updates `test/material/date_range_picker_test.dart` to use `testWidgetsWithLeakTracking`.
2023-10-06 11:26:06 +00:00
Mitchell Goodwin
57ed724177
Update dialog tests for Material3 (#135775)
Separates the tests for the Material dialog into Material3 and Material2 versions.

More info in #127064
2023-10-02 11:03:18 +00:00
Kostia Sokolovskyi
fdde24195f
DraggableScrollableController should dispatch creation in constructor. (#135423) 2023-09-29 17:45:35 -07:00
Taha Tesser
ebaf160391
Update Drawer tests for M2/M3 (#135752)
Updated unit tests for `Drawer` to have M2 and M3 versions.

More info in #127064
2023-09-29 18:15:53 +00:00
Bruno Leroux
e61f9e0ce5
Fix TabBarView.viewportFraction change is ignored (#135590)
## Description

This PR updates `_TabBarViewState.didUpdateWidget` in order to react to `TabBarView.viewportFraction`change.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/135557.

## Tests

Adds 1 test.
2023-09-28 19:56:15 +00:00