1. 15 Dec, 2023 1 commit
  2. 20 Nov, 2023 1 commit
  3. 17 Nov, 2023 1 commit
    • auto-submit[bot]'s avatar
      Reverts "Introduce `AnimationStyle`" (#138628) · 0135a331
      auto-submit[bot] authored
      Reverts flutter/flutter#137945
      Initiated by: HansMuller
      This change reverts the following previous change:
      Original Description:
      This PR introduces `AnimationStyle`, it is used to override default animation curves and durations in several widgets.
      
      fixes  [Add the ability to customize MaterialApp theme animation duration](https://github.com/flutter/flutter/issues/78372)
      fixes [Allow customization of showMenu transition animation curves and duration](https://github.com/flutter/flutter/issues/135638)
      
      Here is an example where popup menu curve and transition duration is overriden:
      
      ```dart
                popUpAnimationStyle: AnimationStyle(
                  curve: Easing.emphasizedAccelerate,
                  duration: Durations.medium4,
                ),
      ```
      
      Set `AnimationStyle.noAnimation` to disable animation.
      ```dart
          return MaterialApp(
            themeAnimationStyle: AnimationStyle.noAnimation,
      ```
      0135a331
  4. 16 Nov, 2023 1 commit
    • Taha Tesser's avatar
      Introduce `AnimationStyle` (#137945) · 19e284f8
      Taha Tesser authored
      This PR introduces `AnimationStyle`, it is used to override default animation curves and durations in several widgets.
      
      fixes  [Add the ability to customize MaterialApp theme animation duration](https://github.com/flutter/flutter/issues/78372)
      fixes [Allow customization of showMenu transition animation curves and duration](https://github.com/flutter/flutter/issues/135638)
      
      Here is an example where popup menu curve and transition duration is overriden:
      
      ```dart
                popUpAnimationStyle: AnimationStyle(
                  curve: Easing.emphasizedAccelerate,
                  duration: Durations.medium4,
                ),
      ```
      
      Set `AnimationStyle.noAnimation` to disable animation.
      ```dart
          return MaterialApp(
            themeAnimationStyle: AnimationStyle.noAnimation,
      ```
      19e284f8
  5. 10 Nov, 2023 1 commit
  6. 20 Sep, 2023 1 commit
  7. 11 Sep, 2023 1 commit
  8. 06 Sep, 2023 1 commit
  9. 05 Sep, 2023 1 commit
  10. 25 Aug, 2023 1 commit
    • Taha Tesser's avatar
      Fix `PopupMenuItem` with a `ListTile` doesn't use the correct style. (#133141) · ea005219
      Taha Tesser authored
      fixes [`PopupMenuItem` with a `ListTile`  doesn't use the correct text style.](https://github.com/flutter/flutter/issues/133138)
      
      ### Description
      
      This fixes an issue text style issue for `PopupMenuItem` with a `ListTile` (for an elaborate popup menu) 
      
      https://api.flutter.dev/flutter/material/PopupMenuItem-class.html
      
      <details> 
      <summary>expand to view the code sample</summary> 
      
      ```dart
      import 'package:flutter/material.dart';
      
      /// Flutter code sample for [PopupMenuButton].
      
      // This is the type used by the popup menu below.
      enum SampleItem { itemOne, itemTwo, itemThree }
      
      void main() => runApp(const PopupMenuApp());
      
      class PopupMenuApp extends StatelessWidget {
        const PopupMenuApp({super.key});
      
        @override
        Widget build(BuildContext context) {
          return MaterialApp(
            theme: ThemeData(
              useMaterial3: true,
              textTheme: const TextTheme(
                labelLarge: TextStyle(
                  fontStyle: FontStyle.italic,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
            home: const PopupMenuExample(),
          );
        }
      }
      
      class PopupMenuExample extends StatefulWidget {
        const PopupMenuExample({super.key});
      
        @override
        State<PopupMenuExample> createState() => _PopupMenuExampleState();
      }
      
      class _PopupMenuExampleState extends State<PopupMenuExample> {
        SampleItem? selectedMenu;
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            body: Center(
              child: SizedBox(
                width: 300,
                height: 130,
                child: Align(
                  alignment: Alignment.topLeft,
                  child: PopupMenuButton<SampleItem>(
                    initialValue: selectedMenu,
                    // Callback that sets the selected popup menu item.
                    onSelected: (SampleItem item) {
                      setState(() {
                        selectedMenu = item;
                      });
                    },
                    itemBuilder: (BuildContext context) =>
                        <PopupMenuEntry<SampleItem>>[
                      const PopupMenuItem<SampleItem>(
                        value: SampleItem.itemOne,
                        child: Text('PopupMenuItem'),
                      ),
                      const CheckedPopupMenuItem<SampleItem>(
                        checked: true,
                        value: SampleItem.itemTwo,
                        child: Text('CheckedPopupMenuItem'),
                      ),
                      const PopupMenuItem<SampleItem>(
                        value: SampleItem.itemOne,
                        child: ListTile(
                          leading: Icon(Icons.cloud),
                          title: Text('ListTile'),
                          contentPadding: EdgeInsets.zero,
                          trailing: Icon(Icons.arrow_right_rounded),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          );
        }
      }
      ``` 
      
      </details>
      
      ### Before
      
      ![Screenshot 2023-08-23 at 14 08 48](https://github.com/flutter/flutter/assets/48603081/434ac95e-2981-4ab5-9843-939b39d771a2)
      
      ### After
      
      ![Screenshot 2023-08-23 at 14 08 32](https://github.com/flutter/flutter/assets/48603081/f6aba7e0-3d03-454f-8e0b-c031492f3f2d)
      ea005219
  11. 16 Aug, 2023 1 commit
  12. 13 Aug, 2023 1 commit
  13. 10 Aug, 2023 1 commit
    • Taha Tesser's avatar
      Fix `PopupMenuItem` & `CheckedPopupMenuItem` has redundant `ListTile` padding... · 96e02c61
      Taha Tesser authored
      Fix `PopupMenuItem` & `CheckedPopupMenuItem` has redundant `ListTile` padding and update default horizontal padding for Material 3 (#131609)
      
      fixes [`PopupMenuItem` adds redundant padding when using `ListItem`](https://github.com/flutter/flutter/issues/128553)
      
      ### Description
      
      - Fixed redundant `ListTile` padding when using `CheckedPopupMenuItem` or  `PopupMenuItem`  with the `ListTile` child for complex popup menu items as suggested in the docs.
      - Updated default horizontal padding for popup menu items.
      
      ### Code sample
      
      <details> 
      <summary>expand to view the code sample</summary> 
      
      ```dart
      import 'package:flutter/material.dart';
      
      /// Flutter code sample for [PopupMenuButton].
      
      // This is the type used by the popup menu below.
      enum SampleItem { itemOne, itemTwo, itemThree }
      
      void main() => runApp(const PopupMenuApp());
      
      class PopupMenuApp extends StatelessWidget {
        const PopupMenuApp({super.key});
      
        @override
        Widget build(BuildContext context) {
          return MaterialApp(
            theme: ThemeData(useMaterial3: true),
            home: const PopupMenuExample(),
          );
        }
      }
      
      class PopupMenuExample extends StatefulWidget {
        const PopupMenuExample({super.key});
      
        @override
        State<PopupMenuExample> createState() => _PopupMenuExampleState();
      }
      
      class _PopupMenuExampleState extends State<PopupMenuExample> {
        SampleItem? selectedMenu;
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            appBar: AppBar(title: const Text('PopupMenuButton')),
            body: Center(
              child: SizedBox(
                width: 150,
                height: 100,
                child: Align(
                  alignment: Alignment.topLeft,
                  child: PopupMenuButton<SampleItem>(
                    initialValue: selectedMenu,
                    // Callback that sets the selected popup menu item.
                    onSelected: (SampleItem item) {
                      setState(() {
                        selectedMenu = item;
                      });
                    },
                    itemBuilder: (BuildContext context) =>
                        <PopupMenuEntry<SampleItem>>[
                      const PopupMenuItem<SampleItem>(
                        value: SampleItem.itemOne,
                        child: Text('PopupMenuItem'),
                      ),
                      const CheckedPopupMenuItem<SampleItem>(
                        checked: true,
                        value: SampleItem.itemTwo,
                        child: Text('CheckedPopupMenuItem'),
                      ),
                      const PopupMenuItem<SampleItem>(
                        value: SampleItem.itemOne,
                        child: ListTile(
                          leading: Icon(Icons.cloud),
                          title: Text('ListTile'),
                          contentPadding: EdgeInsets.zero,
                          trailing: Icon(Icons.arrow_right_rounded),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          );
        }
      }
      ``` 
      	
      </details>
      
      ### Before
      
      ![image](https://github.com/flutter/flutter/assets/48603081/aad15ffb-ca11-4997-81d1-b46288161a4e)
      
      - Default horizontal padding is the same as M2 (16.0), while the specs use a smaller value (12.0)
      - `ListTile` nested by default in `CheckedPopupMenuItem` has redundant padding
      - `PopupMenuItem` using `ListTile` as a child for complex menu items contains redundant padding.
      
      ![Screenshot 2023-07-31 at 17 17 08](https://github.com/flutter/flutter/assets/48603081/75ad1fe5-e051-42ba-badf-e20c799dee96)
      
      ### After 
      
      - Default horizontal padding is updated for Material 3.
      - `PopupMenuItem` & `CheckedPopupMenuItem` override `ListTile` padding (similar to how `ExpansionTile` overrides `ListTile` text and icon color.
      
      ![Screenshot 2023-07-31 at 17 17 25](https://github.com/flutter/flutter/assets/48603081/288cf892-5b51-4365-9855-5ef0ed2928e9)
      96e02c61
  14. 08 Aug, 2023 1 commit
    • Taha Tesser's avatar
      Add `PopupMenuButton.iconColor`, `PopupMenuTheme.iconSize` and fix button icon... · b77b149d
      Taha Tesser authored
      Add `PopupMenuButton.iconColor`, `PopupMenuTheme.iconSize` and fix button icon using unexpected color propert (#132054)
      
      fixes [PopupMenuButton uses color property for icon color](https://github.com/flutter/flutter/issues/127802) 
      fixes [`popup_menu_test.dart` lacks default icon color tests.](https://github.com/flutter/flutter/issues/132050) 
      
      ### Description
      - Add  `PopupMenuButton..iconColor` and fix the PopupMenu button icon using an unexpected color property.
      - Add the missing `PopupMenuTheme.iconSize`.
      - Clean up some tests and minor improvements.
      
      ### Code sample
      
      <details> 
      <summary>expand to view the code sample</summary> 
      
      ```dart
      import 'package:flutter/material.dart';
      
      /// Flutter code sample for [PopupMenuButton].
      
      // This is the type used by the popup menu below.
      enum SampleItem { itemOne, itemTwo, itemThree }
      
      void main() => runApp(const PopupMenuApp());
      
      class PopupMenuApp extends StatelessWidget {
        const PopupMenuApp({super.key});
      
        @override
        Widget build(BuildContext context) {
          return MaterialApp(
            theme: ThemeData(
              popupMenuTheme: PopupMenuThemeData(
                // iconSize: 75,
                // iconColor: Colors.amber,
                color: Colors.deepPurple[100],
              ),
            ),
            home: const PopupMenuExample(),
          );
        }
      }
      
      class PopupMenuExample extends StatefulWidget {
        const PopupMenuExample({super.key});
      
        @override
        State<PopupMenuExample> createState() => _PopupMenuExampleState();
      }
      
      class _PopupMenuExampleState extends State<PopupMenuExample> {
        SampleItem? selectedMenu;
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            appBar: AppBar(title: const Text('PopupMenuButton')),
            body: Center(
              child: PopupMenuButton<SampleItem>(
                iconSize: 75,
                // iconColor: Colors.amber,
                color: Colors.deepPurple[100],
                initialValue: selectedMenu,
                // Callback that sets the selected popup menu item.
                onSelected: (SampleItem item) {
                  setState(() {
                    selectedMenu = item;
                  });
                },
                itemBuilder: (BuildContext context) => <PopupMenuEntry<SampleItem>>[
                  const PopupMenuItem<SampleItem>(
                    value: SampleItem.itemOne,
                    child: Text('Item 1'),
                  ),
                  const PopupMenuItem<SampleItem>(
                    value: SampleItem.itemTwo,
                    child: Text('Item 2'),
                  ),
                  const PopupMenuDivider(),
                  const CheckedPopupMenuItem<SampleItem>(
                    value: SampleItem.itemThree,
                    checked: true,
                    child: Text('Item 3'),
                  ),
                ],
              ),
            ),
          );
        }
      }
      
      ``` 
      	
      </details>
      
      ![Group 2](https://github.com/flutter/flutter/assets/48603081/eb5404ae-2a07-4374-9821-66a0bbea041e)
      
      ![Group 1](https://github.com/flutter/flutter/assets/48603081/464e3957-1afb-4118-abcc-aad12591dc51)
      b77b149d
  15. 07 Aug, 2023 1 commit
  16. 28 Jul, 2023 1 commit
    • Taha Tesser's avatar
      Add `CheckedPopupMenuItem‎.labelTextStyle` and update default text style for Material 3 (#131060) · 038ec62b
      Taha Tesser authored
      fixes [Update `CheckedPopupMenuItem‎` for Material 3](https://github.com/flutter/flutter/issues/128576)
      
      ### Description
      
      - This adds the missing ``CheckedPopupMenuItem‎.labelTextStyle` parameter
      - Fixes default text style for `CheckedPopupMenuItem‎`. 
      It used `ListTile`'s  `bodyLarge` instead of `LabelLarge` similar to `PopupMenuItem`.
      
      ### 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,
              textTheme: const TextTheme(
                labelLarge: TextStyle(
                  fontWeight: FontWeight.bold,
                  fontStyle: FontStyle.italic,
                  letterSpacing: 5.0,
                ),
              ),
            ),
            home: const Example(),
          );
        }
      }
      
      class Example extends StatelessWidget {
        const Example({super.key});
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            appBar: AppBar(
              title: const Text('Sample'),
              actions: <Widget>[
                PopupMenuButton<String>(
                  icon: const Icon(Icons.more_vert),
                  itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
                    const CheckedPopupMenuItem<String>(
                      // labelTextStyle: MaterialStateProperty.resolveWith(
                      //     (Set<MaterialState> states) {
                      //   if (states.contains(MaterialState.selected)) {
                      //     return const TextStyle(
                      //       color: Colors.red,
                      //       fontStyle: FontStyle.italic,
                      //       fontWeight: FontWeight.bold,
                      //     );
                      //   }
      
                      //   return const TextStyle(
                      //     color: Colors.amber,
                      //     fontStyle: FontStyle.italic,
                      //     fontWeight: FontWeight.bold,
                      //   );
                      // }),
                      child: Text('Mild'),
                    ),
                    const CheckedPopupMenuItem<String>(
                      checked: true,
                      // labelTextStyle: MaterialStateProperty.resolveWith(
                      //     (Set<MaterialState> states) {
                      //   if (states.contains(MaterialState.selected)) {
                      //     return const TextStyle(
                      //       color: Colors.red,
                      //       fontStyle: FontStyle.italic,
                      //       fontWeight: FontWeight.bold,
                      //     );
                      //   }
      
                      //   return const TextStyle(
                      //     color: Colors.amber,
                      //     fontStyle: FontStyle.italic,
                      //     fontWeight: FontWeight.bold,
                      //   );
                      // }),
                      child: Text('Spicy'),
                    ),
                    const PopupMenuDivider(),
                    const PopupMenuItem<String>(
                      value: 'Close',
                      child: Text('Close'),
                    ),
                  ],
                )
              ],
            ),
          );
        }
      }
      
      ``` 
      	
      </details>
      
      ### Customized `textTheme.labelLarge` text theme.
      | Before | After |
      | --------------- | --------------- |
      | <img src="https://github.com/flutter/flutter/assets/48603081/2672438d-b2da-479b-a5d3-d239ef646365" /> | <img src="https://github.com/flutter/flutter/assets/48603081/b9f83719-dede-4c2f-8247-18f74e63eb29"  /> |
      
      ### New `CheckedPopupMenuItem‎.labelTextStyle` parameter with material states support
      <img src="https://github.com/flutter/flutter/assets/48603081/ef0a88aa-9811-42b1-a3aa-53b90c8d43fb" height="450" />
      038ec62b
  17. 19 Jul, 2023 1 commit
  18. 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
  19. 08 Jun, 2023 1 commit
    • Mahdi Bagheri's avatar
      Navigator.pop before PopupMenuItem onTap call (#127446) · 4e9869b9
      Mahdi Bagheri authored
      *The order of calling Navigator.pop and PopupMenuItem.onTap has been changed so before calling PopupMenuItem onTap method, PopupMenuBotton onSelect method is going to be called.*
      
      *Solves #127443*
      
      *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
      4e9869b9
  20. 02 May, 2023 1 commit
  21. 28 Apr, 2023 1 commit
    • fzyzcjy's avatar
      Allow users to provide route settings to `showMenu` (#124935) · 00bbf543
      fzyzcjy authored
      Background: I am adding logging to things like dialogs, bottom sheets and menus. Then I realized that, showMenu does not allow users to provide RouteSettings, while showDialog and showModalBottomSheet both allow. Therefore, IMHO a consistent API design may need to add this to showMenu.
      
      I will add tests if this proposal looks OK :)
      00bbf543
  22. 22 Mar, 2023 1 commit
  23. 17 Feb, 2023 1 commit
  24. 01 Feb, 2023 1 commit
  25. 10 Jan, 2023 1 commit
    • Yegor's avatar
      add closed/open focus traversal; use open on web (#115961) · 42053575
      Yegor authored
      * allow focus to leave FlutterView
      
      * fix tests and docs
      
      * small doc update
      
      * fix analysis lint
      
      * use closed loop for dialogs
      
      * add tests for new API
      
      * address comments
      
      * test FocusScopeNode.traversalEdgeBehavior setter; reverse wrap-around
      
      * rename actionResult to invokeResult
      
      * address comments
      42053575
  26. 20 Dec, 2022 1 commit
    • harperl-lgtm's avatar
      Implemented Scrim Focus for BottomSheet (#116743) · 7f7a8778
      harperl-lgtm authored
      * Implemented Scrim Focus for BottomSheet so that assistive technology users can focus and tap on the scrim to close the BottomSheet, which they could not do before the change . The Scrim Focus's size changes to avoid overlapping the BottomSheet.
      7f7a8778
  27. 09 Dec, 2022 1 commit
  28. 28 Sep, 2022 1 commit
  29. 22 Aug, 2022 1 commit
  30. 14 Aug, 2022 1 commit
  31. 11 Aug, 2022 2 commits
  32. 03 Aug, 2022 1 commit
  33. 18 Jul, 2022 1 commit
  34. 12 Jul, 2022 1 commit
  35. 03 Jun, 2022 1 commit
  36. 20 May, 2022 1 commit
  37. 27 Apr, 2022 2 commits
  38. 14 Apr, 2022 1 commit