1. 15 Dec, 2023 1 commit
  2. 14 Aug, 2023 1 commit
  3. 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
  4. 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
  5. 22 Jul, 2023 1 commit
  6. 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
  7. 30 May, 2023 1 commit
  8. 16 Feb, 2023 1 commit
  9. 28 Oct, 2022 1 commit
  10. 24 Oct, 2022 1 commit
  11. 09 Sep, 2022 1 commit
  12. 06 Sep, 2022 1 commit
  13. 25 Aug, 2022 1 commit
  14. 21 Aug, 2022 1 commit
  15. 19 Aug, 2022 1 commit
  16. 16 Aug, 2022 1 commit
  17. 15 Aug, 2022 1 commit
  18. 20 May, 2022 1 commit
  19. 03 Feb, 2022 1 commit
  20. 18 Jan, 2022 1 commit
  21. 14 Jan, 2022 2 commits
  22. 07 Oct, 2021 1 commit
  23. 07 Oct, 2020 1 commit
  24. 11 Jun, 2020 1 commit
  25. 27 Nov, 2019 1 commit
    • Ian Hickson's avatar
      License update (#45373) · 449f4a66
      Ian Hickson authored
      * Update project.pbxproj files to say Flutter rather than Chromium
      
      Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.
      
      * Update the copyright notice checker to require a standard notice on all files
      
      * Update copyrights on Dart files. (This was a mechanical commit.)
      
      * Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.
      
      Some were already marked "The Flutter Authors", not clear why. Their
      dates have been normalized. Some were missing the blank line after the
      license. Some were randomly different in trivial ways for no apparent
      reason (e.g. missing the trailing period).
      
      * Clean up the copyrights in non-Dart files. (Manual edits.)
      
      Also, make sure templates don't have copyrights.
      
      * Fix some more ORGANIZATIONNAMEs
      449f4a66
  26. 24 Sep, 2019 2 commits
  27. 02 Aug, 2019 1 commit
  28. 26 Jul, 2019 1 commit
    • lisa-liao's avatar
      Add PopupMenuTheme to enable theming color, shape, elevation, text style of Menu (#36088) · 63992e4f
      lisa-liao authored
      * [Menu] Create Menu theme
      
      * [Menu] Create Menu theme
      
      * [Menu] Formatting changes for Menu theme
      
      * [Menu] Fix spacing difference in theme_data.dart.
      
      * [Menu] Fix spacing difference in theme_data.dart.
      
      * Specifying types
      
      * Formatting changes
      
      * Address PR feedback
      
      * Formatting changes
      
      * Address PR feedback
      
      * Add inherited widget
      
      * Add inherited widget
      
      * Address PR feedback and add inherited widget.
      
      * Formatting changes.
      
      * Address PR feedback
      
      * Address PR feedback
      
      * Address PR feedback
      
      * Address PR feedback
      63992e4f