- 31 Jan, 2024 2 commits
-
-
Polina Cherkasova authored
-
Jude Selase Kwashie authored
This PR fixes null operator error when you change focus node of a 'MenuItemButton' to null. fixes: [issue142095](https://github.com/flutter/flutter/issues/142095)
-
- 30 Jan, 2024 1 commit
-
-
Ian Hickson authored
Children should be omitted from debugFillProperties (if they really need to be included they should be in debugDescribeChildren, but in general for widgets we don't bother including them since they are eventually included anyway). toStrings should not contain newlines (or, ideally, should use Diagnosticable). Also some minor tweaks to match grammar and style guide conventions.
-
- 24 Jan, 2024 1 commit
-
-
Jesús S Guerrero authored
Revert "[web] - Fix broken `TextField` in semantics mode when it's a sibling of `Navigator`" (#142129) Reverts flutter/flutter#138446 b/322136071
-
- 22 Jan, 2024 1 commit
-
-
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
-
- 10 Jan, 2024 1 commit
-
-
Polina Cherkasova authored
Contributes to https://github.com/flutter/devtools/issues/6909.
-
- 04 Jan, 2024 1 commit
-
-
Qun Cheng authored
Fixes #140162 This PR is to add a scrollbar for MenuAnchor and DropdownMenu for all platforms when height is limited. Previously, a scrollbar only shows on desktop platforms. This PR also disabled scrollbar's overscroll for MenuAnchor and DropdownMenu. <img src="https://github.com/flutter/flutter/assets/36861262/9ca3d4d0-415f-43bf-9d2b-df96a42db620" width="250"/><img src="https://github.com/flutter/flutter/assets/36861262/18da8d02-586b-4aa4-b647-927691542429" width="350"/>
-
- 15 Dec, 2023 1 commit
-
-
Polina Cherkasova authored
-
- 07 Dec, 2023 1 commit
-
-
Qun Cheng authored
Fixes #139409 `SubmenuButton.onFocusChange` is not implemented. This PR is just add one line fix to assign this property to `TextButton.onFocusChange` which is used in `SubmenuButton`:)
-
- 23 Oct, 2023 1 commit
-
-
LongCatIsLooong authored
`OverlayPortal.overlayChild` contributes semantics to `OverlayPortal` instead of `Overlay` (#134921) Fixes https://github.com/flutter/flutter/issues/134456
-
- 18 Oct, 2023 1 commit
-
-
Greg Spencer authored
## 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)
-
- 12 Oct, 2023 1 commit
-
-
Greg Spencer authored
## 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.
-
- 05 Sep, 2023 1 commit
-
-
Polina Cherkasova authored
-
- 22 Aug, 2023 1 commit
-
-
Taha Tesser authored
Related https://github.com/flutter/flutter/issues/131676 ## Description #### Fix default input text style for `DropdownMenu` ![dropdown_input](https://github.com/flutter/flutter/assets/48603081/301f8243-155a-4b8f-84a8-5e6b7bebb3bc) ### Fix default text style for `MenuAnchor`'s menu items (which `DropdownMenu` uses for menu items) ![dropdown_item](https://github.com/flutter/flutter/assets/48603081/6b5be81a-72fc-4705-a577-074c7a4cad8f) ### Default `DropdownMenu` Input text style ![Screenshot 2023-08-04 at 16 48 28](https://github.com/flutter/flutter/assets/48603081/bcd9da98-e74d-491e-ae64-6268ae0b3893) ### Default `DropdownMenu` menu item text style ![Screenshot 2023-08-04 at 16 50 19](https://github.com/flutter/flutter/assets/48603081/9592ca43-2854-45b5-8648-203ab65d9745) ### Default `MenuAnchor` menu item text style ![Screenshot 2023-08-04 at 14 34 28](https://github.com/flutter/flutter/assets/48603081/e87e1073-05f8-4dc7-a435-d864e9cce6ab) ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; /// Flutter code sample for [DropdownMenu]s. The first dropdown menu has an outlined border. void main() => runApp(const DropdownMenuExample()); class DropdownMenuExample extends StatefulWidget { const DropdownMenuExample({super.key}); @override State<DropdownMenuExample> createState() => _DropdownMenuExampleState(); } class _DropdownMenuExampleState extends State<DropdownMenuExample> { final TextEditingController colorController = TextEditingController(); final TextEditingController iconController = TextEditingController(); ColorLabel? selectedColor; IconLabel? selectedIcon; @override Widget build(BuildContext context) { final List<DropdownMenuEntry<ColorLabel>> colorEntries = <DropdownMenuEntry<ColorLabel>>[]; for (final ColorLabel color in ColorLabel.values) { colorEntries.add( DropdownMenuEntry<ColorLabel>( value: color, label: color.label, enabled: color.label != 'Grey'), ); } final List<DropdownMenuEntry<IconLabel>> iconEntries = <DropdownMenuEntry<IconLabel>>[]; for (final IconLabel icon in IconLabel.values) { iconEntries .add(DropdownMenuEntry<IconLabel>(value: icon, label: icon.label)); } return MaterialApp( theme: ThemeData( useMaterial3: true, colorSchemeSeed: Colors.green, // textTheme: const TextTheme( // bodyLarge: TextStyle( // fontWeight: FontWeight.bold, // fontStyle: FontStyle.italic, // decoration: TextDecoration.underline, // ), // ), ), home: Scaffold( body: SafeArea( child: Column( children: <Widget>[ const Text('DropdownMenus'), Padding( padding: const EdgeInsets.symmetric(vertical: 20), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ DropdownMenu<ColorLabel>( controller: colorController, label: const Text('Color'), dropdownMenuEntries: colorEntries, onSelected: (ColorLabel? color) { setState(() { selectedColor = color; }); }, ), const SizedBox(width: 20), DropdownMenu<IconLabel>( controller: iconController, enableFilter: true, leadingIcon: const Icon(Icons.search), label: const Text('Icon'), dropdownMenuEntries: iconEntries, inputDecorationTheme: const InputDecorationTheme( filled: true, contentPadding: EdgeInsets.symmetric(vertical: 5.0), ), onSelected: (IconLabel? icon) { setState(() { selectedIcon = icon; }); }, ), ], ), ), const Text('Plain TextFields'), Padding( padding: const EdgeInsets.symmetric(vertical: 20), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ SizedBox( width: 150, child: TextField( controller: TextEditingController(text: 'Blue'), decoration: const InputDecoration( suffixIcon: Icon(Icons.arrow_drop_down), labelText: 'Color', border: OutlineInputBorder(), )), ), const SizedBox(width: 20), SizedBox( width: 150, child: TextField( controller: TextEditingController(text: 'Smile'), decoration: const InputDecoration( prefixIcon: Icon(Icons.search), suffixIcon: Icon(Icons.arrow_drop_down), filled: true, labelText: 'Icon', )), ), ], ), ), if (selectedColor != null && selectedIcon != null) Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( 'You selected a ${selectedColor?.label} ${selectedIcon?.label}'), Padding( padding: const EdgeInsets.symmetric(horizontal: 5), child: Icon( selectedIcon?.icon, color: selectedColor?.color, ), ) ], ) else const Text('Please select a color and an icon.') ], ), ), ), ); } } enum ColorLabel { blue('Blue', Colors.blue), pink('Pink', Colors.pink), green('Green', Colors.green), yellow('Yellow', Colors.yellow), grey('Grey', Colors.grey); const ColorLabel(this.label, this.color); final String label; final Color color; } enum IconLabel { smile('Smile', Icons.sentiment_satisfied_outlined), cloud( 'Cloud', Icons.cloud_outlined, ), brush('Brush', Icons.brush_outlined), heart('Heart', Icons.favorite); const IconLabel(this.label, this.icon); final String label; final IconData icon; } ``` </details>
-
- 07 Aug, 2023 1 commit
-
-
Kate Lovett authored
Fixes https://github.com/flutter/flutter/issues/59413 This relocates `mock_canvas.dart` and `recording_canvas.dart` from `flutter/test/rendering` to `flutter_test`. The testing functionality afforded by mock_canvas should be available to everyone, not just the framework. :) mock_canvas.dart needed a bit of cleanup - things like formatting and super parameters.
-
- 31 Jul, 2023 1 commit
-
-
Qun Cheng authored
-
- 26 Jul, 2023 1 commit
-
-
Caffeinix authored
The Apple Human Interface Guidelines give a specific ordering of the symbols used as modifier keys in menu shortcuts. These guidelines are encoded into the native Cocoa or UIKit menu classes, and are intended to ensure that symbols are always aligned into columns of like symbols and do not move around in the case of dynamic menu items (for example, holding Option will transform certain menu items into different versions that take the Option key, so the Option key symbol appears to the left of most other symbols to avoid reordering). The Material spec says to use symbols for modifier keys on Mac and iOS, as this is what users there are familiar with. It stands to reason that we should follow the platform guidelines fully, so this changes the MenuItemButton class to honor the HIG-compliant symbol ordering on Mac and iOS. Fixed: #129308
-
- 20 Jul, 2023 1 commit
-
-
Greg Spencer authored
## Description This modifies the `MenuAnchor` `onPressed` activation to delay until after the current frame is built, and resolve any focus changes before it invokes the `onPressed`, so that actions that operate on the `primaryFocus` can have a chance of working on the focused item they were meant to work on. ## Related Issues - Fixes https://github.com/flutter/flutter/issues/118731 ## Tests - No tests yet (hence draft still)
-
- 06 Jul, 2023 1 commit
-
-
Michael Goderbauer authored
PLUS: clean-up of all the unreachable stuff.
-
- 13 Jun, 2023 1 commit
-
-
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
-
- 26 May, 2023 1 commit
-
-
Qun Cheng authored
-
- 18 Apr, 2023 1 commit
-
-
Greg Spencer authored
## Description This adds an optional argument to the `SubmenuButton` that allows the creator to supply a `MenuController` for controlling the menu. ## Related Issues - Fixes https://github.com/flutter/flutter/issues/124988 ## Tests - Added tests for new argument.
-
- 06 Apr, 2023 1 commit
-
-
Henry Riehl authored
Positioning of cascading menus.
-
- 31 Mar, 2023 1 commit
-
-
Henry Riehl authored
Add option to keep ```MenuAnchor``` open after ```MenuItem``` tap
-
- 30 Mar, 2023 1 commit
-
-
Henry Riehl authored
Wire up MenuAnchor clipBehaviour property
-
- 28 Mar, 2023 1 commit
-
-
Henry Riehl authored
Add alignmentOffset when menu is positioned on the opposite side
-
- 22 Mar, 2023 1 commit
-
-
Michael Goderbauer authored
Remove 1745 decorative breaks
-
- 15 Mar, 2023 2 commits
-
-
Bruno Leroux authored
Fix MenuAnchor closes on internal scroll
-
Michael Goderbauer authored
Remove last few references to window singleton
-
- 04 Mar, 2023 1 commit
-
-
Qun Cheng authored
-
- 02 Mar, 2023 1 commit
-
- 01 Mar, 2023 1 commit
-
-
Qun Cheng authored
Add visual density for menu default style
-
- 17 Feb, 2023 1 commit
-
-
Taha Tesser authored
-
- 01 Feb, 2023 1 commit
-
-
Michael Goderbauer authored
* Deprecate MediaQuery[Data].fromWindow * ++ * dart fix
-
- 16 Dec, 2022 1 commit
-
-
Greg Spencer authored
* Fix Menu shortcut labels * Remove invalid localizations * Add more localization for Shift * Add generated localizations * Fix Test
-
- 06 Dec, 2022 1 commit
-
-
Greg Spencer authored
* Fix MenuAnchor padding * Add tests
-
- 29 Nov, 2022 1 commit
-
-
Greg Spencer authored
* Add MenuMenuAcceleratorLabel to support accelerators. * Review Changes * Review Changed * Fix default label builder to use characters * Remove golden test that shouldn't have been there.
-
- 25 Oct, 2022 1 commit
-
-
Qun Cheng authored
-
- 07 Oct, 2022 1 commit
-
-
Greg Spencer authored
-
- 30 Sep, 2022 1 commit
-
-
Greg Spencer authored
Merging on red to green the build.
-