From 6e9a455d12af211d6f5414f7fd4810b4bc0e6b1c Mon Sep 17 00:00:00 2001 From: Vistar Gupta <63628908+stuvistar@users.noreply.github.com> Date: Tue, 5 Oct 2021 09:29:15 +0530 Subject: [PATCH] Updated flat buttons with Text Button Flat buttons are deprecated by flutter, and recommended to use Text Button instead , so i just updated it --- lib/main.dart | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 6b4739bc..7577f14e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -50,40 +50,41 @@ class _QuizPageState extends State { Expanded( child: Padding( padding: EdgeInsets.all(15.0), - child: FlatButton( - textColor: Colors.white, - color: Colors.green, + child: TextButton( + style: TextButton.styleFrom( + backgroundColor: Colors.green, + ), + onPressed: (){}, child: Text( 'True', style: TextStyle( color: Colors.white, fontSize: 20.0, - ), + ) , + ), ), - onPressed: () { - //The user picked true. - }, - ), ), ), Expanded( child: Padding( padding: EdgeInsets.all(15.0), - child: FlatButton( - color: Colors.red, + child:TextButton( + style: TextButton.styleFrom( + backgroundColor:Colors.red, + ), + onPressed: (){}, child: Text( 'False', style: TextStyle( - fontSize: 20.0, color: Colors.white, - ), + fontSize: 20.0, + ) , + ), ), - onPressed: () { //The user picked false. - }, + ), ), - ), //TODO: Add a Row here as your score keeper ], );