@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/analytics/flows/login_registration.dart';
import ' package:diplomaticquarterapp/analytics/google-analytics.dart ' ;
import ' package:diplomaticquarterapp/config/shared_pref_kay.dart ' ;
import ' package:diplomaticquarterapp/config/size_config.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/project_view_model.dart ' ;
import ' package:diplomaticquarterapp/locator.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart ' ;
@ -56,125 +55,127 @@ class _Register extends State<Register> {
@ override
Widget build ( BuildContext context ) {
return AppScaffold (
appBarTitle: TranslationBase . of ( context ) . register ,
isShowAppBar: false ,
isShowDecPage: false ,
showNewAppBar: false ,
showNewAppBarTitle: true ,
body: Column (
children: [
Expanded (
child: ListView (
padding: EdgeInsets . all ( 21 ) ,
physics: BouncingScrollPhysics ( ) ,
children: [
SizedBox ( height: 10 ) ,
Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Text (
TranslationBase . of ( context ) . enterNationalId ,
style: TextStyle ( fontSize: 16 , fontWeight: FontWeight . w600 , color: Color ( 0xff2B353E ) , letterSpacing: - 0.64 , height: 23 / 16 ) ,
) ) ,
SizedBox ( height: 10 ) ,
PhoneNumberSelectorWidget ( onNumberChange: ( value ) = > { mobileNo = value , validateForm ( ) } , onCountryChange: ( value ) = > countryCode = value ) ,
SizedBox ( height: 12 ) ,
Directionality ( textDirection: TextDirection . ltr , child: inputWidget ( TranslationBase . of ( context ) . nationalIdNumber , " Xxxxxxxxx " , nationalIDorFile ) ) ,
SizedBox ( height: 20 ) ,
Row (
children: < Widget > [
Expanded (
child: Row (
children: < Widget > [
Radio (
value: 1 ,
groupValue: isHijri ,
onChanged: ( value ) {
setState ( ( ) {
isHijri = value ;
} ) ;
validateForm ( ) ;
} ,
) ,
Text ( TranslationBase . of ( context ) . hijriDate ) ,
] ,
) ,
appBarTitle: TranslationBase . of ( context ) . register ,
isShowAppBar: false ,
isShowDecPage: false ,
showNewAppBar: false ,
showNewAppBarTitle: true ,
body: Column (
children: [
Expanded (
child: ListView (
padding: EdgeInsets . all ( 21 ) ,
physics: BouncingScrollPhysics ( ) ,
children: [
SizedBox ( height: 10 ) ,
Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Text (
TranslationBase . of ( context ) . enterNationalId ,
style: TextStyle ( fontSize: 16 , fontWeight: FontWeight . w600 , color: Color ( 0xff2B353E ) , letterSpacing: - 0.64 , height: 23 / 16 ) ,
) ) ,
SizedBox ( height: 10 ) ,
PhoneNumberSelectorWidget ( onNumberChange: ( value ) = > { mobileNo = value , validateForm ( ) } , onCountryChange: ( value ) = > countryCode = value ) ,
SizedBox ( height: 12 ) ,
Directionality ( textDirection: TextDirection . ltr , child: inputWidget ( TranslationBase . of ( context ) . nationalIdNumber , " Xxxxxxxxx " , nationalIDorFile ) ) ,
SizedBox ( height: 20 ) ,
Row (
children: < Widget > [
Expanded (
child: Row (
children: < Widget > [
Radio (
value: 1 ,
groupValue: isHijri ,
onChanged: ( value ) {
setState ( ( ) {
isHijri = value ;
} ) ;
validateForm ( ) ;
} ,
) ,
Text ( TranslationBase . of ( context ) . hijriDate ) ,
] ,
) ,
Expanded (
child: Row (
children: < Widget > [
Radio (
value: 0 ,
groupValue: isHijri ,
onChanged: ( value ) {
setState ( ( ) {
isHijri = value ;
} ) ;
validateForm ( ) ;
} ,
) ,
Text ( TranslationBase . of ( context ) . gregorianDate ) ,
] ,
) ,
) ,
Expanded (
child: Row (
children: < Widget > [
Radio (
value: 0 ,
groupValue: isHijri ,
onChanged: ( value ) {
setState ( ( ) {
isHijri = value ;
} ) ;
validateForm ( ) ;
} ,
) ,
Text ( TranslationBase . of ( context ) . gregorianDate ) ,
] ,
) ,
] ,
) ,
Row ( children: < Widget > [
Container (
width: SizeConfig . realScreenWidth * . 9 ,
child: isHijri = = 1
? Directionality (
textDirection: TextDirection . ltr ,
child: inputWidget ( TranslationBase . of ( context ) . dob , " DD/MM/YYYYY " , dob ,
isNumber: false ,
suffix: Icon (
Icons . calendar_today ,
size: 16 ,
) ) )
: Container (
child: InkWell (
onTap: ( ) {
if ( isHijri ! = null ) _selectDate ( context ) ;
} ,
child: Directionality (
textDirection: TextDirection . ltr ,
child: inputWidget ( TranslationBase . of ( context ) . dob , " DD/MM/YYYYY " , dobEn ,
isNumber: false ,
isEnable : false ,
suffix: Icon (
Icons . calendar_today ,
size: 16 ,
) ) ) ) ) ) ,
] )
] ,
) ,
) ,
] ,
) ,
Row ( children: < Widget > [
Container (
width: SizeConfig . realScreenWidth * . 9 ,
child: isHijri = = 1
? Directionality (
textDirection: TextDirection . ltr ,
child: inputWidget ( TranslationBase . of ( context ) . dob , " DD/MM/YYYYY " , dob ,
isNumber: false ,
suffix: Icon (
Icons . calendar_today ,
size: 16 ,
) ) )
: Container (
child: InkWell (
onTap: ( ) {
if ( isHijri ! = null ) _selectDate ( context ) ;
} ,
child: Directionality (
textDirection: TextDirection . ltr ,
child: inputWidget ( TranslationBase . of ( context ) . dob , " DD/MM/YYYYY " , dobEn ,
isNumber : false ,
isEnable: false ,
suffix: Icon (
Icons . calendar_today ,
size: 16 ,
) ) ) ) ) ) ,
] )
] ,
) ,
Container (
width: double . maxFinite ,
/ / height: 80.0 ,
color: Colors . white ,
/ / margin: EdgeInsets . only ( bottom: 50.0 ) ,
child: Row (
children: [
Expanded (
child: Padding (
padding: EdgeInsets . all ( 10 ) , child: DefaultButton ( TranslationBase . of ( context ) . cancel , ( ) {
Navigator . of ( context ) . pop ( ) ;
locator < GAnalytics > ( ) . loginRegistration . registration_cancel ( step: ' enter details ' ) ;
} , textColor: Colors . white , color: Color ( 0xffD02127 ) ) ) ,
) ,
Expanded (
child: Padding (
padding: EdgeInsets . all ( 10 ) ,
child: DefaultButton ( TranslationBase . of ( context ) . next , ( ) {
startRegistration ( ) ;
locator < GAnalytics > ( ) . loginRegistration . registration_enter_details ( ) ;
} , textColor: Colors . white , color: isButtonDisabled = = true ? Colors . grey : Color ( 0xff359846 ) ) ) ,
) ,
] ,
) , )
] ,
) , ) ;
) ,
Container (
width: double . maxFinite ,
/ / height: 80.0 ,
color: Colors . white ,
/ / margin: EdgeInsets . only ( bottom: 50.0 ) ,
child: Row (
children: [
Expanded (
child: Padding (
padding: EdgeInsets . all ( 10 ) ,
child: DefaultButton ( TranslationBase . of ( context ) . cancel , ( ) {
Navigator . of ( context ) . pop ( ) ;
locator < GAnalytics > ( ) . loginRegistration . registration_cancel ( step: ' enter details ' ) ;
} , textColor: Colors . white , color: Color ( 0xffD02127 ) ) ) ,
) ,
Expanded (
child: Padding (
padding: EdgeInsets . all ( 10 ) ,
child: DefaultButton ( TranslationBase . of ( context ) . next , ( ) {
startRegistration ( ) ;
locator < GAnalytics > ( ) . loginRegistration . registration_enter_details ( ) ;
} , textColor: Colors . white , color: isButtonDisabled = = true ? Colors . grey : Color ( 0xff359846 ) ) ) ,
) ,
] ,
) ,
)
] ,
) ,
) ;
}
Future < Null > _selectDate ( BuildContext context ) async {