From ba25973bb0c72f82725d852a143a9d39b3e987a4 Mon Sep 17 00:00:00 2001 From: Dnyanesh Nimbalkar <78072155+Dnyaneshvn@users.noreply.github.com> Date: Sun, 17 Sep 2023 14:02:26 +0530 Subject: [PATCH] Convert deprecated FlatButton() to latest ElevatedButton() This commit updates all uses of FlatButton to ElevatedButton as FlatButton is deprecated in the latest version of Flutter. This change should be transparent to users of our code. This commit is part of an effort to update our codebase to use the latest Flutter best practices. --- day01_restaurant_picker/lib/main.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/day01_restaurant_picker/lib/main.dart b/day01_restaurant_picker/lib/main.dart index d88f68e..2e3eef8 100644 --- a/day01_restaurant_picker/lib/main.dart +++ b/day01_restaurant_picker/lib/main.dart @@ -42,14 +42,14 @@ class _MyAppState extends State { Padding( padding: EdgeInsets.only(top: 50), ), - FlatButton( - onPressed: () { - updateIndex(); - }, - child: Text('Pick Restaurant'), - color: Colors.purple, - textColor: Colors.white, - ) + ElevatedButton( + onPressed: () {}, + child: Text('Pick Snaks'), + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.purple), + foregroundColor: MaterialStateProperty.all(Colors.white), + ), + ), ], ))), );