"Used as a fill color for foreground elements like buttons.",
colorName:"Containers",
children:[
primaryContainer,
secondaryContainer,
tertiaryContainer,
errorContainer
]),
ColorGroupNavRail(
message:
"Indicates a color for text or icons on top of the paired container color.",
colorName:"On Containers",
children:[
onPrimaryContainer,
onSecondaryContainer,
onTertiaryContainer,
onErrorContainer
]),
ColorGroupNavRail(
message:
"Applied to actionable components on surfaces that are the reverse of those in the surrounding UI, creating a contrasting effect.",
colorName:"Inverse Primary",
children:[inversePrimary]),
SizedBox(height:20),
ColorGroupNavRail(
message:
"Background is typically used behind scrollable content, while surface and surfaceVariant are used for background of widgets. Inverse surface is used as the reverse of surface for a contrasting effect.",
colorName:"Background & Surfaces",
children:[
background,
surface,
surfaceVariant,
inverseSurface
]),
ColorGroupNavRail(
message:
"The color used for text and icons on top of the background or surface colors.",
"Scrim is used for a semi-transparent overaly that darks areas to focus attention. Shadow and outline are used for shadows and outlines on some widgets.",
colorName:"Scrim, Shadow, Outline",
children:[scrim,shadow,outline,outlineVariant]),
],
)
:Column(
children:[
ColorGroup(
small:_small,
children:[
primary,
onPrimary,
primaryContainer,
onPrimaryContainer,
],
),
EditableColorChip(
divider,
ColorGroup(
small:_small,
label:'shadow',
color:_colorScheme.shadow,
updateColorScheme:(color){
_colorScheme=_colorScheme.copyWith(shadow:color);
widget.handleColorRoleChange(
widget.brightness,
shadow:color,
);
},
children:[
secondary,
onSecondary,
secondaryContainer,
onSecondaryContainer,
],
),
divider,
ColorGroup(
small:_small,
children:[
tertiary,
onTertiary,
tertiaryContainer,
onTertiaryContainer,
],
),
divider,
ColorGroup(
small:_small,
children:[
error,
onError,
errorContainer,
onErrorContainer,
],
),
divider,
ColorGroup(
small:_small,
children:[
surface,
onSurface,
surfaceVariant,
onSurfaceVariant,
surfaceTint,
],
),
divider,
ColorGroup(
small:_small,
children:[
outline,
outlineVariant,
],
),
divider,
ColorGroup(
small:_small,
children:[
inverseSurface,
onInverseSurface,
inversePrimary,
],
),
divider,
ColorGroup(
small:_small,
children:[background,onBackground,scrim,shadow],
),
divider,
],
);
}
}
classColorGroupNavRailextendsStatelessWidget{
constColorGroupNavRail({
super.key,
requiredthis.message,
requiredthis.colorName,
requiredthis.children,
});
finalStringmessage;
finalStringcolorName;
finalList<Widget>children;
@override
Widgetbuild(BuildContextcontext){
returnColumn(
children:[
Tooltip(
message:message,
child:Row(
children:[
Text(colorName,
style:Theme.of(context)
.textTheme
.labelSmall!
.copyWith(fontWeight:FontWeight.bold)),
constSizedBox(width:5),
constIcon(Icons.info_outline_rounded,size:16),
],
),
),
ColorGroup(small:true,children:children)
],
);
}
@ -709,15 +871,28 @@ class ColorGroup extends StatelessWidget {
@override
Widgetbuild(BuildContextcontext){
finalaxisCount=children.length%4==0
?4
:children.length%3==0
?3
:children.length%2==0
?2
:1;
returnRepaintBoundary(
child:Card(
elevation:0.0,
clipBehavior:Clip.antiAlias,
clipBehavior:small ?Clip.none:Clip.antiAlias,
child:small
?GridView.count(
crossAxisCount:2,
crossAxisCount:axisCount,
crossAxisSpacing:1,
shrinkWrap:true,
childAspectRatio:1/0.3,
//childAspectRatio:children.length/1,
//childAspectRatio:(4/axisCount)*axisCount
//when4then4,when1then16
childAspectRatio:16/axisCount,
physics:constNeverScrollableScrollPhysics(),
children:children,
)
@ -758,21 +933,27 @@ class ColorChip extends StatelessWidget {