|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/login/register.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/login/register-info.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/login/confirm-login.dart';
|
|
|
|
|
|
|
|
class RegisterNew extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
_RegisterNew createState() => _RegisterNew();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _RegisterNew extends State<RegisterNew> {
|
|
|
|
final nationalIDorFile = TextEditingController();
|
|
|
|
final int loginType = LoginType.loginType;
|
|
|
|
String mobileNo;
|
|
|
|
String countryCode = '966';
|
|
|
|
var isHijri;
|
|
|
|
final util = Utils();
|
|
|
|
DateTime selectedDate;
|
|
|
|
String dob;
|
|
|
|
bool isButtonDisabled = true;
|
|
|
|
final authService = new AuthProvider();
|
|
|
|
final sharedPref = new AppSharedPreferences();
|
|
|
|
PageController _controller;
|
|
|
|
bool isLoading;
|
|
|
|
int _currentIndex = 0;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
_controller = new PageController();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
changePageViewIndex(pageIndex) {
|
|
|
|
_controller.jumpToPage(pageIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AppScaffold(
|
|
|
|
appBarTitle: TranslationBase.of(context).register,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowDecPage: false,
|
|
|
|
showNewAppBar: true,
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
height: SizeConfig.realScreenHeight * .9,
|
|
|
|
width: SizeConfig.realScreenWidth,
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.only(left: 20, right: 20, top: 12),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: showProgress(
|
|
|
|
title: TranslationBase.of(context).enterDetails,
|
|
|
|
status: _currentIndex == 0
|
|
|
|
? TranslationBase.of(context).inPrgress
|
|
|
|
: _currentIndex > 0
|
|
|
|
? TranslationBase.of(context).completed
|
|
|
|
: TranslationBase.of(context).locked,
|
|
|
|
color: _currentIndex == 0 ? CustomColors.orange : CustomColors.green,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: showProgress(
|
|
|
|
title: TranslationBase.of(context).patientInfo,
|
|
|
|
status: _currentIndex == 1
|
|
|
|
? TranslationBase.of(context).inPrgress
|
|
|
|
: _currentIndex > 1
|
|
|
|
? TranslationBase.of(context).completed
|
|
|
|
: TranslationBase.of(context).locked,
|
|
|
|
color: _currentIndex == 1
|
|
|
|
? CustomColors.orange
|
|
|
|
: _currentIndex > 1
|
|
|
|
? CustomColors.green
|
|
|
|
: CustomColors.grey2,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
showProgress(
|
|
|
|
title: TranslationBase.of(context).otherInfo,
|
|
|
|
status: _currentIndex == 2 ? TranslationBase.of(context).inPrgress : TranslationBase.of(context).locked,
|
|
|
|
color: _currentIndex == 2
|
|
|
|
? CustomColors.orange
|
|
|
|
: _currentIndex > 3
|
|
|
|
? CustomColors.green
|
|
|
|
: CustomColors.grey2,
|
|
|
|
isNeedBorder: false,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: PageView(
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
controller: _controller,
|
|
|
|
onPageChanged: (index) {
|
|
|
|
setState(() {
|
|
|
|
_currentIndex = index;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
children: <Widget>[
|
|
|
|
Register(
|
|
|
|
changePageViewIndex: changePageViewIndex,
|
|
|
|
),
|
|
|
|
|
|
|
|
RegisterInfo(
|
|
|
|
changePageViewIndex: changePageViewIndex,
|
|
|
|
),
|
|
|
|
RegisterInfo(changePageViewIndex: changePageViewIndex, page: 2),
|
|
|
|
// NewEReferralStepOnePage(
|
|
|
|
// changePageViewIndex: changePageViewIndex,
|
|
|
|
// createEReferralRequestModel: createEReferralRequestModel,
|
|
|
|
// ),
|
|
|
|
// NewEReferralStepTowPage(
|
|
|
|
// changePageViewIndex: changePageViewIndex,
|
|
|
|
// createEReferralRequestModel: createEReferralRequestModel,
|
|
|
|
// ),
|
|
|
|
// NewEReferralStepThreePage(
|
|
|
|
// changePageViewIndex: changePageViewIndex,
|
|
|
|
// createEReferralRequestModel: createEReferralRequestModel,
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
)),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) {
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: 26,
|
|
|
|
height: 26,
|
|
|
|
decoration: containerRadius(color, 200),
|
|
|
|
child: Icon(
|
|
|
|
Icons.done,
|
|
|
|
color: Colors.white,
|
|
|
|
size: 16,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (isNeedBorder)
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: mDivider(Colors.grey),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
mHeight(8),
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 11,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
mHeight(2),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
decoration: containerRadius(color.withOpacity(0.2), 4),
|
|
|
|
child: Text(
|
|
|
|
status,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 8,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
letterSpacing: -0.32,
|
|
|
|
color: color,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|