Merge branch 'Haroon' into 'master'
Haroon See merge request Cloud_Solution/diplomatic-quarter!139merge-update-with-lab-changes
commit
4b435199fc
@ -0,0 +1,76 @@
|
|||||||
|
class GetAllProjectsResponseModel {
|
||||||
|
String desciption;
|
||||||
|
Null desciptionN;
|
||||||
|
int iD;
|
||||||
|
String legalName;
|
||||||
|
String legalNameN;
|
||||||
|
String name;
|
||||||
|
Null nameN;
|
||||||
|
String phoneNumber;
|
||||||
|
String setupID;
|
||||||
|
int distanceInKilometers;
|
||||||
|
bool isActive;
|
||||||
|
String latitude;
|
||||||
|
String longitude;
|
||||||
|
int mainProjectID;
|
||||||
|
Null projectOutSA;
|
||||||
|
bool usingInDoctorApp;
|
||||||
|
|
||||||
|
GetAllProjectsResponseModel(
|
||||||
|
{this.desciption,
|
||||||
|
this.desciptionN,
|
||||||
|
this.iD,
|
||||||
|
this.legalName,
|
||||||
|
this.legalNameN,
|
||||||
|
this.name,
|
||||||
|
this.nameN,
|
||||||
|
this.phoneNumber,
|
||||||
|
this.setupID,
|
||||||
|
this.distanceInKilometers,
|
||||||
|
this.isActive,
|
||||||
|
this.latitude,
|
||||||
|
this.longitude,
|
||||||
|
this.mainProjectID,
|
||||||
|
this.projectOutSA,
|
||||||
|
this.usingInDoctorApp});
|
||||||
|
|
||||||
|
GetAllProjectsResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
desciption = json['Desciption'];
|
||||||
|
desciptionN = json['DesciptionN'];
|
||||||
|
iD = json['ID'];
|
||||||
|
legalName = json['LegalName'];
|
||||||
|
legalNameN = json['LegalNameN'];
|
||||||
|
name = json['Name'];
|
||||||
|
nameN = json['NameN'];
|
||||||
|
phoneNumber = json['PhoneNumber'];
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
distanceInKilometers = json['DistanceInKilometers'];
|
||||||
|
isActive = json['IsActive'];
|
||||||
|
latitude = json['Latitude'];
|
||||||
|
longitude = json['Longitude'];
|
||||||
|
mainProjectID = json['MainProjectID'];
|
||||||
|
projectOutSA = json['ProjectOutSA'];
|
||||||
|
usingInDoctorApp = json['UsingInDoctorApp'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['Desciption'] = this.desciption;
|
||||||
|
data['DesciptionN'] = this.desciptionN;
|
||||||
|
data['ID'] = this.iD;
|
||||||
|
data['LegalName'] = this.legalName;
|
||||||
|
data['LegalNameN'] = this.legalNameN;
|
||||||
|
data['Name'] = this.name;
|
||||||
|
data['NameN'] = this.nameN;
|
||||||
|
data['PhoneNumber'] = this.phoneNumber;
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['DistanceInKilometers'] = this.distanceInKilometers;
|
||||||
|
data['IsActive'] = this.isActive;
|
||||||
|
data['Latitude'] = this.latitude;
|
||||||
|
data['Longitude'] = this.longitude;
|
||||||
|
data['MainProjectID'] = this.mainProjectID;
|
||||||
|
data['ProjectOutSA'] = this.projectOutSA;
|
||||||
|
data['UsingInDoctorApp'] = this.usingInDoctorApp;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,129 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SelectHospitalDialog extends StatefulWidget {
|
||||||
|
|
||||||
|
final List<GetAllProjectsResponseModel> hospitals;
|
||||||
|
final Function(GetAllProjectsResponseModel) onValueSelected;
|
||||||
|
GetAllProjectsResponseModel selectedHospital;
|
||||||
|
|
||||||
|
SelectHospitalDialog(
|
||||||
|
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_SelectHospitalDialogState createState() => _SelectHospitalDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SimpleDialog(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Divider(),
|
||||||
|
...List.generate(
|
||||||
|
widget.hospitals.length,
|
||||||
|
(index) => Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 2,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
widget.selectedHospital = widget.hospitals[index];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: ListTile(
|
||||||
|
title: Text(widget.hospitals[index].desciption),
|
||||||
|
leading: Radio(
|
||||||
|
value: widget.hospitals[index],
|
||||||
|
groupValue: widget.selectedHospital,
|
||||||
|
activeColor: Colors.red[800],
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
widget.selectedHospital = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5.0,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5.0,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
TranslationBase.of(context).cancel.toUpperCase(),
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 1,
|
||||||
|
height: 30,
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
widget.onValueSelected(widget.selectedHospital);
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
TranslationBase.of(context).ok,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,109 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
class AppUpdatePage extends StatefulWidget {
|
||||||
|
String appUpdateText;
|
||||||
|
|
||||||
|
AppUpdatePage({@required this.appUpdateText});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AppUpdatePageState createState() => _AppUpdatePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AppUpdatePageState extends State<AppUpdatePage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: "App Update",
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
isShowAppBar: false,
|
||||||
|
isShowDecPage: false,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
SvgPicture.asset(
|
||||||
|
"assets/images/new-design/update_rocket_image.svg",
|
||||||
|
fit: BoxFit.fill),
|
||||||
|
]),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 40.0),
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: Text(TranslationBase.of(context).appUpdate,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0xff2d6c90).withOpacity(1.0),
|
||||||
|
fontSize: 22.0,
|
||||||
|
fontWeight: FontWeight.bold))),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
|
||||||
|
child: SvgPicture.asset("assets/images/new-design/HMG_logo.svg",
|
||||||
|
fit: BoxFit.fill),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: Text(widget.appUpdateText,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.grey[600],
|
||||||
|
fontSize: 16.0,
|
||||||
|
height: 1.5,
|
||||||
|
fontWeight: FontWeight.bold))),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
|
||||||
|
child: ButtonTheme(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
minWidth: MediaQuery.of(context).size.width,
|
||||||
|
height: 45.0,
|
||||||
|
child: RaisedButton(
|
||||||
|
color: Colors.red[800],
|
||||||
|
textColor: Colors.white,
|
||||||
|
disabledTextColor: Colors.white,
|
||||||
|
disabledColor: new Color(0xFFbcc2c4),
|
||||||
|
onPressed: () {
|
||||||
|
openAppUpdateLink();
|
||||||
|
},
|
||||||
|
child: Text(TranslationBase.of(context).appUpdate,
|
||||||
|
style: TextStyle(fontSize: 18.0)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
openAppUpdateLink() {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
_launchURL("https://play.google.com/store/apps/details?id=com.ejada.hmg");
|
||||||
|
}
|
||||||
|
if (Platform.isIOS) {
|
||||||
|
_launchURL("https://itunes.apple.com/app/id733503978");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_launchURL(String url) async {
|
||||||
|
if (await canLaunch(url)) {
|
||||||
|
await launch(url);
|
||||||
|
} else {
|
||||||
|
throw 'Could not launch $url';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue