#buttontheme
Explore tagged Tumblr posts
Video
instagram
A new set of crystal of crystal gem button coming so. Something I hope you guys will like. Updates soon to be coming #stevenuniverse #steven #universe #crystalgems #crystalgemssu #buttonidea #buttontheme #duskwingarts
1 note
路
View note
Photo
#cuteasabutton #pink #babyblue #waxedcord #handmade #bracelets #baptism #greekchristening #cross #crossbracelets #martyrika #witnessbracelets #buttontheme #motherofpearl #evileye #evileyeandcross #favors #party #partyfavors #babyshower #newarrival #greekstyle #greekcommunity #squareknot #madewithlove #macrame #pretty #etsyelite #etsy #handmadeingreece
#macrame#evileyeandcross#squareknot#bracelets#favors#cuteasabutton#party#partyfavors#baptism#pretty#pink#cross#etsyelite#greekstyle#greekchristening#buttontheme#handmadeingreece#handmade#etsy#babyblue#crossbracelets#babyshower#evileye#greekcommunity#madewithlove#motherofpearl#witnessbracelets#newarrival#martyrika#waxedcord
0 notes
Text
How to Apply Theme on MaterialButton or RaisedButton In Flutter?
RaisedButton Widget is a normal button but implemented with material link spread effect upon clicking. In this article, we will go through how to apply Theme on MaterialButton or RaisedButton In Flutter?
How to Apply Theme on MaterialButton or RaisedButton In Flutter?
One way to do it is to define ButtonTheme in theme in MaterialApp.
void main() { 聽runApp(MaterialApp( 聽 聽home: Home(), 聽 聽theme: ThemeData( 聽 聽 聽 聽accentColor: Colors.redAccent, 聽 聽 聽 聽buttonTheme: ButtonThemeData( 聽 聽 聽 聽 聽 buttonColor: Colors.blueAccent, 聽 聽 聽 聽 聽 shape: RoundedRectangleBorder(), 聽 聽 聽 聽 聽 textTheme: ButtonTextTheme.accent, 聽 聽 聽 聽 聽 .... 聽 聽)), 聽)); } class Home extends StatelessWidget { 聽Widget build(BuildContext context) { 聽 聽return Scaffold( 聽 聽 聽appBar: AppBar( 聽 聽 聽 聽 聽title: Text("Button Theme"), 聽 聽 聽 聽 聽backgroundColor: Colors.green), 聽 聽 聽body: Center( 聽 聽 聽 聽 聽child: RaisedButton( //Button Color is as define in theme 聽 聽 聽 聽onPressed: () {}, 聽 聽 聽 聽child: Text("Send"), //Text Color as define in theme 聽 聽 聽)), 聽 聽); 聽} }
with this, all the buttons defined under this MaterialApp will carry this Theme Style.
Text Color will be the accentColor define in the ThemeData as i have defined textTheme: ButtonTextTheme.accent so it will Pick accentColor
Button picking Theme style as defined in the theme.
class MyButton extends StatelessWidget { 聽final String text; 聽final Color textColor; 聽final Color buttonColor; 聽final Function() onPressed; 聽MyButton({ 聽 聽@required this.text, 聽 聽this.buttonColor = const Color(0xFF000000) /** Default buttonColor */, 聽 聽@required this.onPressed, 聽 聽this.textColor = const Color(0xFFDDDDDD) /** Default textColor */, 聽}); 聽@override 聽Widget build(BuildContext context) { 聽 聽return MaterialButton( 聽 聽 聽color: buttonColor, 聽 聽 聽onPressed: onPressed, 聽 聽 聽child: Text(text, 聽 聽 聽 聽 聽style: TextStyle( 聽 聽 聽 聽 聽 聽color: textColor, 聽 聽 聽 聽 聽 聽fontSize: 20.0, 聽 聽 聽 聽 聽)), 聽 聽); 聽} }
Try a code snippet like the below:
void main() { 聽runApp( 聽 聽MaterialApp( 聽 聽 聽home: const Home(), 聽 聽 聽theme: ThemeData.from( 聽 聽 聽 聽colorScheme: const ColorScheme.light(), 聽 聽 聽).copyWith( 聽 聽 聽 聽textButtonTheme: TextButtonThemeData( 聽 聽 聽 聽 聽style: TextButton.styleFrom( 聽 聽 聽 聽 聽 聽primary: Colors.orange, 聽 聽 聽 聽 聽), 聽 聽 聽 聽), 聽 聽 聽 聽elevatedButtonTheme: ElevatedButtonThemeData( 聽 聽 聽 聽 聽style: ElevatedButton.styleFrom( 聽 聽 聽 聽 聽 聽onPrimary: Colors.yellow, 聽 聽 聽 聽 聽 聽primary: Colors.blue, 聽 聽 聽 聽 聽), 聽 聽 聽 聽), 聽 聽 聽 聽outlinedButtonTheme: OutlinedButtonThemeData( 聽 聽 聽 聽 聽style: OutlinedButton.styleFrom( 聽 聽 聽 聽 聽 聽primary: Colors.purple, 聽 聽 聽 聽 聽 聽backgroundColor: Colors.green, 聽 聽 聽 聽 聽), 聽 聽 聽 聽), 聽 聽 聽), 聽 聽), 聽); } class Home extends StatelessWidget { 聽const Home({Key? key}) : super(key: key); 聽@override 聽Widget build(BuildContext context) { 聽 聽return Scaffold( 聽 聽 聽appBar: AppBar( 聽 聽 聽 聽title: const Text("Button Theme Example"), 聽 聽 聽), 聽 聽 聽body: Center( 聽 聽 聽 聽child: Column( 聽 聽 聽 聽 聽mainAxisAlignment: MainAxisAlignment.center, 聽 聽 聽 聽 聽children: [ 聽 聽 聽 聽 聽 聽TextButton( 聽 聽 聽 聽 聽 聽 聽onPressed: () { 聽 聽 聽 聽 聽 聽 聽 聽Fluttertoast.showToast(msg: "TextButton Pressed"); 聽 聽 聽 聽 聽 聽 聽}, 聽 聽 聽 聽 聽 聽 聽child: const Text('TextButton'), 聽 聽 聽 聽 聽 聽), 聽 聽 聽 聽 聽 聽ElevatedButton( 聽 聽 聽 聽 聽 聽 聽onPressed: () { 聽 聽 聽 聽 聽 聽 聽 聽Fluttertoast.showToast(msg: "ElevatedButton Pressed"); 聽 聽 聽 聽 聽 聽 聽}, 聽 聽 聽 聽 聽 聽 聽child: const Text('ElevatedButton'), 聽 聽 聽 聽 聽 聽), 聽 聽 聽 聽 聽 聽OutlinedButton( 聽 聽 聽 聽 聽 聽 聽onPressed: () { 聽 聽 聽 聽 聽 聽 聽 聽Fluttertoast.showToast(msg: "OutlinedButton Pressed"); 聽 聽 聽 聽 聽 聽 聽}, 聽 聽 聽 聽 聽 聽 聽child: const Text('OutlinedButton'), 聽 聽 聽 聽 聽 聽), 聽 聽 聽 聽 聽], 聽 聽 聽 聽), 聽 聽 聽), 聽 聽); 聽} }
Output
Conclusion:
Thanks for being with us on a Flutter Journey !!!
In this article, we have been through How to Apply Theme on MaterialButton or RaisedButton in Flutter?
Kindly drop us your suggestion/feedback to serve you much better.
FlutterAgency.com is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget Guide, Flutter Projects, Code libs and etc.
0 notes
Video
So do you guys like the design so far the sample set will soon be made and posted but to break it down I used the color palette of each crystal gem and a few non official crystal gems to create this set of honorary crystal gem themed button. Another update will come soon... #crystalgemssu #crystal #gem #honorarycrystalgem #buttonidea #buttondesign #buttontheme #stevenuniverse #steven #universe
#buttontheme#universe#honorarycrystalgem#buttondesign#steven#gem#buttonidea#crystalgemssu#stevenuniverse#crystal
1 note
路
View note