@ -93,7 +93,6 @@ class _WelcomeLogin extends State<WelcomeLogin> {
var healthId ;
int _selectedLanguage = 0 ;
@ override
void initState ( ) {
isLoading = true ;
@ -104,12 +103,12 @@ class _WelcomeLogin extends State<WelcomeLogin> {
sharedPref . setBool ( IS_ROBOT_INIT , false ) ;
sharedPref . remove ( CLINICS_LIST ) ;
if ( projectViewModel . isArabic ) {
_selectedLanguage = value ;
_selectedLanguage = 1 ;
projectViewModel . changeLanguage ( ' en ' ) ;
locator < GAnalytics > ( ) . hamburgerMenu . logMenuItemClick ( ' change language to english ' ) ;
} else {
_selectedLanguage = value ;
_selectedLanguage = 0 ;
projectViewModel . changeLanguage ( ' ar ' ) ;
locator < GAnalytics > ( ) . hamburgerMenu . logMenuItemClick ( ' change language to arabic ' ) ;
}
@ -119,98 +118,103 @@ class _WelcomeLogin extends State<WelcomeLogin> {
@ override
Widget build ( BuildContext context ) {
final initialProjectViewModel = Provider . of < ProjectViewModel > ( context , listen: false ) ;
projectViewModel = context . read < ProjectViewModel > ( ) ;
/ / final initialProjectViewModel = Provider . of < ProjectViewModel > ( context , listen: false ) ;
/ / _selectedLanguage = initialProjectViewModel . isArabic ? 0 : 1 ;
return Consumer2 < ProjectViewModel , ToDoCountProviderModel > (
builder: ( context , projectViewModel , toDoProvider , child ) {
_selectedLanguage = projectViewModel . isArabic ? 0 : 1 ;
return AppScaffold (
appBarTitle: TranslationBase . of ( context ) . welcome ,
isShowDecPage: false ,
isShowAppBar: true ,
isshowBackButton: false ,
showNewAppBar: true ,
backgroundColor: Color ( 0xffF8F8F8 ) ,
showNewAppBarTitle: false ,
showDropDown: true ,
isShowLanguageChanger: true ,
appBarIcons: [ ] ,
dropDownList: [
TranslationBase . of ( context ) . arabicChange ,
TranslationBase . of ( context ) . english ,
] ,
dropDownIndexChange: ( value ) {
changeLanguage ( projectViewModel , value ! ) ;
} ,
dropdownIndexValue: _selectedLanguage ,
/ / Use the state variable
body: Column (
children: < Widget > [
Expanded (
child: ListView (
padding: EdgeInsets . only ( left: 21 , right: 21 ) ,
physics: BouncingScrollPhysics ( ) ,
children: [
SizedBox ( height: 30 ) ,
Row (
children: [
SvgPicture . asset (
" assets/images/new/hmg_icon.svg " ,
height: 62 ,
width: 62 ,
) ,
] ,
) ,
/ / Example of using toDoProvider:
/ / if ( toDoProvider . count > 0 ) Text ( " To-Do items: ${ toDoProvider . count } " ) ,
] ,
) ,
) ,
Spacer ( ) ,
Expanded (
child: Container (
padding: EdgeInsets . only ( top: 30 , bottom: 0 , right: 21 , left: 21 ) ,
child: Text (
" Welcome to Dr. Sulaiman Al Habib Medical Group " ,
style: TextStyle ( fontSize: 36 , fontWeight: FontWeight . w600 , color: Color ( 0xff2B353E ) , letterSpacing: - 0.4 , height: 47 / 36 ) ,
return SafeArea (
child: AppScaffold (
appBarTitle: TranslationBase . of ( context ) . welcome ,
isShowDecPage: false ,
isShowAppBar: true ,
isshowBackButton: false ,
showNewAppBar: true ,
backgroundColor: Color ( 0xffF8F8F8 ) ,
showNewAppBarTitle: false ,
showDropDown: true ,
isShowLanguageChanger: true ,
appBarIcons: [ ] ,
dropDownList: [
/ / TranslationBase . of ( context ) . arabicChange ,
/ / TranslationBase . of ( context ) . english ,
] ,
dropDownIndexChange: ( value ) {
changeLanguage ( projectViewModel , value ! ) ;
} ,
dropdownIndexValue: _selectedLanguage ,
/ / Use the state variable
body: Column (
children: < Widget > [
Expanded (
child: ListView (
padding: EdgeInsets . only ( left: 21 , right: 21 ) ,
physics: BouncingScrollPhysics ( ) ,
children: [
SizedBox ( height: 30 ) ,
Row (
children: [
SvgPicture . asset (
" assets/images/new/hmg_icon.svg " ,
height: 62 ,
width: 62 ,
) ,
] ,
) ,
) ,
/ / Example of using toDoProvider:
/ / if ( toDoProvider . count > 0 ) Text ( " To-Do items: ${ toDoProvider . count } " ) ,
] ,
) ,
Container (
padding: EdgeInsets . only ( top: 16 , bottom: 10 , right: 21 , left: 21 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . stretch ,
children: [
Directionality (
textDirection: TextDirection . ltr , / / Consider making this dynamic based on language
child: inputWidget (
" National ID. or File No " ,
" 1xxxxxxxx " ,
nationIdController , / / Assumed to be a TextEditingController in your State class
isEnable: true ,
prefix: null ,
hasSelection: false ,
isBorderAllowed: false ,
isAllowLeadingIcon: true ,
leadingIcon: " assets/images/svg/student-card.svg " ,
) ,
) ,
] ,
) ,
Spacer ( ) ,
Container (
padding: EdgeInsets . only ( top: 30 , bottom: 0 , right: 21 , left: 21 ) ,
child: Text (
TranslationBase . of ( context ) . welcomeToDrSulaiman ,
style: TextStyle (
fontSize: 36 ,
fontFamily: ( projectViewModel . currentLanguage = = ' ar ' ? ' Cairo ' : ' Poppins ' ) ,
fontWeight: FontWeight . w600 ,
color: Color ( 0xff2B353E ) ,
letterSpacing: - 0.4 ,
height: 47 / 36 ,
) ,
) ,
SizedBox (
height: 15 ,
) ,
Container (
padding: EdgeInsets . only ( top: 16 , bottom: 10 , right: 21 , left: 21 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . stretch ,
children: [
Directionality (
textDirection: TextDirection . ltr , / / Consider making this dynamic based on language
child: inputWidget (
" National ID. or File No " ,
" 1xxxxxxxx " ,
nationIdController , / / Assumed to be a TextEditingController in your State class
isEnable: true ,
prefix: null ,
hasSelection: false ,
isBorderAllowed: false ,
isAllowLeadingIcon: true ,
leadingIcon: " assets/images/svg/student-card.svg " ,
) ,
) ,
] ,
) ,
Row (
mainAxisSize: MainAxisSize . min ,
children: < Widget > [
Expanded (
child: Container (
padding: EdgeInsets . only ( top: 0 , bottom: 16 , right: 21 , left: 21 ) ,
child: DefaultButton (
TranslationBase . of ( context ) . login ,
( ) {
) ,
SizedBox (
height: 15 ,
) ,
Row (
mainAxisSize: MainAxisSize . min ,
children: < Widget > [
Expanded (
child: Padding (
padding: const EdgeInsets . all ( 10.0 ) ,
child: CustomButton (
text: TranslationBase . of ( context ) . login ,
icon: " assets/images/svg/login1.svg " ,
onPressed: ( ) {
bool isValid = validateIqama ( nationIdController . text ) ;
print ( " Iqama is valid: $ isValid " ) ;
@ -280,53 +284,56 @@ class _WelcomeLogin extends State<WelcomeLogin> {
} else {
Utils . showErrorToast ( " Please enter a valid Iqama number. " ) ;
}
} ,
textColor: Colors . white ,
) ,
) ,
} ) ,
) ,
] ,
) ,
Row (
crossAxisAlignment: CrossAxisAlignment . center ,
mainAxisAlignment: MainAxisAlignment . center ,
children: [
RichText (
textAlign: TextAlign . center ,
text: TextSpan (
style: TextStyle (
color: Colors . black ,
fontSize: 16 ,
height: 26 / 16 ,
fontFamily: ' poppins ' ,
fontWeight: FontWeight . w500 ,
) ,
] ,
) ,
Row (
crossAxisAlignment: CrossAxisAlignment . center ,
mainAxisAlignment: MainAxisAlignment . center ,
children: [
RichText (
textAlign: TextAlign . center ,
text: TextSpan (
style: TextStyle (
color: Colors . black ,
fontSize: 16 ,
height: 26 / 16 ,
fontFamily: ' poppins ' ,
fontWeight: FontWeight . w500 ,
) ,
children: < TextSpan > [
TextSpan (
text: TranslationBase . of ( context ) . dontHaveAccount ,
) ,
children: < TextSpan > [
TextSpan ( text: ' Don’ t have an account? ' ) ,
TextSpan (
text: ' Register now ' ,
style: const TextStyle (
color: Colors . red ,
fontSize: 16 ,
height: 26 / 16 ,
fontFamily: ' poppins ' ,
fontWeight: FontWeight . w500 ,
) ,
recognizer: TapGestureRecognizer ( )
. . onTap = ( ) {
Navigator . of ( context ) . push ( FadePage ( page: RegisterNew ( ) ) ) ;
locator < GAnalytics > ( ) . loginRegistration . visited_alhabib_group ( true ) ;
} ,
TextSpan ( text: " " ) ,
TextSpan (
text: TranslationBase . of ( context ) . registerNow ,
style: const TextStyle (
color: Colors . red ,
fontSize: 16 ,
height: 26 / 16 ,
fontFamily: ' poppins ' ,
fontWeight: FontWeight . w500 ,
) ,
] ,
) ,
recognizer: TapGestureRecognizer ( )
. . onTap = ( ) {
Navigator . of ( context ) . push ( FadePage ( page: RegisterNew ( ) ) ) ;
locator < GAnalytics > ( ) . loginRegistration . visited_alhabib_group ( true ) ;
} ,
) ,
] ,
) ,
] ,
)
] ,
) ,
) ;
} ,
) ,
] ,
) ,
SizedBox (
height: 10 ,
) ,
] ,
) ,
) ,
) ;
}