From a6f9c0479d79a6901e8dd46e533e9c3e41b2a446 Mon Sep 17 00:00:00 2001 From: Yash Ladha <201551061@iiitvadodara.ac.in> Date: Fri, 28 Dec 2018 16:58:29 +0530 Subject: [PATCH] Fixes #34 : Made Login Page responsive (#39) --- lib/screens/login.dart | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/screens/login.dart b/lib/screens/login.dart index 2bd3733..23a071e 100644 --- a/lib/screens/login.dart +++ b/lib/screens/login.dart @@ -21,17 +21,26 @@ class _LoginPageState extends State { @override Widget build(BuildContext context) { + Orientation currentOrientation = MediaQuery.of(context).orientation; + var iconHeight, _verticalPadding; + if (currentOrientation == Orientation.portrait) { + iconHeight = 150.0; + _verticalPadding = 110.0; + } else { + iconHeight = 120.0; + _verticalPadding = 80.0; + } return Stack( children: [ Container( padding: EdgeInsets.symmetric( - vertical: 120.0, + vertical: _verticalPadding, horizontal: 50.0, ), alignment: Alignment.topCenter, child: Image( image: AssetImage('assets/images/fest-logo.png'), - height: 150, + height: iconHeight, ), ), Center( @@ -42,7 +51,8 @@ class _LoginPageState extends State { OutlineButton( borderSide: BorderSide(color: Colors.deepOrange), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20.0)), + borderRadius: BorderRadius.circular(20.0), + ), child: Text('Login with Google'), onPressed: () => _handleSignIn(), ), @@ -52,5 +62,4 @@ class _LoginPageState extends State { ], ); } - }