- 18 Sep, 2023 1 commit
-
-
huycozy authored
### Description This PR is to improve `DropdownMenu` sample code. By default, `requestFocusOnTap` is false on mobile platforms. When users run API sample code on mobile platforms, they can not edit the text field and think it is a bug. Although it is detailed at https://api.flutter.dev/flutter/material/DropdownMenu/requestFocusOnTap.html, users often do not pay attention to it. ### Related issue Fixes https://github.com/flutter/flutter/issues/127672
-
- 11 Sep, 2023 1 commit
-
-
Chinmay Kabi authored
-
- 08 Sep, 2023 1 commit
-
-
xubaolin authored
Fix a scrollbar example crash. https://api.flutter.dev/flutter/material/Scrollbar-class.html#material.Scrollbar.1
-
- 01 Sep, 2023 1 commit
-
-
Andrea Cioni authored
New example for `InputChip` that demonstrate how to create/delete them based on user text inputs. The sample application shows a custom text area where user can enter text. After the user has typed and hits _Enter_ the text will be replaced with an `InputChip` that contains that text. Is it possible to continue typing and add more chips in this way. All of them will be placed in a scrollable horizontal row. Also is it possible to have suggestion displayed below the text input field in case the typed text match some of the available suggestions. Issue I'm trying to solve: - https://github.com/flutter/flutter/issues/128247 **Code structure:** The example app is composed of 2 main components that find places inside `MainScreen`: - `ChipsInput` - `ListView` `ChipsInput` emulates a `TextField` where you can enter text. This text field accepts also a list of values of generic type T (`Topping` in my example), that gets rendered as `InputChip` inside the text field, before the text inserted by the user. This widgets is basically an `InputDecorator` widget that implements `TextInputClient` to get `TextEditingValue` events from the user keyboard. At the end of the input field there is another component, the `TextCursor`, that is displayed just when the user give the focus to the field and emulates the carrets that `TextField` has. There are also some available callbacks that the user can use to capture events in the `ChipsInput` field like: `onChanged`, `onChipTapped`, `onSubmitted` and `onTextChanged`. This last callback is used to build a list of suggestion that will be placed just below the `ChipsInput` field inside the `ListView`.
-
- 30 Aug, 2023 1 commit
-
-
Hans Muller authored
-
- 29 Aug, 2023 2 commits
-
-
Hans Muller authored
-
Taha Tesser authored
fixes [Additional color mappings for FAB in Material 3](https://github.com/flutter/flutter/issues/130702) ### Preview ![image](https://github.com/flutter/flutter/assets/48603081/a6f9aef6-af80-41ce-8e59-50f095db047d)
-
- 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>
-
- 21 Aug, 2023 1 commit
-
-
Taha Tesser authored
fixes [ExpansionPanelList can't expand/collapse on the latest stable/master ](https://github.com/flutter/flutter/issues/132759) https://github.com/flutter/flutter/pull/128082 updated the `expansionCallback` and also the `ExpansionPanel` sample in the Flutter gallery but not the API example. This PR fixes the API example and adds tests.
-
- 15 Aug, 2023 1 commit
-
-
Ian Hickson authored
- slightly improved assert message when row cell counts don't match column count. - more breadcrumbs in API documentation. more documentation in general. - added more documentation for the direction of the "ascending" arrow. - two samples for PaginatedDataTable. - make PaginatedDataTable support hot reloading across changes to the number of columns. - introduce matrix3MoreOrLessEquals. An earlier version of this PR used it in tests, but eventually it was not needed. The function seems useful to keep though.
-
- 14 Aug, 2023 1 commit
-
-
Taha Tesser authored
fixes [Some of the menu examples don't contain `SafeArea`](https://github.com/flutter/flutter/issues/132388) ### Description This fixes the menu examples for running on mobile with a safe area. ![Group 2](https://github.com/flutter/flutter/assets/48603081/0d460c00-60f5-45e0-87ee-c010ede9ee42)
-
- 10 Aug, 2023 1 commit
-
-
LongCatIsLooong authored
Migrate tests in flutter/flutter. Once the tests here and in `*_customer_testing` are migrated, the default value of the migration flag will be changed from false to true, making the rounding hack disabled by default.
-
- 20 Jul, 2023 2 commits
-
-
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)
-
Hans Muller authored
-
- 17 Jul, 2023 1 commit
-
-
Greg Spencer authored
## Description This adds some more missing example links. I also wrote another PR for adding a check to make sure that examples are all linked from a source file and have tests: https://github.com/flutter/flutter/pull/130523 ## Related Issues - https://github.com/flutter/flutter/issues/129956 ## Tests - Documentation and refactoring only.
-
- 11 Jul, 2023 1 commit
-
-
Taha Tesser authored
fixes [Showcase `Badge` widget in `NavigationBar` and `NavigationRail` examples ](https://github.com/flutter/flutter/issues/129832) | Preview | Preview | Preview | | --------------- | --------------- | --------------- | | <img src="https://github.com/flutter/flutter/assets/48603081/808c9577-c6b4-465f-b9fe-100d422dd408" /> | <img src="https://github.com/flutter/flutter/assets/48603081/c9b3ee03-56d7-4220-94cf-06e235631714" /> | <img src="https://github.com/flutter/flutter/assets/48603081/43fab47b-25e8-4412-92d2-6d4868e43ff8" /> |
-
- 07 Jun, 2023 1 commit
-
-
Greg Spencer authored
## Description Changes the context menu example for `MenuAnchor` so that it uses right-click, or (on macOS and iOS only) ctrl-left-click, for the context menu. Also disables the browser context menu on web platforms. ## Tests - Updated test to reflect new triggers.
-
- 06 Jun, 2023 1 commit
-
-
Leigha Jarett authored
Fixes https://github.com/flutter/flutter/issues/127213
-
- 02 Jun, 2023 1 commit
-
-
Hans Muller authored
Updated the ToggleButtons example and test to M3. Updated the nested tabs test to avoid warnings like: ``` Warning: A call to tap() with finder "exactly one widget with type "Tab" which is an ancestor of text "Explore": Tab(text: "Explore", icon: Icon)" derived an Offset (Offset(666.7, 92.0)) that would not hit test on the specified widget. ```
-
- 01 Jun, 2023 4 commits
-
-
Hans Muller authored
-
Hans Muller authored
-
Hans Muller authored
-
Hans Muller authored
Of the original 4 examples, the first 3 mostly covered the same API features and occupied quite a bit of real-estate at the top of https://api.flutter.dev/flutter/material/FloatingActionButton-class.html. Additionally the illustrations and the code samples didn't match in some cases. Replaced examples 0,1,2 with one example that changes attributes of the FAB when it's pushed. Fixes https://github.com/flutter/flutter/issues/128048
-
- 27 May, 2023 1 commit
-
-
Taha Tesser authored
fixes https://github.com/flutter/flutter/issues/124884
-
- 25 May, 2023 1 commit
-
-
LongCatIsLooong authored
Fixes https://github.com/flutter/flutter/issues/117627 ### Behavior changes: 1. If fade in/fade out animation is already in progress, hiding/showing the tooltip will immediately take effect without waiting for `waitDuration`. 2. A PointerDownEvent that doesn't become a part of a "trigger" gesture dismisses the tooltip, even for hovered ones. 3. The OverlayEntry is now updated only when the previous tooltip was completely dismissed. This can be fixed by OverlayPortal but I'm not sure what the correct behavior is.
-
- 24 May, 2023 1 commit
-
-
Sun Jiao authored
-
- 22 May, 2023 1 commit
-
-
Justin McCandless authored
This example was incorrectly throwing away results from a query when multiple queries were pending at once. Thanks to @sun-jiao in https://github.com/flutter/flutter/pull/127019#issuecomment-1552347037 for pointing this out. I also added a quick `Text` widget explaining what to do to use the examples. Since there are only three small possible `options`, it's easy to type into the field and not get any results and wonder what's wrong.
-
- 17 May, 2023 1 commit
-
-
Justin McCandless authored
Added examples clarifying how to fetch Autocomplete options asynchronously.
-
- 05 May, 2023 2 commits
-
-
Istiak Ahmed authored
This PR adds an another example for SliverAppBar, showing the use of stretch and onStretchTrigger https://user-images.githubusercontent.com/68919043/235420973-2bfb9871-9e05-4d87-9538-941d43178c76.mp4 Fixes #125651 ### Adds sample code for SliverAppBar [stretch, onStretchTrigger] This PR adds an another simple and easily understandable example code for SliverAppBar.
-
Bruno Leroux authored
## Description This PR adds one `ReorderableListView` example to demonstrate how `proxyDecorator` can be used to animate cards elevation. https://user-images.githubusercontent.com/840911/236468570-d2b33ab3-6b6d-4f8d-90de-778dcf1ad8ce.mp4 For motivation, see https://github.com/flutter/flutter/issues/124729#issuecomment-1521524190. ## Related Issue Fixes https://github.com/flutter/flutter/issues/124729 ## Tests Adds 1 tests. This PR also moves some misplaced example tests from `examples/api/test/reorderable_list` to `examples/api/test/material/reorderable_list` (and replaces two existing ones).
-
- 18 Apr, 2023 1 commit
-
-
Mitchell Goodwin authored
Fixes #102811. Adds an adaptive constructor to AlertDialog, along with the adaptive function showAdaptiveDialog. <img width="357" alt="Screenshot 2023-04-06 at 10 40 18 AM" src="https://user-images.githubusercontent.com/58190796/230455412-31100922-cfc5-4252-b8c6-6f076353f29e.png"> <img width="350" alt="Screenshot 2023-04-06 at 10 42 50 AM" src="https://user-images.githubusercontent.com/58190796/230455454-363dd37e-c44e-4aca-b6a0-cfa1d959f606.png">
-
- 17 Apr, 2023 2 commits
-
-
Qun Cheng authored
This PR is to: * Update API doc for `SearchBar`. * Add an example to show how to use a `SearchBar` as the builder of the `SearchAnchor`.
-
chunhtai authored
When swapping out delegate of selectioncontainer, if the newly passed in delegate doesn't have any selectable content(which is usually the case), the selectioncontainerstate will notify all of the listeners. One of the listener would be SelectionRegistrant._updateSelectionRegistrarSubscription, and since it doesn't have content, it would remove itself from the listener which causes concurrent modification
-
- 04 Apr, 2023 1 commit
-
-
Greg Spencer authored
Rename Sample classes
-
- 29 Mar, 2023 2 commits
-
-
Vinny authored
Modified TextField docs - Replaced 'labelText' to 'hintText' in code snippet
-
Simon Binder authored
Treat hidden `IndexedStack` children as offstage for test finder
-
- 24 Mar, 2023 1 commit
-
-
Hans Muller authored
Added ExpansionTileController
-
- 23 Mar, 2023 1 commit
-
-
Pierre-Louis authored
Add support for secondary tab bar
-
- 22 Mar, 2023 1 commit
-
-
Michael Goderbauer authored
Remove 1745 decorative breaks
-
- 06 Mar, 2023 1 commit
-
-
Bruno Leroux authored
Add ZoomPageTransitionsBuilder.allowSnapshotting
-