Commit Graph

14 Commits

Author SHA1 Message Date
Pierre-Louis
66cda5917d
Improve defaults generation with logging, stats, and token validation (#128244)
## Description

This improves defaults generation with logging, stats, and token validation. 

This PR includes these changes:
* introduce `TokenLogger`, with a verbose mode
  * prints versions and tokens usage to the console
  * outputs `generated/used_tokens.csv`, a list of all used tokens, for use by Google
* find token files in `data` automatically
* hide tokens `Map`
  * tokens can be obtained using existing resolvers (e.g. `color`, `shape`), or directly through `getToken`.
  * tokens can be checked for existence with `tokenAvailable`
* remove version from template, since the tokens are aggregated and multiple versions are possible (as is the case currently), it does not make sense to attribute a single version
* improve documentation

## Related Issues
 - Fixes https://github.com/flutter/flutter/issues/122602

## Tests
 - Added tests for `TokenLogger`
 - Regenerated tokens, no-op except version removal

## Future work
A future PR should replace or remove the following invalid tokens usages

<img width="578" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b6f9e5a7-523f-4f72-94f9-1b0bf4cc9f00">
2023-06-09 11:28:18 +00:00
Qun Cheng
4e7e4512b6
Reorder materialStateProperty defaults (#125905)
Fixes #122250. This PR is to make sure all the MaterialStateProperty defaults are able to correctly resolve different states. 
* When a widget is pressed, it is also hovered, so we need to put the `MaterialState.pressed` check before `MaterialState.hovered`. 
* When a widget is focused, the widget should still be able to be hovered, so we should check `MaterialState.hovered` before `MaterialState.focused`.
* There are also cases like in _InputDecoratorDefaultsM3, the `MaterialState.disabled` should be checked before `MaterialState.error`.

 the order should be disabled, (error), pressed, hovered, focused.
2023-05-11 00:03:09 +00:00
Qun Cheng
b114654947
Add IconButton.filled, IconButton.filledTonal, IconButton.outlined (#121884) 2023-03-03 19:59:39 -08:00
Darren Austin
33ed6a3533
Fixing elevation issues with Material 3 (#110624)
* Added support for surfaceTintColor and shadowColor to the Dialog widgets.
* Updated the defaults for Material.shadowColor and Material.surfaceTint to allow turning off the features with a transparent color.
* Added support for shadowColor and surfaceTintColor for Drawer widget.
2022-09-06 16:16:45 -07:00
Qun Cheng
4125a3a8f0
Fixed the leading IconButton size (#110722) 2022-09-01 19:03:13 +00: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
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
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
Qun Cheng
f7b0023439
Added IconButtonTheme and apply it to IconButton in M3 (#108332)
* Created IconButtonTheme and apply it to IconButton
2022-08-03 13:47:44 -07:00
Darren Austin
d4061c19f4
Refactor gen_defaults to support multiple generated code blocks in the same file independently. (#107278) 2022-07-10 17:17:09 -07:00
Qun Cheng
16bbef188f
Migrate IconButton to Material 3 - Part 2 (#106437) 2022-07-06 18:14:07 +00:00
Darren Austin
1ed50b219b
Updated tokens to v0.99. (#105545) 2022-06-07 16:12:28 -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