forked from mirrors/material_3_expressive
Refactor NavigationRailM3E to simplify rail types; update badge handling and expand functionality of navigation components.
This commit is contained in:
parent
83f5a02943
commit
5b27a91894
20 changed files with 360 additions and 486 deletions
|
|
@ -15,24 +15,9 @@ migration:
|
|||
- platform: root
|
||||
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
- platform: android
|
||||
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
- platform: ios
|
||||
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
- platform: linux
|
||||
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
- platform: macos
|
||||
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
- platform: web
|
||||
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
- platform: windows
|
||||
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
|
||||
|
||||
# User provided section
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,26 @@ class ButtonSection extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
],
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8, bottom: 4),
|
||||
child: Text('with Icon',
|
||||
style: Theme.of(context).textTheme.labelLarge),
|
||||
),
|
||||
Wrap(
|
||||
spacing: 12,
|
||||
runSpacing: 12,
|
||||
children: [
|
||||
for (final variant in ButtonM3EStyle.values)
|
||||
ButtonM3E(
|
||||
icon: Icon(Icons.add),
|
||||
label: Text(variant.name),
|
||||
style: variant,
|
||||
size: ButtonM3ESize.sm,
|
||||
shape: ButtonM3EShape.round,
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,24 @@ class IconButtonSection extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
],
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Text('with badgeValue',
|
||||
style: Theme.of(context).textTheme.titleMedium),
|
||||
),
|
||||
Row(
|
||||
spacing: 12,
|
||||
children: [
|
||||
for (final size in IconButtonM3ESize.values)
|
||||
IconButtonM3E(
|
||||
icon: const Icon(Icons.favorite),
|
||||
variant: IconButtonM3EVariant.filled,
|
||||
size: size,
|
||||
onPressed: () {},
|
||||
badgeValue: size.index + 1,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ class _NavigationSectionState extends State<NavigationSection> {
|
|||
icon: Icon(Icons.analytics_outlined),
|
||||
selectedIcon: Icon(Icons.analytics),
|
||||
label: 'Reports',
|
||||
smallBadge: true,
|
||||
badgeCount: 0,
|
||||
),
|
||||
NavigationRailM3EDestination(
|
||||
icon: Icon(Icons.settings_outlined),
|
||||
selectedIcon: Icon(Icons.settings),
|
||||
label: 'Settings',
|
||||
largeBadgeCount: 2,
|
||||
badgeCount: 2,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue