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

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

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

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

Loading…
Cancel
Save