@ -1,5 +1,6 @@
import ' dart:convert ' ;
import ' package:diplomaticquarterapp/core/viewModels/project_view_model.dart ' ;
import ' package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart ' ;
import ' package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart ' ;
import ' package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart ' ;
@ -12,6 +13,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:flutter/cupertino.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:provider/provider.dart ' ;
import ' covid-payment-details.dart ' ;
@ -27,6 +29,7 @@ class CovidDirveThruQuestions extends StatefulWidget {
class CovidDirveThruQuestionsState extends State < CovidDirveThruQuestions > {
List qa ;
ProjectViewModel projectViewModel ;
@ override
void initState ( ) {
@ -34,12 +37,10 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
qa = getQuestionsFromJson ( ) ;
}
TranslationBase localize ;
@ override
Widget build ( BuildContext context ) {
localize = TranslationBase . of ( context ) ;
var isArabic = localize. isArabic ( ) ;
projectViewModel = Provider . of ( context ) ;
var isArabic = projectViewModel. isArabic ;
return AppScaffold (
appBarTitle: TranslationBase . of ( context ) . covidTest ,
isShowAppBar: true ,
@ -48,9 +49,26 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
body: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Container (
width: MediaQuery . of ( context ) . size . width * 0.9 ,
decoration: BoxDecoration (
color: Colors . white ,
borderRadius: BorderRadius . circular ( 15.0 ) ,
) ,
margin: EdgeInsets . fromLTRB ( 18.0 , 10.0 , 18.0 , 10.0 ) ,
padding: EdgeInsets . fromLTRB ( 8.0 , 10.0 , 8.0 , 10.0 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text ( TranslationBase . of ( context ) . covidBookAppo , style: TextStyle ( fontSize: 18 , letterSpacing: 1 , fontWeight: FontWeight . bold ) ) ,
Text ( TranslationBase . of ( context ) . patientName . toString ( ) + " : " + projectViewModel . user . firstName + " " + projectViewModel . user . lastName , style: TextStyle ( fontSize: 14 , letterSpacing: 1 ) ) ,
Text ( TranslationBase . of ( context ) . fileNo . toString ( ) + " : " + projectViewModel . user . patientID . toString ( ) , style: TextStyle ( fontSize: 14 , letterSpacing: 1 ) ) ,
] ,
) ,
) ,
Padding (
padding: const EdgeInsets . fromLTRB ( 20.0 , 10.0 , 20.0 , 10.0 ) ,
child: Text ( localize . covidQuestionnaire , style: TextStyle ( fontSize: 17 , letterSpacing: 1 , fontWeight: FontWeight . bold ) ) ,
child: Text ( TranslationBase. of ( context ) . covidQuestionnaire , style: TextStyle ( fontSize: 17 , letterSpacing: 1 , fontWeight: FontWeight . bold ) ) ,
) ,
Expanded (
child: ListView . separated (
@ -75,7 +93,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
obj [ " ans " ] = newValue ;
} ) ;
} ) ,
Text ( localize . yes ) ,
Text ( TranslationBase. of ( context ) . yes ) ,
] ,
) ,
Row (
@ -88,7 +106,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
obj [ " ans " ] = newValue ;
} ) ;
} ) ,
Text ( localize . no ) ,
Text ( TranslationBase. of ( context ) . no ) ,
] ,
)
] ,
@ -101,7 +119,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
padding: const EdgeInsets . symmetric ( horizontal: 20 , vertical: 10 ) ,
child: FractionallySizedBox (
widthFactor: 1 ,
child: DefaultButton ( localize . next , ( ) {
child: DefaultButton ( TranslationBase. of ( context ) . next , ( ) {
next ( ) ;
} ) ,
) ,
@ -121,7 +139,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
getPaymentInfo ( context , widget . projectId ) ;
}
else
AppToast . showErrorToast ( message: localize . pleaseSelectAllQuestionToContinue ) ;
AppToast . showErrorToast ( message: TranslationBase. of ( context ) . pleaseSelectAllQuestionToContinue ) ;
}
openPassportUpdatePage ( ) {