From e15e43cf7c5b457aea1d439f0904036e0f729d85 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 21 Apr 2022 17:46:10 +0200 Subject: [PATCH] example: present complete color palettes --- example/lib/view/colors_view.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/example/lib/view/colors_view.dart b/example/lib/view/colors_view.dart index b867f3bf..e6b19a2c 100644 --- a/example/lib/view/colors_view.dart +++ b/example/lib/view/colors_view.dart @@ -47,8 +47,7 @@ class ColorsView extends StatelessWidget { child: colorPaletteExample( 'prussianGreen', YaruColors.prussianGreen)), SizedBox(width: 25.0), - Expanded( - child: colorPaletteExample('warmGrey', YaruColors.warmGrey)), + Spacer(), SizedBox(width: 25.0), Spacer(), ], @@ -93,7 +92,7 @@ class ColorsView extends StatelessWidget { Widget colorPaletteExample(String colorName, MaterialColor color) { Map _color = {colorName: color}; - int _shade = 0; + int _shade = 50; TextStyle _textStyle(int _shade) => TextStyle( color: (_color.values.first[_shade]!.computeLuminance() > 0.4) ? Colors.black @@ -101,10 +100,9 @@ class ColorsView extends StatelessWidget { fontSize: 9.0, ); List _colorItem = []; - for (int i = 0; i < 5; i++) { - _shade += 100; + for (int i = 1; i <= 10; i++) { _colorItem.add(Container( - height: 45.0, + height: 40.0, color: _color.values.first[_shade], child: Padding( padding: const EdgeInsets.all(8.0), @@ -133,6 +131,7 @@ class ColorsView extends StatelessWidget { ), ), )); + _shade = i * 100; } return Column( children: _colorItem,