1. 13 Feb, 2024 1 commit
    • Taha Tesser's avatar
      Introduce `avatarBoxConstraints` & `deleteIconBoxConstraints` for the chips (#143302) · ccf42dde
      Taha Tesser authored
      fixes [Chip widget's avatar padding changing if label text is more than 1 line](https://github.com/flutter/flutter/issues/136892)
      
      ### Code sample
      
      <details>
      <summary>expand to view the code sample</summary> 
      
      ```dart
      import 'package:flutter/material.dart';
      
      List<String> strings = [
        'hello good morning',
        'hello good morning hello good morning',
        'hello good morning hello good morning hello good morning'
      ];
      
      void main() => runApp(const MyApp());
      
      class MyApp extends StatelessWidget {
        const MyApp({super.key});
      
        @override
        Widget build(BuildContext context) {
          return MaterialApp(
            debugShowCheckedModeBanner: false,
            home: Scaffold(
              body: Center(
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: [
                    Column(
                      mainAxisSize: MainAxisSize.min,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        const Text(
                            'avatarBoxConstraints: null \ndeleteIconBoxConstraints: null',
                            textAlign: TextAlign.center),
                        for (String string in strings)
                          Padding(
                            padding: const EdgeInsets.all(8.0),
                            child: RawChip(
                              label: Container(
                                width: 150,
                                color: Colors.amber,
                                child: Text(
                                  string,
                                  maxLines: 3,
                                  overflow: TextOverflow.ellipsis,
                                ),
                              ),
                              avatar: const Icon(Icons.settings),
                              onDeleted: () {},
                            ),
                          ),
                      ],
                    ),
                    Column(
                      mainAxisSize: MainAxisSize.min,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        const Text(
                            'avatarBoxConstraints: BoxConstraints.tightForFinite() \ndeleteIconBoxConstraints: BoxConstraints.tightForFinite()',
                            textAlign: TextAlign.center),
                        for (String string in strings)
                          Padding(
                            padding: const EdgeInsets.all(8.0),
                            child: RawChip(
                              avatarBoxConstraints:
                                  const BoxConstraints.tightForFinite(),
                              deleteIconBoxConstraints:
                                  const BoxConstraints.tightForFinite(),
                              label: Container(
                                width: 150,
                                color: Colors.amber,
                                child: Text(
                                  string,
                                  maxLines: 3,
                                  overflow: TextOverflow.ellipsis,
                                ),
                              ),
                              avatar: const Icon(Icons.settings),
                              onDeleted: () {},
                            ),
                          ),
                      ],
                    ),
                  ],
                ),
              ),
            ),
          );
        }
      }
      
      ```
      
      </details>
      
      ### Preview
      ![Screenshot 2024-02-12 at 14 58 35](https://github.com/flutter/flutter/assets/48603081/5724bd07-7ac7-4987-b992-fa3ab8488273)
      
      # Example previews
      ![Screenshot 2024-02-12 at 22 15 14](https://github.com/flutter/flutter/assets/48603081/33af472d-3561-47d4-8d0d-e1628de1e0aa)
      ![Screenshot 2024-02-12 at 22 15 46](https://github.com/flutter/flutter/assets/48603081/3de78b59-5cb6-4fd8-879b-8e204aacb069)
      ccf42dde
  2. 01 Feb, 2024 1 commit
  3. 24 Jan, 2024 1 commit
  4. 22 Jan, 2024 1 commit
    • Hassan Toor's avatar
      [web] - Fix broken `TextField` in semantics mode when it's a sibling of `Navigator` (#138446) · 59e892d3
      Hassan Toor authored
      When a `TextField` is rendered before a `Navigator`, it breaks in semantics mode.  This is because the framework generates the incorrect semantics tree (excludes the TextField) and when that tree gets sent to the engine, we don't get the signal to create the corresponding `<input>` element.
      
      This happens for a few reasons:
      * `ModalBarrier` uses `BlockSemantics` to drop the semantics of routes beneath the current route in `Navigator`
      * `ModalBarrier` mistakenly recognizes the widget outside of the `Navigator` to be its sibling
      *  So we end up dropping the semantics node of the `TextField` rendered before it. 
      
      The fix is to let `Navigator` generate a semantics node so that `ModalBarrier` doesn't mistakenly think widgets outside of `Navigator` are its siblings.  
      
      `Navigator` doesn't currently do this, which causes all the nodes generated from its widget subtree to be directly attached to the parent semantics node above `Navigator` - since this is also the parent of `TextField`, it considers them siblings. 
      
      Fixes https://github.com/flutter/flutter/issues/129324
      59e892d3
  5. 20 Jan, 2024 1 commit
    • LongCatIsLooong's avatar
      Remove more textScaleFactor references (#141816) · 5892a003
      LongCatIsLooong authored
      Remove more `textScaleFactor` references from flutter/flutter.  
      
      - Some changes are related to label scaling: the padding EdgeInsets values of some chip subclasses scale linearly between predetermined "max" padding values and "min" padding values. Before they scale with the `textScaleFactor` scalar, now they scale with the font size and are still capped at the original "max" and "min" values.
      - The rest of them are tests or size heuristics that depend on `textScaleFactor`, these are replaced by an effective text scale factor computed using a default font size (which is determined in a pretty random fashion, but it will only make a difference on Android 14+).
      
      No API changes in this batch. There are still some references left that I intend to remove in a different batch that would introduce API changes.
      5892a003
  6. 19 Jan, 2024 1 commit
    • Taha Tesser's avatar
      Fix "Delete" tooltip is shown disabled on chips with `onDeleted` callback (#141770) · 788614d1
      Taha Tesser authored
      fixes [Disabled chips with `onDeleted` callback shows "Delete" tooltip on hover](https://github.com/flutter/flutter/issues/141336)
      
      ### 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> {
        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'),
            ),
          );
        }
      }
      ```
      
      </details>
      
      ### Preview
      
      | Before | After |
      | --------------- | --------------- |
      | <img src="https://github.com/flutter/flutter/assets/48603081/f80ae5f7-0a6d-4041-ade3-cbc2b5c78188" height="450" /> | <img src="https://github.com/flutter/flutter/assets/48603081/04e62854-e3f1-4b65-9753-183d288f3cfe" height="450" /> |
      788614d1
  7. 09 Jan, 2024 1 commit
  8. 15 Dec, 2023 1 commit
  9. 29 Nov, 2023 1 commit
    • Taha Tesser's avatar
      Fix chips `onDeleted` callback don't show the delete button when disabled (#137685) · 4648f544
      Taha Tesser authored
      fixes [Chips with `onDeleted` callback should show the delete button in the `disabled` state](https://github.com/flutter/flutter/issues/136638)
      
      ### 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> {
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            body: Center(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: <Widget>[
                  RawChip(
                    avatar: const Icon(Icons.favorite_rounded),
                    label: const Text('RawChip'),
                    onSelected: null,
                    isEnabled: false,
                    onDeleted: () {},
                  ),
                  InputChip(
                    avatar: const Icon(Icons.favorite_rounded),
                    label: const Text('InputChip'),
                    isEnabled: false,
                    onPressed: null,
                    onDeleted: () {},
                  ),
                  FilterChip(
                    avatar: const Icon(Icons.favorite_rounded),
                    label: const Text('FilterChip'),
                    onSelected: null,
                    onDeleted: () {},
                  ),
                ],
              ),
            ),
          );
        }
      }
      ```
      
      </details>
      
      | Before | After |
      | --------------- | --------------- |
      | <img src="https://github.com/flutter/flutter/assets/48603081/8bd458de-cfd2-44f0-a0dd-a8298938c61f" /> | <img src="https://github.com/flutter/flutter/assets/48603081/afca0684-b061-416b-b029-5316588c6888" /> |
      4648f544
  10. 21 Nov, 2023 1 commit
    • Taha Tesser's avatar
      Fix Chips with Tooltip throw an assertion when enabling or disabling (#138799) · e6d43ac6
      Taha Tesser authored
      fixes [Enabling or disabling a `Chip`/`RawChip` with a tooltip throws an exception](https://github.com/flutter/flutter/issues/138287) 
      
      ### 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) {
          bool isEnabled = true;
      
          return MaterialApp(
            home: Material(
              child: Center(
                child: StatefulBuilder(
                    builder: (BuildContext context, StateSetter setState) {
                  return Column(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      RawChip(
                        tooltip: 'This is a tooltip',
                        isEnabled: isEnabled,
                        label: const Text('RawChip'),
                        onPressed: isEnabled ? () {} : null,
                      ),
                      const SizedBox(height: 20),
                      ElevatedButton(
                        onPressed: () {
                          setState(() {
                            isEnabled = !isEnabled;
                          });
                        },
                        child: Text('${isEnabled ? 'Disable' : 'Enable'} Chip'),
                      )
                    ],
                  );
                }),
              ),
            ),
          );
        }
      }
      ```
      
      </details>
      e6d43ac6
  11. 31 Oct, 2023 1 commit
    • Binni Goel's avatar
      fix. typos (#137178) · e7726ea6
      Binni Goel authored
      ## Description
      
      This PR fixes typos in 
      - `checkbox.dart`
      - `chip_test.dart`
      - `color_scheme.dart`
      - `color_scheme_test.dart`
      - `curves.dart`
      e7726ea6
  12. 12 Oct, 2023 1 commit
    • Taha Tesser's avatar
      Fix chip widgets don't the apply provided `iconTheme` (#135751) · f65dd3ba
      Taha Tesser authored
      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)
      f65dd3ba
  13. 10 Oct, 2023 1 commit
  14. 22 Sep, 2023 1 commit
  15. 18 Sep, 2023 1 commit
  16. 12 Sep, 2023 1 commit
  17. 11 Sep, 2023 1 commit
  18. 07 Sep, 2023 1 commit
  19. 30 Aug, 2023 1 commit
  20. 25 Aug, 2023 1 commit
    • Taha Tesser's avatar
      Fix `Chip.shape`'s side is not used when provided in Material 3 (#132941) · 612117a6
      Taha Tesser authored
      fixes [Chip border side color not working in Material3](https://github.com/flutter/flutter/issues/132922)
      
      ### 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(
            theme: ThemeData(
              useMaterial3: true,
              chipTheme: const ChipThemeData(
                  // shape: RoundedRectangleBorder(
                  //   side: BorderSide(color: Colors.amber),
                  //   borderRadius: BorderRadius.all(Radius.circular(12)),
                  // ),
                  // side: BorderSide(color: Colors.red),
                  ),
            ),
            home: const Example(),
          );
        }
      }
      
      class Example extends StatelessWidget {
        const Example({super.key});
      
        @override
        Widget build(BuildContext context) {
          return const Scaffold(
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                // side: BorderSide(color: Colors.red),
                label: Text('Chip'),
              ),
            ),
          );
        }
      }
      
      ``` 
      
      </details>
      
      ---
      
      ### Before
      
      When `RawChip.shape` is provided with a `BorderSide`.
      
      ```dart
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                label: Text('Chip'),
              ),
            ),
      ```
      
      ![Screenshot 2023-08-24 at 17 54 54](https://github.com/flutter/flutter/assets/48603081/89e2c9b5-44c2-432e-97ff-8bb95b0d0fb1)
      
      When `RawChip.shape` is provided with a `BorderSide` and also `RawChip.side` is provided. The  `RawChip.side` overrides the shape's side.
      
      ```dart
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                side: BorderSide(color: Colors.red),
                label: Text('Chip'),
              ),
            ),
      ```
      
      ![Screenshot 2023-08-24 at 17 55 37](https://github.com/flutter/flutter/assets/48603081/938803cc-d514-464b-b06b-e4841b9ad040)
      
      ---
      
      ### After
      
      When `RawChip.shape` is provided with a `BorderSide`.
      
      ```dart
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                label: Text('Chip'),
              ),
            ),
      ```
      
      ![Screenshot 2023-08-24 at 17 51 29](https://github.com/flutter/flutter/assets/48603081/d6fcaaa9-8f5d-4180-ad14-062dd459ec45)
      
      When `RawChip.shape` is provided with a `BorderSide` and also `RawChip.side` is provided. The  `RawChip.side` overrides the shape's side.
      
      ```dart
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                side: BorderSide(color: Colors.red),
                label: Text('Chip'),
              ),
            ),
      ```
      
      ![Screenshot 2023-08-24 at 17 52 31](https://github.com/flutter/flutter/assets/48603081/3fa46341-43f0-4fe7-a922-f1d8ba34028c)
      
      ---
      612117a6
  21. 14 Aug, 2023 1 commit
  22. 10 Aug, 2023 1 commit
  23. 09 Aug, 2023 1 commit
  24. 08 Aug, 2023 1 commit
  25. 07 Aug, 2023 1 commit
  26. 22 Jul, 2023 1 commit
  27. 20 Jul, 2023 1 commit
  28. 26 Jun, 2023 1 commit
  29. 19 Jun, 2023 1 commit
    • Taha Tesser's avatar
      Introduce MaterialState `color` property for chips (#128584) · 467c970b
      Taha Tesser authored
      fixes https://github.com/flutter/flutter/issues/115827
      fixes https://github.com/flutter/flutter/issues/101325
      
      ### Description
      1. This PR adds a new MaterialState `color` property to all the chips (this makes it possible to customize chips in all states from the M3 specs).
      2. Updated defaults to use the new  MaterialState `color` property.
      3. Updated and added new tests to all the chip test classes.
      
      <details> 
      <summary>code sample</summary> 
      
      ```dart
      import 'package:flutter/material.dart';
      
      const Color disabledColor = Colors.black26;
      const Color backgroundColor = Colors.cyan;
      final Color disabledSelectedColor = Colors.red.shade100;
      const Color selectedColor = Colors.amber;
      final MaterialStateProperty<Color> color =
          MaterialStateProperty.resolveWith((Set<MaterialState> states) {
        if (states.contains(MaterialState.disabled) &&
            states.contains(MaterialState.selected)) {
          return disabledSelectedColor;
        }
        if (states.contains(MaterialState.disabled)) {
          return disabledColor;
        }
        if (states.contains(MaterialState.selected)) {
          return selectedColor;
        }
        return backgroundColor;
      });
      
      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,
              // chipTheme: ChipThemeData(color: color),
            ),
            home: const Example(),
          );
        }
      }
      
      class Example extends StatefulWidget {
        const Example({super.key});
      
        @override
        State<Example> createState() => _ExampleState();
      }
      
      class _ExampleState extends State<Example> {
        bool enabled = false;
        bool selected = true;
      
        @override
        Widget build(BuildContext context) {
          const Widget verticalSpace = SizedBox(height: 20);
      
          return Scaffold(
            body: Center(
              child: Column(
                children: <Widget>[
                  const SizedBox(height: 25),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                    children: <Widget>[
                      const Card(
                        elevation: 0.0,
                        color: disabledColor,
                        child: Padding(
                          padding: EdgeInsets.all(8.0),
                          child: Text('disabledColor'),
                        ),
                      ),
                      const Card(
                        elevation: 0.0,
                        color: backgroundColor,
                        child: Padding(
                          padding: EdgeInsets.all(8.0),
                          child: Text('backgroundColor'),
                        ),
                      ),
                      Card(
                        elevation: 0.0,
                        color: disabledSelectedColor,
                        child: const Padding(
                          padding: EdgeInsets.all(8.0),
                          child: Text('disabledSelectedColor'),
                        ),
                      ),
                      const Card(
                        elevation: 0.0,
                        color: selectedColor,
                        child: Padding(
                          padding: EdgeInsets.all(8.0),
                          child: Text('selectedColor'),
                        ),
                      ),
                    ],
                  ),
                  const Spacer(),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                    children: <Widget>[
                      Column(
                        mainAxisSize: MainAxisSize.min,
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: <Widget>[
                          RawChip(
                            selected: selected,
                            selectedColor: selectedColor,
                            color: color,
                            label: const Text('RawChip'),
                            isEnabled: enabled,
                            onSelected: enabled ? (bool value) {} : null,
                          ),
                          verticalSpace,
                          InputChip(
                            isEnabled: enabled,
                            selected: selected,
                            selectedColor: selectedColor,
                            color: color,
                            label: const Text('InputChip'),
                            onSelected: enabled ? (bool value) {} : null,
                          ),
                        ],
                      ),
                      Column(
                        mainAxisSize: MainAxisSize.min,
                        children: <Widget>[
                          FilterChip(
                            selected: selected,
                            selectedColor: selectedColor,
                            color: color,
                            label: const Text('FilterChip'),
                            onSelected: enabled ? (bool value) {} : null,
                          ),
                          verticalSpace,
                          FilterChip.elevated(
                            selected: selected,
                            selectedColor: selectedColor,
                            color: color,
                            label: const Text('FilterChip.elevated'),
                            onSelected: enabled ? (bool value) {} : null,
                          ),
                        ],
                      ),
                      Column(
                        mainAxisSize: MainAxisSize.min,
                        children: <Widget>[
                          ChoiceChip(
                            selected: selected,
                            selectedColor: selectedColor,
                            color: color,
                            label: const Text('ChoiceChip'),
                            onSelected: enabled ? (bool value) {} : null,
                          ),
                          verticalSpace,
                          ChoiceChip.elevated(
                            selected: selected,
                            selectedColor: selectedColor,
                            color: color,
                            label: const Text('ChoiceChip.elevated'),
                            onSelected: enabled ? (bool value) {} : null,
                          ),
                        ],
                      ),
                    ],
                  ),
                  const Spacer(),
                  Row(
                    children: <Widget>[
                      Flexible(
                        child: SwitchListTile(
                          title: const Text('Enabled'),
                          value: enabled,
                          onChanged: (bool value) {
                            setState(() => enabled = value);
                          },
                        ),
                      ),
                      Flexible(
                        child: SwitchListTile(
                          title: const Text('Selected'),
                          value: selected,
                          onChanged: (bool value) {
                            setState(() => selected = value);
                          },
                        ),
                      ),
                    ],
                  )
                ],
              ),
            ),
          );
        }
      }
      
      ``` 
      	
      </details>
      
      ### Before (not possible to customize disabled and selected chips)
      
      ![Screenshot 2023-06-13 at 16 27 13](https://github.com/flutter/flutter/assets/48603081/633f09f7-16a1-469e-b326-b9cc0ed59242)
      
      ### After (using disabled and selected chips using the new  MaterialState `color` property)
      
      ![Screenshot 2023-06-13 at 16 26 53](https://github.com/flutter/flutter/assets/48603081/7f5dffb7-4074-4268-87c0-c059c2da67a8)
      467c970b
  30. 13 Jun, 2023 1 commit
    • Qun Cheng's avatar
      Update unit tests in material library for Material 3 (#128725) · a5f8b64e
      Qun Cheng authored
      Updates most of the unit tests in the packages/flutter/test/material folder so that they'll pass if ThemeData.useMaterial3 defaults to true.
      
      All of the tests have wired useMaterial3 to false and will need to be updated with a M3 version.
      
      related to #127064
      a5f8b64e
  31. 17 Apr, 2023 1 commit
  32. 24 Mar, 2023 1 commit
  33. 09 Mar, 2023 1 commit
  34. 06 Mar, 2023 2 commits
  35. 02 Feb, 2023 2 commits
  36. 01 Feb, 2023 2 commits
  37. 20 Jan, 2023 1 commit