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.
121 lines
3.6 KiB
Dart
121 lines
3.6 KiB
Dart
import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart';
|
|
import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart';
|
|
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'EdOnlineAgreementPage.dart';
|
|
import 'EdOnlineNotesPage.dart';
|
|
import 'EdOnlineQuestionsPage.dart';
|
|
import 'EdOnlineSelectedHospitalPage.dart';
|
|
import 'EdPaymentInformationPage.dart';
|
|
import 'ConfirmExitPageDialog.dart';
|
|
|
|
class DdServicesPage extends StatefulWidget {
|
|
@override
|
|
_DdServicesPageState createState() => _DdServicesPageState();
|
|
}
|
|
|
|
class _DdServicesPageState extends State<DdServicesPage> {
|
|
PageController pageController;
|
|
|
|
bool isAgree = false;
|
|
TriageInformationRequest triageInformationRequest = new TriageInformationRequest();
|
|
|
|
List<TriageQuestionsModel> selectedQuestions = List();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
pageController = new PageController();
|
|
|
|
}
|
|
|
|
_changePageViewIndex(int tab) {
|
|
setState(() {
|
|
pageController.jumpToPage(tab);
|
|
pageController.animateToPage(tab,
|
|
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
|
|
});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
elevation: 0,
|
|
textTheme: TextTheme(
|
|
headline6: TextStyle(
|
|
color: Theme.of(context).textTheme.headline1.color,
|
|
fontWeight: FontWeight.bold),
|
|
),
|
|
title: Text(
|
|
'ED Online',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
color: Theme.of(context).textTheme.headline1.color,
|
|
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
|
|
// bold: true,
|
|
// color: Colors.white,
|
|
),
|
|
leading: Builder(
|
|
builder: (BuildContext context) {
|
|
return IconButton(
|
|
icon: Icon(Icons.arrow_back),
|
|
color: Theme.of(context).textTheme.headline1.color,
|
|
onPressed: () {
|
|
showConfirmMessage(context);
|
|
},
|
|
);
|
|
},
|
|
),
|
|
centerTitle: true,
|
|
),
|
|
body: PageView(
|
|
physics: NeverScrollableScrollPhysics(),
|
|
controller: pageController,
|
|
onPageChanged: _changePageViewIndex,
|
|
children: [
|
|
EdOnlineSelectedHospitalPage(
|
|
changePageViewIndex: _changePageViewIndex,
|
|
triageInformationRequest: triageInformationRequest,
|
|
),
|
|
EdOnlineAgreementPage(
|
|
changePageViewIndex: _changePageViewIndex,
|
|
isAgree: isAgree,
|
|
),
|
|
EdOnlineQuestionsPage(
|
|
changePageViewIndex: _changePageViewIndex,
|
|
selectedQuestions: selectedQuestions,
|
|
),
|
|
EdOnlineNotesPage(
|
|
changePageViewIndex: _changePageViewIndex,
|
|
selectedQuestions: selectedQuestions,
|
|
triageInformationRequest: triageInformationRequest,
|
|
),
|
|
EdPaymentInformationPage(selectedHospital: triageInformationRequest.selectedHospital,)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
void showConfirmMessage(
|
|
BuildContext context,
|
|
) {
|
|
showDialog(
|
|
context: context,
|
|
child: ConfirmExitPageDialog(
|
|
onTapYes: () {
|
|
Navigator.pop(context);
|
|
},
|
|
onTapNo: () {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|