From b354934ba3a9ef5bd32eacc2f3b1e622d221783c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 16 Sep 2020 11:56:44 +0300 Subject: [PATCH] Fixing splash Screen landscape design --- lib/pages/splash_screen_page.dart | 65 ++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/lib/pages/splash_screen_page.dart b/lib/pages/splash_screen_page.dart index 11131da..f094e0c 100644 --- a/lib/pages/splash_screen_page.dart +++ b/lib/pages/splash_screen_page.dart @@ -34,9 +34,13 @@ class _SplashScreenPageState extends State { body: Container( decoration: BoxDecoration( gradient: LinearGradient( - begin: Alignment(1.0,0.0), - end: Alignment(-0.0, 0.0), // 10% of the width, so there are ten blinds. - colors: [const Color(0xFF1BB0B8), const Color(0xFF44BFBB)],//[const Color(0xff30B7B9), const Color(0xff3AB2AD)], // whitish to gray + begin: Alignment(1.0, 0.0), + end: Alignment( + -0.0, 0.0), // 10% of the width, so there are ten blinds. + colors: [ + const Color(0xFF1BB0B8), + const Color(0xFF44BFBB) + ], //[const Color(0xff30B7B9), const Color(0xff3AB2AD)], // whitish to gray tileMode: TileMode.clamp, // repeats the gradient over the canvas ), ), @@ -45,19 +49,25 @@ class _SplashScreenPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ FractionallySizedBox( - widthFactor: 0.80, + widthFactor: 0.89, child: Column( children: [ SizedBox( - height: 200, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? 200 + : 50, ), Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( child: Icon( DriverApp.logo, - size: 120, + size: MediaQuery.of(context).orientation == + Orientation.portrait + ? 120 + : 70, color: Colors.white, ), margin: EdgeInsets.only( @@ -65,42 +75,64 @@ class _SplashScreenPageState extends State { ? 0 : MediaQuery.of(context).size.width * 0.20, left: !projectViewModel.isArabic - ? 0 + ? MediaQuery.of(context).orientation == + Orientation.landscape + ? MediaQuery.of(context).size.width * 0.13 + : MediaQuery.of(context).size.width * 0.0 : MediaQuery.of(context).size.width * 0.10), ), ], ), SizedBox( - height: 20, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? 20 + : 15, ), Column( children: [ Text( "Driver", style: TextStyle( - fontSize: 70, + fontSize: MediaQuery.of(context).orientation == + Orientation.portrait + ? 70 + : 35, fontWeight: FontWeight.bold, color: Colors.white), ), Text( "Delivery", style: TextStyle( - fontSize: 50, + fontSize: MediaQuery.of(context).orientation == + Orientation.portrait + ? 50 + : 25, letterSpacing: 1, color: Colors.white), ), Text( "APP", style: TextStyle( - fontSize: 53, - letterSpacing: 53, + fontSize: MediaQuery.of(context).orientation == + Orientation.portrait + ? 53 + : 21, + letterSpacing: + MediaQuery.of(context).orientation == + Orientation.portrait + ? 53 + : 27, color: Colors.white, fontWeight: FontWeight.w400), ), ], ), SizedBox( - height: 100, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? 100 + : 50, ) ], ), @@ -129,7 +161,10 @@ class _SplashScreenPageState extends State { ), ), SizedBox( - height: 10, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? 10 + : 5, ) ], ),