From a6a5660fc4bd14342be250813e44449a71912143 Mon Sep 17 00:00:00 2001 From: Moutia Benachour Date: Sun, 11 Sep 2022 17:10:24 +0100 Subject: [PATCH] upgrade to flutter 3 --- lib/screens/login.dart | 24 +++++++++++------------ lib/screens/register/register_step_1.dart | 17 +++++++++------- lib/screens/register/register_step_2.dart | 16 ++++++++------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/lib/screens/login.dart b/lib/screens/login.dart index 7a6dfc7..480b49b 100644 --- a/lib/screens/login.dart +++ b/lib/screens/login.dart @@ -21,9 +21,7 @@ class LoginScreen extends StatelessWidget { Expanded( child: Container( child: Center( - child: FlatButton( - splashColor: Colors.transparent, - highlightColor: Colors.transparent, + child: TextButton( onPressed: () { Navigator.pushNamed(context, Routes.register); }, @@ -110,9 +108,7 @@ class LoginScreen extends StatelessWidget { // activeTrackColor: Colors.white, // activeColor: Colors.white, ), - FlatButton( - splashColor: Colors.transparent, - highlightColor: Colors.transparent, + TextButton( onPressed: () { Navigator.pushNamed( context, Routes.splashScreen); @@ -126,17 +122,19 @@ class LoginScreen extends StatelessWidget { ), SizedBox( width: double.infinity, - child: RaisedButton( - color: Color(0xFF495057), - textColor: Colors.white, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + padding: EdgeInsets.all(18.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + ), + backgroundColor:Color(0xFF495057), + foregroundColor: Colors.white, + ), onPressed: () { Navigator.pushNamed(context, Routes.dashboard); }, child: Text('Log In'), - padding: EdgeInsets.all(18.0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - ), ), ) ], diff --git a/lib/screens/register/register_step_1.dart b/lib/screens/register/register_step_1.dart index 037f417..a882fb4 100644 --- a/lib/screens/register/register_step_1.dart +++ b/lib/screens/register/register_step_1.dart @@ -89,9 +89,16 @@ class RegisterFirstScreen extends StatelessWidget { ), SizedBox( width: double.infinity, - child: RaisedButton( - color: Color(0xFF495057), - textColor: Colors.white, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF495057), + foregroundColor: Colors.white, + padding: EdgeInsets.all(18.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + ), + ), + onPressed: () { Navigator.push( context, @@ -103,10 +110,6 @@ class RegisterFirstScreen extends StatelessWidget { ); }, child: Text('Continue'), - padding: EdgeInsets.all(18.0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - ), ), ) ], diff --git a/lib/screens/register/register_step_2.dart b/lib/screens/register/register_step_2.dart index 97a4b53..034c99c 100644 --- a/lib/screens/register/register_step_2.dart +++ b/lib/screens/register/register_step_2.dart @@ -56,18 +56,20 @@ class RegisterSecondScreen extends StatelessWidget { ), SizedBox( width: double.infinity, - child: RaisedButton( - color: Color(0xFF495057), - textColor: Colors.white, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF495057), + foregroundColor: Colors.white, + padding: EdgeInsets.all(18.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + ), + ), onPressed: () { Navigator.pushNamed(context, Routes.dashboard); print('Next Step'); }, child: Text('Register'), - padding: EdgeInsets.all(18.0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - ), ), ) ],