Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced padding for screen dimensions with MediaQuery to make it compatible with all screen sizes. #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/home/shuchita/flutter"
export "FLUTTER_APPLICATION_PATH=/home/shuchita/TheGorgeousLogin"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_FRAMEWORK_DIR=/home/shuchita/flutter/bin/cache/artifacts/engine/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not add this file in git

124 changes: 60 additions & 64 deletions lib/ui/login_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/material.dart' as prefix0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed

import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:the_gorgeous_login/style/theme.dart' as Theme;
Expand All @@ -13,7 +14,6 @@ class LoginPage extends StatefulWidget {

class _LoginPageState extends State<LoginPage>
with SingleTickerProviderStateMixin {

final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();

final FocusNode myFocusNodeEmailLogin = FocusNode();
Expand Down Expand Up @@ -43,77 +43,75 @@ class _LoginPageState extends State<LoginPage>

@override
Widget build(BuildContext context) {
print(MediaQuery.of(context).size.height);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed

return new Scaffold(
key: _scaffoldKey,
body: NotificationListener<OverscrollIndicatorNotification>(
onNotification: (overscroll) {
overscroll.disallowGlow();
},
child: SingleChildScrollView(
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height >= 775.0
? MediaQuery.of(context).size.height
: 775.0,
decoration: new BoxDecoration(
gradient: new LinearGradient(
colors: [
Theme.Colors.loginGradientStart,
Theme.Colors.loginGradientEnd
],
begin: const FractionalOffset(0.0, 0.0),
end: const FractionalOffset(1.0, 1.0),
stops: [0.0, 1.0],
tileMode: TileMode.clamp),
),
child: Column(
mainAxisSize: MainAxisSize.max,
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
decoration: new BoxDecoration(
gradient: new LinearGradient(
colors: [
Theme.Colors.loginGradientStart,
Theme.Colors.loginGradientEnd
],
begin: const FractionalOffset(0.0, 0.0),
end: const FractionalOffset(1.0, 1.0),
stops: [0.0, 1.0],
tileMode: TileMode.clamp),
),
child: Column(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height * (60 / 730)),
child: new Image(
width: 250.0,
height: 191.0,
fit: BoxFit.fill,
image: new AssetImage('assets/img/login_logo.png')),
),
Padding(
padding: EdgeInsets.only(top: 20.0),
child: _buildMenuBar(context),
),
Expanded(
flex: 2,
child: PageView(
controller: _pageController,
onPageChanged: (i) {
if (i == 0) {
setState(() {
right = Colors.white;
left = Colors.black;
});
} else if (i == 1) {
setState(() {
right = Colors.black;
left = Colors.white;
});
}
},
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 75.0),
child: new Image(
width: 250.0,
height: 191.0,
fit: BoxFit.fill,
image: new AssetImage('assets/img/login_logo.png')),
new ConstrainedBox(
constraints: const BoxConstraints.expand(),
child: _buildSignIn(context),
),
Padding(
padding: EdgeInsets.only(top: 20.0),
child: _buildMenuBar(context),
),
Expanded(
flex: 2,
child: PageView(
controller: _pageController,
onPageChanged: (i) {
if (i == 0) {
setState(() {
right = Colors.white;
left = Colors.black;
});
} else if (i == 1) {
setState(() {
right = Colors.black;
left = Colors.white;
});
}
},
children: <Widget>[
new ConstrainedBox(
constraints: const BoxConstraints.expand(),
child: _buildSignIn(context),
),
new ConstrainedBox(
constraints: const BoxConstraints.expand(),
child: _buildSignUp(context),
),
],
),
new ConstrainedBox(
constraints: const BoxConstraints.expand(),
child: _buildSignUp(context),
),
],
),
),
),
],
),
),
),
);
}
Expand Down Expand Up @@ -332,8 +330,7 @@ class _LoginPageState extends State<LoginPage>
fontFamily: "WorkSansBold"),
),
),
onPressed: () =>
showInSnackBar("Login button pressed")),
onPressed: () => showInSnackBar("Login button pressed")),
),
],
),
Expand Down Expand Up @@ -634,8 +631,7 @@ class _LoginPageState extends State<LoginPage>
fontFamily: "WorkSansBold"),
),
),
onPressed: () =>
showInSnackBar("SignUp button pressed")),
onPressed: () => showInSnackBar("SignUp button pressed")),
),
],
),
Expand Down