|
|
|
|
@ -6,12 +6,15 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCe
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
import 'package:maps_launcher/maps_launcher.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
@ -34,6 +37,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
List<ImagesInfo> imagesInfo = List();
|
|
|
|
|
|
|
|
|
|
DriveThroughTestingCenterModel selectedProject;
|
|
|
|
|
final GlobalKey locationDropdownKey = GlobalKey();
|
|
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
@ -61,167 +65,187 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
imagesInfo: imagesInfo,
|
|
|
|
|
description: TranslationBase.of(context).covidInfo,
|
|
|
|
|
isShowDecPage: true,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
|
|
|
|
|
child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 22.0, color: Colors.black)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 16.0, color: Colors.black)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 20.0),
|
|
|
|
|
alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
|
|
|
|
|
child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.grey[700])),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 60.0,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.grey[400],
|
|
|
|
|
width: 1.0,
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
margin: EdgeInsets.only(top: 15.0),
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
child: DropdownButton<DriveThroughTestingCenterModel>(
|
|
|
|
|
hint: new Text(TranslationBase.of(context).selectAddress),
|
|
|
|
|
value: selectedProject,
|
|
|
|
|
items: projectsList.map((DriveThroughTestingCenterModel item) {
|
|
|
|
|
return new DropdownMenuItem<DriveThroughTestingCenterModel>(
|
|
|
|
|
value: item,
|
|
|
|
|
child: new Text(item.projectName),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
onChanged: (newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedProject = newValue;
|
|
|
|
|
setProjectLocation(newValue);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
isLocationSelected
|
|
|
|
|
? Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 15.0),
|
|
|
|
|
alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
|
|
|
|
|
child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.black)),
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
isLocationSelected
|
|
|
|
|
? Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(color: Colors.grey[400], width: 1.0),
|
|
|
|
|
),
|
|
|
|
|
child: Image.network("https://maps.googleapis.com/maps/api/staticmap?center=" +
|
|
|
|
|
this.projectLat +
|
|
|
|
|
"," +
|
|
|
|
|
this.projectLong +
|
|
|
|
|
"&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" +
|
|
|
|
|
this.projectLat +
|
|
|
|
|
"," +
|
|
|
|
|
this.projectLong +
|
|
|
|
|
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.35,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.15,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
backgroundColor: CustomColors.appBackgroudGreyColor,
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: ButtonTheme(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
minWidth: MediaQuery.of(context).size.width * 0.91,
|
|
|
|
|
height: 45.0,
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
color: new Color(0xFFc5272d),
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
disabledTextColor: Colors.white,
|
|
|
|
|
disabledColor: Colors.red[300],
|
|
|
|
|
onPressed: () {
|
|
|
|
|
getDirections();
|
|
|
|
|
},
|
|
|
|
|
child: Text(TranslationBase.of(context).getDirections, style: TextStyle(fontSize: 18.0)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
|
|
|
|
|
child: Flex(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
|
|
|
|
|
child: ButtonTheme(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
minWidth: MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
height: 45.0,
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
color: new Color(0xFF60686b),
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
disabledTextColor: Colors.white,
|
|
|
|
|
disabledColor: Colors.grey[500],
|
|
|
|
|
onPressed: () {
|
|
|
|
|
back();
|
|
|
|
|
},
|
|
|
|
|
child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 18.0)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 14, right: 14),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
|
|
|
|
|
child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, color: Colors.black, letterSpacing: -1.14)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 6.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 14.0, color: Colors.black, letterSpacing: -0.56)),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
// dropdownKey.currentState;
|
|
|
|
|
// openDropdown(clinicDropdownKey);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
|
|
|
|
|
child: ButtonTheme(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
minWidth: MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
height: 45.0,
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
color: new Color(0xFF60686b),
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
disabledTextColor: Colors.white,
|
|
|
|
|
disabledColor: Colors.grey[500],
|
|
|
|
|
onPressed: () {
|
|
|
|
|
next();
|
|
|
|
|
},
|
|
|
|
|
child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
|
|
|
|
|
),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
|
margin: EdgeInsets.only(top: 12),
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Flexible(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).selectLocation,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 11,
|
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 18,
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
child: DropdownButton<DriveThroughTestingCenterModel>(
|
|
|
|
|
onTap: () {
|
|
|
|
|
print("Clicked");
|
|
|
|
|
},
|
|
|
|
|
key: locationDropdownKey,
|
|
|
|
|
hint: new Text(
|
|
|
|
|
TranslationBase.of(context).selectAddress,
|
|
|
|
|
),
|
|
|
|
|
value: selectedProject,
|
|
|
|
|
iconSize: 0,
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
|
|
|
|
|
items: projectsList.map((DriveThroughTestingCenterModel item) {
|
|
|
|
|
return new DropdownMenuItem<DriveThroughTestingCenterModel>(
|
|
|
|
|
value: item,
|
|
|
|
|
child: new Text(item.projectName),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
onChanged: (newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedProject = newValue;
|
|
|
|
|
setProjectLocation(newValue);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Icon(Icons.keyboard_arrow_down),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
mHeight(20),
|
|
|
|
|
isLocationSelected
|
|
|
|
|
? Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
|
|
|
child: Image.network("https://maps.googleapis.com/maps/api/staticmap?center=" +
|
|
|
|
|
this.projectLat +
|
|
|
|
|
"," +
|
|
|
|
|
this.projectLong +
|
|
|
|
|
"&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" +
|
|
|
|
|
this.projectLat +
|
|
|
|
|
"," +
|
|
|
|
|
this.projectLong +
|
|
|
|
|
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
getDirections();
|
|
|
|
|
},
|
|
|
|
|
child: Card(
|
|
|
|
|
shape: cardRadius(1000),
|
|
|
|
|
elevation: 4,
|
|
|
|
|
margin: EdgeInsets.all(12),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
"assets/images/new/blood_pressure.svg",
|
|
|
|
|
width: 18,
|
|
|
|
|
height: 18,
|
|
|
|
|
),
|
|
|
|
|
mWidth(6),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).getDirections,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 11,
|
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.35,
|
|
|
|
|
),
|
|
|
|
|
mHeight(12),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
|
|
|
|
|
child: ButtonTheme(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
minWidth: MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
height: 45.0,
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
disabledTextColor: Colors.white,
|
|
|
|
|
disabledColor: CustomColors.accentColor,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
next();
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).next,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|