Commit Graph

259 Commits

Author SHA1 Message Date
Qun Cheng
8b86d238b4
Create DropdownMenu Widget to Support Material 3 (#116088)
* Created ComboBox

* Fixed failing tests

* Reverted the menu style tests change

* Addressed comments

* Updated documentation and rename foregroundColor variable

* Remamed ComboBox to DropdownMenu

* Removed a unused import

* Removed unused import

Co-authored-by: Qun Cheng <quncheng@google.com>
2022-11-29 22:36:35 +00:00
Kate Lovett
8b32ac7a51
Revert "Update SnackBar to support Material 3" (#116199)
* Revert "Update SnackBar to support Material 3 (#115750)"

This reverts commit d58855c499.

* Kick ci.yaml

Co-authored-by: Jenn Magder <magder@google.com>
2022-11-29 19:11:43 +00:00
Eilidh Southren
d58855c499
Update SnackBar to support Material 3 (#115750)
* Add M2 defaults and template skeleton

* add MaterialStateColor functionality to ActionTextColor (issue #110402)

* Add M2 defaults and template skeleton

* updated material 3 tokens

* Updated snackbar demo

* add theme tests

* add gen defaults

* formatting

* more whitespace fixes

* add widget type

* update docs

* code review changes

* Add line overflow functionality

* whitespace fixes

* update M3 animation

* whitespace fixes

* add insetPadding param

* Modifed icon parameter to showCloseIcon

* white space fixes

* test fixes

* rename iconColor to closeIconColor

* debug test fix

* de-britishification
2022-11-29 18:02:34 +00:00
Greg Spencer
0cb9f70460
Menu bar accelerators (#114852)
* 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.
2022-11-29 00:27:20 +00:00
hangyu
0e57147db1
nav drawer (#115668) 2022-11-18 15:10:05 -08:00
Darren Austin
6ec2bd0a80
M3 Segmented Button widget (#113723) 2022-11-11 22:13:57 -08:00
chunhtai
80bf355192
Support keyboard selection in SelectabledRegion (#112584)
* Support keyboard selection in selectable region

* fix some comments

* addressing comments
2022-11-04 10:55:28 -07:00
Darren Austin
6a66aa282f
Add Material 3 support for BottomAppBar (reland #106525) (#114439)
* Revert "Revert "Add Material 3 support for BottomAppBar" (#114421)"

This reverts commit 210a2aa371.

* Regenerated the defaults from tokens and fixed tests.

* Fixed the tests.

* Updated the shape token template to optimize the a common case.
2022-11-02 10:54:19 +00:00
Taha Tesser
eadda3c393
Add Material 3 Popup Menu example and update existing example (#114228) 2022-11-01 22:10:45 +00:00
Zachary Anderson
210a2aa371
Revert "Add Material 3 support for BottomAppBar" (#114421) 2022-11-01 15:12:09 +00:00
Talat El Beick
0e98194681
Add Material 3 support for BottomAppBar (#106525) 2022-11-01 00:42:33 -07:00
Greg Spencer
37b72342b0
Add maybeOf for all the cases where of returns nullable. (#114120) 2022-10-31 23:09:09 +00:00
Justin McCandless
0b451b6dfd
Context Menus (#107193)
* Can show context menus anywhere in the app, not just on text.
* Unifies all desktop/mobile context menus to go through one class (ContextMenuController).
* All context menus are now just plain widgets that can be fully customized.
* Existing default context menus can be customized and reused.
2022-10-28 12:40:09 -07:00
Taha Tesser
7f75d24164
Add Material 3 ProgressIndicator examples (#113950) 2022-10-25 07:27:08 +00:00
Taha Tesser
b0e7c9c4f0
Move AnimatedIcons example and fix typo in cupertino/text_selection_toolbar.dart (#113937) 2022-10-25 07:27:06 +00:00
Taha Tesser
8815f60a5a
Add AnimatedIcons previews and examples (#113700) 2022-10-19 17:12:19 +00:00
hangyu
4fed6aaeff
Support Material 3 in bottom sheet (#112466) 2022-10-11 09:55:26 +00:00
Greg Spencer
6b32c0691b
Add checkbox and radio menu buttons (#112821) 2022-10-07 21:13:36 +00:00
Darren Austin
2bf83dd860
Add support for Material 3 Divider and VerticalDivider (#112655) 2022-09-29 11:30:53 -07:00
Taha Tesser
fd6997f07a
Add Dialog.fullscreen and example (#112261) 2022-09-29 09:12:05 -07:00
Greg Spencer
8c271e5cb8
Implement Material MenuBar and MenuAnchor (#112239)
This implements a MenuBar widget that can render a Material menu bar, and a MenuAnchor widget used to create a cascading menu in a region. The menus are drawn in the overlay, while the menu bar itself is in the regular widget tree. Keyboard traversal works between the two.

This implementation of the MenuBar uses MenuAnchor to create a cascading menu that contains widgets representing the menu items. These menu items can be any kind of widget, but are typically SubmenuButtons that host submenus, or MenuItemButtons that have shortcut hints (but don't actually activate the shortcuts) and don't host submenus.

Cascading menus can be created outside of a MenuBar by using a MenuAnchor. They can be either given a specific location to appear (a coordinate), or they can be located by the MenuAnchor region that wraps the control that opens them.

The developer may also create a MenuController to pass to the various menu primitives (MenuBar or MenuAnchor) to associate menus so that they can be traversed together and closed together. Creating a controller is not required.
2022-09-28 14:10:18 -07:00
Casey Hillers
bd5c347193
Revert "Add support for Material 3 Divider and VerticalDivider" (#112471) 2022-09-27 15:15:59 +00:00
Taha Tesser
1d5f455c4c
Add support for Material 3 Divider and VerticalDivider (#112378) 2022-09-26 20:36:09 +00:00
Greg Spencer
ce7789e030
Some miscellaneous changes found while making another PR (#111620) 2022-09-20 21:03:02 +00:00
Greg Spencer
e617d003fb
Normalize examples (#111223) 2022-09-09 21:17:11 +00:00
Qun Cheng
75fac6ae4d
Migrated Switch to Material 3 (#110095) 2022-09-09 11:53:48 -07:00
Qun Cheng
98eac3f198
Migrated Checkbox to Material 3 - Added Error State (#111153) 2022-09-08 14:42:29 -07:00
Pierre-Louis
8853926601
Deprecate ThemeData errorColor and backgroundColor (#110162) 2022-09-02 04:02:55 +00:00
Pierre-Louis
0c2f7bc2a2
Remove errant double spaces (#110758) 2022-09-02 04:00:58 +00:00
Qun Cheng
4125a3a8f0
Fixed the leading IconButton size (#110722) 2022-09-01 19:03:13 +00:00
Akshdeep Singh
519a5783c0
add material slider secondary value (#109808) 2022-08-28 23:26:32 +00:00
Darren Austin
5454bab6c1
Added support for M3 filled and filled tonal buttons. (#107382) 2022-08-25 11:36:03 -07:00
Pierre-Louis
360ac5bc79
Add covariant to ThemeExtension.lerp (#105207)
* Add covariant to `ThemeExtension.lerp`

* x

* x
2022-08-24 18:18:39 +02:00
Qun Cheng
c0c3874c77
Revert "Reland: Set IconButton.visualDensity default to VisualDensity.standard (#109432)" (#110119)
This reverts commit 79013b2be8.
2022-08-23 15:41:03 -07:00
Kate Lovett
7e12b37111
Deprecate 2018 text theme parameters (#109817) 2022-08-22 20:00:34 +00:00
Bryan Oltman
6540ae0be7
Add clipBehavior to Card+InkWell example (#109872)
* Add clipBehavior to Card+InkWell example

* Add test for example

* Update comment
2022-08-22 11:24:23 -04:00
Qun Cheng
79013b2be8
Reland: Set IconButton.visualDensity default to VisualDensity.standard (#109432)
* Revert "Revert "Set `IconButton.visualDensity` default to `VisualDensity.standard` (#109349)" (#109421)"

Co-authored-by: Qun Cheng <quncheng@google.com>
2022-08-18 09:46:13 -07:00
Greg Spencer
cd98c49c37
Some changes needed to PlatformMenuBar before the MenuBar implementation change lands. (#109556) 2022-08-16 23:12:21 +00:00
Qun Cheng
625d96a1c6
Revert "Set IconButton.visualDensity default to VisualDensity.standard (#109349)" (#109421)
This reverts commit 3070baf175.
2022-08-11 15:29:19 -07:00
Qun Cheng
3070baf175
Set IconButton.visualDensity default to VisualDensity.standard (#109349)
* Set IconButton's visualDensity to standard

Co-authored-by: Qun Cheng <quncheng@google.com>
2022-08-11 10:59:51 -07:00
Bruno Leroux
8faccb8a82
Reland: "Add example and troubleshooting comment for showSnackBar" (#105195) 2022-08-09 22:06:05 +00:00
Taha Tesser
76df7368b5
Update Chips examples and rename files (#108538) 2022-07-29 07:17:06 +00:00
Bryan Oltman
e3d08fb6d3
Hide the debug banner in the PopupMenuButton example (#108324)
* Hide the debug banner in the PopupMenuButton example

* Add test to verify that debug banner is not shown
2022-07-26 10:43:35 -04:00
hangyu
e74b9b5bef
Migrate InputDecorator to Material 3 (#107943)
* Support material 3 in inputDecorator

* Format polish

* format polish

* update input_decorator_test

* revert pub

* style update

* style polish

* default before base

* resolve comments

* Update text_field.2.dart

* move text styles into M2 theme

* add error style

* fix typo

* resolve comments

* fix g3 test
2022-07-26 01:35:38 +08:00
Taha Tesser
c422d280ab
Add an example for AppBar.notificationPredicate (#106018) 2022-07-15 09:40:06 +00:00
Taha Tesser
c251856c89
Update ListTile docs for color animation issues and add example (#106955) 2022-07-13 08:09:07 +00:00
Qun Cheng
16bbef188f
Migrate IconButton to Material 3 - Part 2 (#106437) 2022-07-06 18:14:07 +00:00
Aman Verma
3022db2bf3
docs: Add more potential use case for Bottom Navigation Bar (#99644) 2022-06-23 17:17:06 +00:00
Darren Austin
2532584bf3
Update parameters to the styleFrom button methods. (#105291)
* Update parameters to the `styleFrom` button methods.

* Updated the Flutter fix data to point to this PR.

* Updated handling of background color to better maintain backwards compatibility with previous API.
2022-06-21 19:08:22 -07:00
Hans Muller
d8783ff4c2
Reland Added MaterialStatesController, updated InkWell et al. #103167 (#105656) 2022-06-10 08:12:49 -07:00
Qun Cheng
66a84d1fed
Migrate IconButton to Material 3 - Part 1 (#105176)
* Added standard IconButton for M3 with new ButtonStyle field

* Added IconButton examples for standard, filled, filled_tonal, and outlined types

Co-authored-by: Qun Cheng <quncheng@google.com>
2022-06-07 12:39:22 -07:00
Hans Muller
9cf042ec74
Revert "Added MaterialStatesController, updated InkWell et al. (#103167)" (#105138)
This reverts commit 180566f2e5.
2022-06-01 17:19:16 -07:00
Alexandre Ardhuin
552c50e67c
more const immutable classes (#104988)
* more const immutable classes

* more const constructors in dev/ and examples/
2022-05-31 21:56:24 +02:00
Kate Lovett
2aa7317296
Revert "Add error message and documentation when a SnackBar is off screen" (#104843) 2022-05-27 11:58:14 -07:00
Hans Muller
180566f2e5
Added MaterialStatesController, updated InkWell et al. (#103167) 2022-05-27 08:38:42 -07:00
Bruno Leroux
bc53e6202e
Add error message and documentation when a SnackBar is off screen (#102073) 2022-05-26 05:15:07 -07:00
Greg Spencer
406d86b4ba
PlatformMenuBar changes to bring it into line with upcoming MenuBar implementation (#104565)
When I was doing the MenuBar implementation, I made some changes to the PlatformMenuBar to allow it to understand shortcuts a little more, and to deprecate the body parameter rename it to child to match most other widgets.

These are those changes, separated out because they are separable, and I'm trying to make the MenuBar PR smaller.
2022-05-25 14:48:28 -07:00
Taha Tesser
97452d1a10
Switch: Add an interactive example (#103045)
* `Switch`: Add an interactive examples

* Update docs

* Update doc
2022-05-25 10:40:31 +02:00
chunhtai
efb9368573
Supports global selection for all devices (#95226)
* Support global selection

* addressing comments

* add new test

* Addressing review comments

* update

* addressing comments

* addressing comments

* Addressing comments

* fix build
2022-05-24 13:53:55 -07:00
Taha Tesser
5739bf4fab
RefreshIndicator: Add notificationPredicate example (#103894) 2022-05-24 04:58:06 -07:00
Darren Austin
b08b88ce6c
Add support for Material 3 medium and large top app bars. (#103962)
* Add support for M3 AppBar 'Medium' and 'Large' types.

* Updates from review feedback.

* Updated from review feedback.
2022-05-20 14:02:25 -07:00
Darren Austin
17e2fce1cf
Add const MaterialStatePropertyAll class. (#104127) 2022-05-19 09:35:33 -07:00
Taha Tesser
3f5bd7d89e
Add Material 3 AppBar example (#102823) 2022-05-19 00:13:09 -07:00
Michael Goderbauer
2cbad4b3ae
Final chapter: migrate api doc samples to super-parameters (#104007) 2022-05-17 15:35:07 -07:00
Bryan Oltman
89f755c2df
Replace references to LinearProgressIndicator in CircularProgressIndicator example (#103349)
* Replace references to LinearProgressIndicator in CircularProgressIndicator example

* Add test

* fix copyright header
2022-05-09 16:04:02 -04:00
Taha Tesser
9489b64cbb
DropdownButton: Update selectedItemBuilder example to show case item alignment and update DropdownButton examples (#102748) 2022-05-06 00:14:08 -07:00
Taha Tesser
4ffc41ad10
ToggleButtons: Add interactive example (#100124) 2022-04-29 12:29:07 -07:00
Phil Quitslund
80849adee1
[dev, bots, examples] rename local functions with _s (#102703) 2022-04-28 10:44:06 -07:00
Taha Tesser
b1f88a6535
ReorderableListView: fix broken dartpad example & update examples, add tests (#102723) 2022-04-28 10:19:08 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
xubaolin
ef5a6da35a
Fix a DataTable crash and improve some docs (#100959) 2022-04-19 04:19:08 -07:00
Taha Tesser
d8c9ce9ab4
Add Material 3 FloatingActionButton and FloatingActionButton variants examples (#101105) 2022-04-18 10:09:07 -07:00
Taha Tesser
eca09252cd
Add Material 3 NavigationRail example and improve Material 2 example (#101345) 2022-04-18 06:54:07 -07:00
Taha Tesser
b8734b1700
Add Material 3 Dialog examples and update existing Dialog examples (#101508) 2022-04-18 04:14:05 -07:00
Darren Austin
c14ca6d321
Migrate common buttons to Material 3 (#100794) 2022-04-08 17:03:21 -07:00
Michael Goderbauer
a01424773e
Enable unnecessary_import (#101600) 2022-04-08 12:56:45 -07:00
Greg Spencer
2d9ad26086
Implements a PlatformMenuBar widget and associated data structures (#100274)
Implements a PlatformMenuBar widget and associated data structures for defining menu bars that use native APIs for rendering.

This PR includes:
A PlatformMenuBar class, which is a widget that menu bar data can be attached to for sending to the platform.
A PlatformMenuDelegate base, which is the type taken by a new WidgetsBinding.platformMenuDelegate.
An implementation of the above in DefaultPlatformMenuDelegate that talks to the built-in "flutter/menu" channel to talk to the built-in platform implementation. The delegate is so that a plugin could override with its own delegate and provide other platforms with native menu support using the same widgets to define the menus.
This is the framework part of the implementation. The engine part will be in flutter/engine#32080 (and flutter/engine#32358)
2022-04-04 15:03:10 -07:00
Pierre-Louis
2d89866c50
Minor improvements to ThemeExtension example (#100693)
* Update theme_extension.1.dart

* empty commit

* update color names to be semantic
2022-03-30 16:05:27 +02:00
Taha Tesser
4526519225
Tooltip: Add an example for TooltipTriggerMode.manual and add tests for existing Tooltip examples (#100554) 2022-03-25 15:51:06 -07:00
Darren Austin
86c02e998b
Migrate Card widget to Material 3. (#100532) 2022-03-22 13:46:56 -07:00
Pierre-Louis
8c1c2f6af5
Introduce Theme extensions (#98033)
* first pass

* x

* x

* address feedback

* support multiple extensions

* add convenience function, Object ⇒ dynamic, lerping

* remove not-useful comment

* fix examples/api lower sdk constraint

* remove trailing spaces

* remove another pesky trailing space

* improve lerp

* address feedback

* hide map implementation from constructor and copyWith

* use iterableproperty

* Revert "hide map implementation from constructor and copyWith"

This reverts commit a6994af004.

* slow down sample

* make theme extension params required

* add null check

* improve documentation

* fix hashCode and operator == overrides

* modify existing tests

* remove trailing spaces

* add all tests except lerping

* fix lerping bug

* add toString to themeExtension example

* add lerping test

* assume non-nullability in example

* address feedback

* update docs

* remove trailing space

* use Map.unmodifiable
2022-03-21 15:26:30 +01:00
Viren Khatri
671aa9e95e
complete migration of flutter repo to Object.hash* (#99505) 2022-03-04 12:56:21 -08:00
Mahesh Jamdade
0038a3e29f
Add NavigationBar dartpad example (#97046) 2022-03-01 10:14:09 -08:00
Hans Muller
db4c98fcb0
Added a NavgationBar example with nested Navigators (#98440) 2022-02-15 13:28:47 -08:00
Taha Tesser
e5f9d5bd26
Update PopupMenuButton example (#96681) 2022-01-28 14:10:14 -08:00
Taha Tesser
120d25f786
RefreshIndicator: Add an interactive example (#97254) 2022-01-28 02:40:06 -08:00
Kate Lovett
03da339ffe
Deprecate Scrollbar isAlwaysShown -> thumbVisibility (#96957) 2022-01-24 14:25:15 -08:00
Markus Aksli
75e2470302
Add Ink.image clip examples (#93799) 2021-12-17 02:54:14 -08:00
Dan Field
ab0a335973
Ban sync*/async* from user facing code (#95050) 2021-12-12 13:05:03 -08:00
Markus Aksli
f704b0d708
Add InputDecorator label color on error examples (#93480) 2021-12-08 17:24:08 -08:00
Darren Austin
e685c938a3
Replaced the reference to primaryVariant in code example as it will soon be deprecated. (#93351) 2021-11-09 17:49:40 -08:00
Taha Tesser
6fc988146b
[ReorderableListView] Update doc with example to make it clear proxyDecorator can overriden to customise an item when it is being dragged. (#91837) 2021-11-03 17:36:50 -07:00
Taha Tesser
13d14f1843
[doc] Update suffixIcon/prefixIcon for alignment with code snippet (#91998) 2021-10-27 00:38:02 -07:00
Bjarte Bore
64b0cfda3d
Added support for MaterialState to InputDecorator (#91762) 2021-10-14 13:26:45 -07:00
Ian Hickson
6d5fc420b6
Enable sort_child_properties_last lint (#91585) 2021-10-11 21:23:02 -07:00
Ian Hickson
61a0add286
Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
Zachary Anderson
b9d2177da0
Revert "Enable avoid_redundant_argument_values lint (#91409)" (#91461)
This reverts commit 5fd259be24.
2021-10-07 21:11:07 -07:00
Ian Hickson
5fd259be24
Enable avoid_redundant_argument_values lint (#91409) 2021-10-07 20:13:02 -07:00
Hans Muller
7d9f7b4ca1
Revert "Added support for MaterialState to InputDecorator (#91182)" (#91448)
This reverts commit 1c374c6598.
2021-10-07 17:08:37 -07:00
Ian Hickson
f25b833f27
Enable avoid_print lint. (#91444) 2021-10-07 16:48:04 -07:00
Mouad Debbar
c2ea78d231
Revert "Enable avoid_print lint. (#91332)" (#91438)
This reverts commit cb378edc9e.
2021-10-07 16:16:17 -04:00
Ian Hickson
cb378edc9e
Enable avoid_print lint. (#91332) 2021-10-07 09:53:03 -07:00
Bjarte Bore
1c374c6598
Added support for MaterialState to InputDecorator (#91182) 2021-10-06 09:36:06 -07:00
Greg Spencer
fd9ce27748
Clean up examples, remove section markers and --template args (#91133)
This does a cleanup of the examples, removing all of the "section" markers and extra comments that we don't need anymore now that the samples are no longer in the source code. It also removes the --template arguments from the {@tool dartpad} and {@tool sample} directives, since those are no longer used. It converts two examples that I discovered were still embedded into linked examples in the examples folder.

I didn't delete the templates from the snippets config folder yet, because there are still embedded samples in the dart:ui package from the engine that use them. Once dart:ui no longer uses the templates, they can be removed.

I bumped the version of the snippets package to pick up a change that allows removal of the --template argument.
2021-10-04 12:16:17 -07:00
Kenzie (Schmoll) Davisson
15967669b2
Add richMessage parameter to the Tooltip widget. (#88539) 2021-09-29 15:31:54 -07:00
Greg Spencer
ab2b0851a2
Add smoke tests for all the examples, fix 17 broken examples. (#89021)
This adds a smoke test for every single API example. It also fixes 17 tests that had bugs in them, or were otherwise broken, and even fixes one actual bug in the framework, and one limitation in the framework.

The bug in the framework is that NetworkImage's _loadAsync method had await response.drain<List<int>>();, but if the response is null, it will throw a cryptic exception saying that Null can't be assigned to List<int>. The fix was just to use await response.drain<void>(); instead.

The limitation is that RelativePositionedTransition takes an Animation<Rect> rect parameter, and if you want to use a RectTween with it, the value emitted there is Rect?, and one of the examples was just casting from Animation<Rect> to Animation<Rect?>, which is invalid, so I modified RelativePositionedTransition to take a Rect? and just use Rect.zero if the rect is null.
2021-09-28 09:32:06 -07:00
creativecreatorormaybenot
d4c3c7efcd
Fix (Vertical)Divider samples & docs (#89062) 2021-09-08 15:32:04 -07:00
Craig Labenz
3a1b04952b
fix: refactor Stepper.controlsBuilder to use ControlsDetails (#88538)
* changed controlsBuilder signature

combined all parameters into ControlsDetails class

* sample fixes

* updates to docstrings

* switched to positional argument for stepper.controlsbuilder

* Merge branch 'master' into stepper-builder-fix
2021-08-27 11:26:29 -07:00
Greg Spencer
33403bd28e
Extract Sample code into examples/api (#87280)
This extracts the sample code out from the API doc comments, and places them in separate files on disk, allowing running of the examples locally, testing them, and building of slightly larger examples.
2021-08-25 09:45:12 -07:00