Created
December 31, 2019 11:42
-
-
Save moritzmorgenroth/5c5ccf433d888ed0fafe0b6c5f388793 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class PaletteSample extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
MaterialColor primarySwatch = generateMaterialColor(Palette.primary); | |
return Column( | |
crossAxisAlignment: CrossAxisAlignment.stretch, | |
children: <Widget>[ | |
Container( | |
height: 50, | |
color: primarySwatch.shade50, | |
child: Center( | |
child: Text( | |
"50", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
Container( | |
height: 50, | |
color: primarySwatch.shade100, | |
child: Center( | |
child: Text( | |
"100", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
Container( | |
height: 50, | |
color: primarySwatch.shade200, | |
child: Center( | |
child: Text( | |
"200", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
Container( | |
height: 50, | |
color: primarySwatch.shade300, | |
child: Center( | |
child: Text( | |
"300", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
Container( | |
height: 50, | |
color: primarySwatch.shade400, | |
child: Center( | |
child: Text( | |
"400", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
Container( | |
height: 50, | |
color: primarySwatch.shade500, | |
child: Center( | |
child: Text( | |
"500", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
Container( | |
height: 50, | |
color: primarySwatch.shade600, | |
child: Center( | |
child: Text( | |
"600", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
Container( | |
height: 50, | |
color: primarySwatch.shade700, | |
child: Center( | |
child: Text( | |
"700", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
Container( | |
height: 50, | |
color: primarySwatch.shade800, | |
child: Center( | |
child: Text( | |
"800", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
Container( | |
height: 50, | |
color: primarySwatch.shade900, | |
child: Center( | |
child: Text( | |
"900", | |
style: | |
Theme.of(context).textTheme.title.copyWith(color: Colors.white), | |
)), | |
), | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment