
This PR improves the distance between the label and the icon in the Tab widget. I updated the margin to 2 pixels, taken from the Figma design page for Material 3. On Material 2 I left the default value of 10 pixels. Related to #128696 (In particular, the distance between label and icon) Here are some screenshots for comparison. I looked a bit into the other mentioned issue of the tab height not following the M3 spec. Flutter uses 72 and the spec uses 64. But because Tab is a PreferredSizeWidget, I don't think there is an easy way to provide a different size depending on `ThemeData.useMaterial3`, because there is no `BuildContext` available. I provide a sample image for the 64 height as well for context on the linked issue, even though it's not part of the PR changes. The screenshots are taken side by side with the image at: https://m3.material.io/components/tabs/guidelines ## Original  ## New (tab height = 72, Flutter default for 8 years)  ## New (tab height = 64, M3 spec) 
Token Defaults Generator
Script that generates component theme data defaults based on token data.
Usage
Run this program from the root of the git repository:
dart dev/tools/gen_defaults/bin/gen_defaults.dart [-v]
This updates generated/used_tokens.csv
and the various component theme files.
Templates
There is a template file for every component that needs defaults from
the token database. These templates are implemented as subclasses of
TokenTemplate
. This base class provides some utilities and a structure
for adding a new block of generated code to the bottom of a given file.
Templates need to override the generate
method to provide the generated
code block as a string.
See lib/fab_template.dart
for an example that generates defaults for the
Floating Action Button.
Tokens
Tokens are stored in JSON files in data/
, and are sourced from
an internal Google database.
template.dart
should provide nearly all useful token resolvers
(e.g. color
, shape
, etc.). For special cases in which one shouldn't
be defined, use getToken
to get the raw token value. The script, through
the various revolvers and getToken
, validates tokens, keeps track of
which tokens are used, and generates generated/used_tokens.csv
.