• Pierre-Louis's avatar
    Improve defaults generation with logging, stats, and token validation (#128244) · 66cda591
    Pierre-Louis authored
    ## 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">
    66cda591
Name
Last commit
Last update
..
action_chip_template.dart Loading commit data...
app_bar_template.dart Loading commit data...
badge_template.dart Loading commit data...
banner_template.dart Loading commit data...
bottom_app_bar_template.dart Loading commit data...
bottom_sheet_template.dart Loading commit data...
button_template.dart Loading commit data...
card_template.dart Loading commit data...
checkbox_template.dart Loading commit data...
chip_template.dart Loading commit data...
color_scheme_template.dart Loading commit data...
date_picker_template.dart Loading commit data...
dialog_template.dart Loading commit data...
divider_template.dart Loading commit data...
drawer_template.dart Loading commit data...
expansion_tile_template.dart Loading commit data...
fab_template.dart Loading commit data...
filter_chip_template.dart Loading commit data...
icon_button_template.dart Loading commit data...
input_chip_template.dart Loading commit data...
input_decorator_template.dart Loading commit data...
list_tile_template.dart Loading commit data...
menu_template.dart Loading commit data...
navigation_bar_template.dart Loading commit data...
navigation_drawer_template.dart Loading commit data...
navigation_rail_template.dart Loading commit data...
popup_menu_template.dart Loading commit data...
progress_indicator_template.dart Loading commit data...
radio_template.dart Loading commit data...
search_bar_template.dart Loading commit data...
search_view_template.dart Loading commit data...
segmented_button_template.dart Loading commit data...
slider_template.dart Loading commit data...
snackbar_template.dart Loading commit data...
surface_tint.dart Loading commit data...
switch_template.dart Loading commit data...
tabs_template.dart Loading commit data...
template.dart Loading commit data...
text_field_template.dart Loading commit data...
time_picker_template.dart Loading commit data...
token_logger.dart Loading commit data...
typography_template.dart Loading commit data...