From 5ee53f69e0cb3c6557e8b96cb4dac32674894c14 Mon Sep 17 00:00:00 2001 From: Victor Shukuru Date: Mon, 16 May 2022 12:55:40 +0200 Subject: [PATCH] Updating dialog.md to fit new flutter version Changing FlatButton to TextButton in all the page. Flutter new version no longer support FlatButton --- docs/components/dialogs.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/components/dialogs.md b/docs/components/dialogs.md index e61a32a..f430383 100644 --- a/docs/components/dialogs.md +++ b/docs/components/dialogs.md @@ -68,15 +68,18 @@ AlertDialog( title: Text('Reset settings?'), content: Text('This will reset your device to its default factory settings.'), actions: [ - FlatButton( - textColor: Color(0xFF6200EE), + TextButton( + onPressed: () {}, - child: Text('CANCEL'), + child: Text( + 'CANCEL', + style:const TextStyle(color:Color(0xFF6200EE), + ), + ), ), - FlatButton( - textColor: Color(0xFF6200EE), + TextButton( onPressed: () {}, - child: Text('ACCEPT'), + child: Text('ACCEPT',style:const TextStyle(color:Color(0xFF6200EE),),), ), ], ) @@ -325,26 +328,24 @@ class MyHomePage extends StatelessWidget { ], ), actions: [ - FlatButton( - textColor: shrineBrown900, + TextButton( onPressed: () => Navigator.pop(context), - child: Text('ACTION 1'), + child: Text('ACTION 1',style:TextStyle(color:shrineBrown900,),), ), - FlatButton( - textColor: shrineBrown900, + TextButton( onPressed: () => Navigator.pop(context), - child: Text('ACTION 2'), + child: Text('ACTION 2',style:TextStyle(color:shrineBrown900),), ), ], ); return Scaffold( body: Center( - child: FlatButton( + child: TextButton( onPressed: () { showDialog(context: context, builder: (context) => dialog); }, - child: Text("SHOW DIALOG"), + child:const Text("SHOW DIALOG"), ), ), );