playing with sidesheet option

khanh_m3_demo
Khanh Nguyen 1 year ago
parent 115c2d62eb
commit 1d7f508271

@ -886,13 +886,13 @@ class ColorGroup extends StatelessWidget {
child: small child: small
? GridView.count( ? GridView.count(
crossAxisCount: axisCount, crossAxisCount: axisCount,
crossAxisSpacing: 1, crossAxisSpacing: 3,
shrinkWrap: true, shrinkWrap: true,
// childAspectRatio: children.length / 1, // childAspectRatio: children.length / 1,
// childAspectRatio: (4 / axisCount) * axisCount // childAspectRatio: (4 / axisCount) * axisCount
// when 4 then 4, when 1 then 16 // when 4 then 4, when 1 then 16
childAspectRatio: 16 / axisCount, childAspectRatio: 1,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
children: children, children: children,
) )
@ -934,6 +934,7 @@ class ColorChip extends StatelessWidget {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: color, color: color,
border: small border: small
? Border.all( ? Border.all(

@ -83,6 +83,33 @@ class Home extends StatefulWidget {
State<Home> createState() => _HomeState(); State<Home> createState() => _HomeState();
} }
class SideSheet extends StatelessWidget {
const SideSheet({
//
required this.handleColorRoleChange,
required this.lightColorScheme,
super.key,
});
final ConfigColorSchemeCallback handleColorRoleChange;
final ColorScheme lightColorScheme;
@override
Widget build(BuildContext context) {
return Column(
children: [
const Text("Color Scheme"),
ColorSchemeView(
small: true,
handleColorRoleChange: handleColorRoleChange,
colorScheme: lightColorScheme,
brightness: Brightness.light,
),
],
);
}
}
class _HomeState extends State<Home> with SingleTickerProviderStateMixin { class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
late final AnimationController controller; late final AnimationController controller;
@ -156,16 +183,32 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
switch (screenSelected) { switch (screenSelected) {
case ScreenSelected.component: case ScreenSelected.component:
return Expanded( return Expanded(
child: OneTwoTransition( child: Stack(
children: [
OneTwoTransition(
animation: railAnimation, animation: railAnimation,
one: FirstComponentList( one: FirstComponentList(
showNavBottomBar: showNavBarExample, showNavBottomBar: showNavBarExample,
scaffoldKey: scaffoldKey, scaffoldKey: scaffoldKey,
showSecondList: showMediumSizeLayout || showLargeSizeLayout), showSecondList:
showMediumSizeLayout || showLargeSizeLayout),
two: SecondComponentList( two: SecondComponentList(
scaffoldKey: scaffoldKey, scaffoldKey: scaffoldKey,
), ),
), ),
Positioned(
right: 0,
child: Container(
width: 250,
color: Theme.of(context).colorScheme.surface,
child: SideSheet(
handleColorRoleChange: widget.handleColorRoleChange,
lightColorScheme: widget.lightColors,
),
),
)
],
),
); );
case ScreenSelected.color: case ScreenSelected.color:
return ColorPalettesScreen( return ColorPalettesScreen(

Loading…
Cancel
Save