You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/widgets/auth/auth_header.dart

114 lines
3.4 KiB
Dart

import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../config/size_config.dart';
import '../../lookups/auth_lookup.dart';
//TODO Elham delete this widget
class AuthHeader extends StatelessWidget {
var userType;
AuthHeader(this.userType);
@override
Widget build(BuildContext context) {
var screen = Container(
margin: SizeConfig.isMobile
? null
: EdgeInsetsDirectional.fromSTEB(SizeConfig.realScreenWidth * 0.30,
SizeConfig.realScreenWidth * 0.1, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 30,
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: SizeConfig.isMobile
? <Widget>[
SizedBox(
height: 10,
),
buildWelText(context),
buildDrSulText(context),
]
: <Widget>[
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
buildWelText(context),
buildDrSulText(context),
],
),
],
),
buildDrAppContainer(context)
],
));
return screen;
}
Container buildDrAppContainer(BuildContext context) {
if (userType == loginType.changePassword ||
userType == loginType.verifyPassword ||
userType == loginType.verificationMethods) {
return Container();
}
return Container(
child: Text(
"Doctor App",
style: TextStyle(
fontSize:
SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030,
fontWeight: FontWeight.w800,
color: HexColor('#B8382C')),
),
);
}
Text buildDrSulText(BuildContext context) {
if (userType == loginType.changePassword ||
userType == loginType.verifyPassword ||
userType == loginType.verificationMethods) {
return Text('');
}
return Text(
TranslationBase.of(context).drSulaimanAlHabib,
style: TextStyle(
fontWeight: FontWeight.w800,
fontSize:
SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029,
fontFamily: 'Poppins'),
);
}
Widget buildWelText(BuildContext context) {
String text = TranslationBase.of(context).welcomeTo;
if (userType == loginType.unknownUser) {
text = TranslationBase.of(context).welcomeBackTo;
}
if (userType == loginType.changePassword ||
userType == loginType.verifyPassword ||
userType == loginType.verificationMethods) {
return Text('');
}
return AppText(
text,
// style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
);
}
}