improve Auth header

merge-requests/2/head
Elham Rababah 6 years ago
parent c1c4d56eea
commit 28e770061e

@ -9,13 +9,7 @@ import './providers/projects_provider.dart';
import './routes.dart'; import './routes.dart';
void main() => runApp(MyApp()); void main() => runApp(MyApp());
/*
*@author: Elham Rababah
*@Date:13/4/1993
*@param:
*@return:
*@desc: eee
*/
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
// This widget is the root of your application. // This widget is the root of your application.
@override @override
@ -36,7 +30,7 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
primaryColor: Hexcolor('#B8382C'), primaryColor: Hexcolor('#B8382C'),
buttonColor: Hexcolor('#B8382C'), buttonColor: Hexcolor('#B8382C'),
fontFamily: 'WorkSans'), fontFamily: 'WorkSans',),
initialRoute: INIT_ROUTE, initialRoute: INIT_ROUTE,
routes: routes, routes: routes,
), ),

@ -31,13 +31,7 @@ class AuthHeader extends StatelessWidget {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( buildTextUnderLogo(context),
margin: SizeConfig.isMobile
? null
: EdgeInsetsDirectional.fromSTEB(
SizeConfig.screenWidth * 0.13, 0, 0, 0),
child: buildTextUnderLogo(context),
)
], ],
), ),
Column( Column(
@ -86,50 +80,67 @@ class AuthHeader extends StatelessWidget {
} }
Widget buildTextUnderLogo(context) { Widget buildTextUnderLogo(context) {
Widget finalWid;
double textFontSize =
SizeConfig.isMobile ? 30 : SizeConfig.textMultiplier * 3;
EdgeInsetsDirectional containerMargin;
if (userType == loginType.knownUser || userType == loginType.unknownUser) { if (userType == loginType.knownUser || userType == loginType.unknownUser) {
return Text( finalWid = Text(
"LOGIN", "LOGIN",
style: TextStyle( style: TextStyle(fontSize: textFontSize, fontWeight: FontWeight.w800),
fontSize: SizeConfig.isMobile ? 30 : SizeConfig.screenWidth * 0.035,
fontWeight: FontWeight.w800),
); );
} else { } else {
String text1; String text1;
String text2; String text2;
if (userType == loginType.changePassword) { if (userType == loginType.changePassword) {
text1 = 'Change'; text1 = 'Change ';
text2 = 'Password!'; text2 = 'Password!';
} }
if (userType == loginType.verifyPassword) { if (userType == loginType.verifyPassword) {
text1 = 'verify'; text1 = 'Verify ';
text2 = 'Your Account!'; text2 = 'Your Account!';
} }
List<Widget> childrens = <Widget>[
Text(
text1,
style: TextStyle(fontSize: textFontSize, fontWeight: FontWeight.w800),
),
Text(
text2,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: textFontSize,
fontWeight: FontWeight.w800),
)
];
return Column( if (!SizeConfig.isMobile) {
crossAxisAlignment: CrossAxisAlignment.start, finalWid = Row(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Text( children: childrens,
text1, );
style: TextStyle( } else {
fontSize: finalWid = Column(
SizeConfig.isMobile ? 30 : SizeConfig.screenWidth * 0.035, crossAxisAlignment: CrossAxisAlignment.start,
fontWeight: FontWeight.w800), children: childrens,
), );
Text( }
text2,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize:
SizeConfig.isMobile ? 30 : SizeConfig.screenWidth * 0.035,
fontWeight: FontWeight.w800),
)
],
);
} }
if (!SizeConfig.isMobile) {
double start = SizeConfig.screenWidth * 0.13;
if (loginType.verifyPassword == userType ||
loginType.changePassword == userType) {
start = 0;
}
containerMargin = EdgeInsetsDirectional.fromSTEB(start, 0, 0, 0);
}
return Container(margin: containerMargin, child: finalWid);
} }
Container buildDrAppContainer(BuildContext context) { Container buildDrAppContainer(BuildContext context) {
if (userType == loginType.changePassword || userType == loginType.verifyPassword ) { if (userType == loginType.changePassword ||
userType == loginType.verifyPassword) {
return Container(); return Container();
} }
return Container( return Container(
@ -148,7 +159,8 @@ class AuthHeader extends StatelessWidget {
} }
Text buildDrSulText(BuildContext context) { Text buildDrSulText(BuildContext context) {
if (userType == loginType.changePassword || userType == loginType.verifyPassword ) { if (userType == loginType.changePassword ||
userType == loginType.verifyPassword) {
return Text(''); return Text('');
} }
return Text( return Text(
@ -166,7 +178,8 @@ class AuthHeader extends StatelessWidget {
if (userType == loginType.unknownUser) { if (userType == loginType.unknownUser) {
text = 'Welcome Back to '; text = 'Welcome Back to ';
} }
if (userType == loginType.changePassword || userType == loginType.verifyPassword ) { if (userType == loginType.changePassword ||
userType == loginType.verifyPassword) {
return Text(''); return Text('');
} }
return Text( return Text(

@ -64,6 +64,7 @@ class _LoginFormState extends State<LoginForm> {
buildSizedBox(), buildSizedBox(),
TextFormField( TextFormField(
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
// style: TextStyle(fontSize: 30),
decoration: InputDecoration( decoration: InputDecoration(
prefixIcon: Image.asset('assets/images/user_id_icon.png'), prefixIcon: Image.asset('assets/images/user_id_icon.png'),
hintText: 'Enter ID', hintText: 'Enter ID',

@ -19,7 +19,7 @@ class VerifyAccount extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Container( Container(
width: 85, width:SizeConfig.screenWidth*0.20,
child: TextFormField( child: TextFormField(
decoration: InputDecoration( decoration: InputDecoration(
// ts/images/password_icon.png // ts/images/password_icon.png
@ -39,7 +39,7 @@ class VerifyAccount extends StatelessWidget {
onChanged: (_) {}, onChanged: (_) {},
)), )),
Container( Container(
width: 85, width:SizeConfig.screenWidth*0.20,
child: TextFormField( child: TextFormField(
decoration: InputDecoration( decoration: InputDecoration(
// ts/images/password_icon.png // ts/images/password_icon.png
@ -59,7 +59,7 @@ class VerifyAccount extends StatelessWidget {
onChanged: (_) {}, onChanged: (_) {},
)), )),
Container( Container(
width: 85, width:SizeConfig.screenWidth*0.20,
child: TextFormField( child: TextFormField(
decoration: InputDecoration( decoration: InputDecoration(
// ts/images/password_icon.png // ts/images/password_icon.png
@ -79,7 +79,7 @@ class VerifyAccount extends StatelessWidget {
onChanged: (_) {}, onChanged: (_) {},
)), )),
Container( Container(
width: 85, width:SizeConfig.screenWidth*0.20,
child: TextFormField( child: TextFormField(
decoration: InputDecoration( decoration: InputDecoration(
// ts/images/password_icon.png // ts/images/password_icon.png

Loading…
Cancel
Save