Merge branch 'development_new_design_2.0' into mirza_home_page
commit
f56ae8ff5b
@ -1,139 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class SelectSearchCriteriaDialog extends StatefulWidget {
|
||||
List<SearchCriteriaModel> searchCriteria = [
|
||||
SearchCriteriaModel(name: "Identification Number",nameAr:"رقم الهوية",value: 1),
|
||||
SearchCriteriaModel(name: "Referral Number",nameAr:"رقم الإحالة",value: 2),
|
||||
];
|
||||
final Function(SearchCriteriaModel) onValueSelected;
|
||||
SearchCriteriaModel selectedCriteria;
|
||||
ProjectViewModel projectViewModel;
|
||||
|
||||
SelectSearchCriteriaDialog(
|
||||
{Key key, this.onValueSelected, this.selectedCriteria, this.projectViewModel});
|
||||
|
||||
@override
|
||||
_SelectSearchCriteriaDialogState createState() => _SelectSearchCriteriaDialogState();
|
||||
}
|
||||
|
||||
class _SelectSearchCriteriaDialogState extends State<SelectSearchCriteriaDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedCriteria = widget.selectedCriteria ?? widget.searchCriteria[0];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Text(TranslationBase.of(context).searchCriteria),
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.searchCriteria.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedCriteria = widget.searchCriteria[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(widget.projectViewModel.isArabic ? widget.searchCriteria[index].nameAr : widget.searchCriteria[index].name),
|
||||
leading: Radio(
|
||||
value: widget.searchCriteria[index],
|
||||
groupValue: widget.selectedCriteria,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedCriteria = 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.selectedCriteria);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,328 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class SelectBloodDialog extends StatefulWidget {
|
||||
|
||||
final Blood bloodType;
|
||||
final Function(Blood) onValueSelected;
|
||||
|
||||
SelectBloodDialog({Key key, this.bloodType, this.onValueSelected});
|
||||
|
||||
|
||||
|
||||
@override
|
||||
_SelectBloodDialogState createState() => _SelectBloodDialogState(this.bloodType);
|
||||
}
|
||||
|
||||
class _SelectBloodDialogState extends State<SelectBloodDialog> {
|
||||
_SelectBloodDialogState(this.bloodType);
|
||||
Blood bloodType;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Divider(),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bloodType = Blood.Oplus;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text("O+"),
|
||||
leading: Radio(
|
||||
value: Blood.Oplus,
|
||||
groupValue: bloodType,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (Blood value) {
|
||||
setState(() {
|
||||
bloodType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bloodType = Blood.Ominus;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text("O-"),
|
||||
leading: Radio(
|
||||
value: Blood.Ominus,
|
||||
groupValue: bloodType,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (Blood value) {
|
||||
setState(() {
|
||||
bloodType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bloodType = Blood.ABminus;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text("AB-"),
|
||||
leading: Radio(
|
||||
value: Blood.ABminus,
|
||||
groupValue: bloodType,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (Blood value) {
|
||||
setState(() {
|
||||
bloodType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bloodType = Blood.ABplus;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text("AB+"),
|
||||
leading: Radio(
|
||||
value: Blood.ABplus,
|
||||
groupValue: bloodType,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (Blood value) {
|
||||
setState(() {
|
||||
bloodType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bloodType = Blood.Aplus;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text("A+"),
|
||||
leading: Radio(
|
||||
value: Blood.Aplus,
|
||||
groupValue: bloodType,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (Blood value) {
|
||||
setState(() {
|
||||
bloodType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bloodType = Blood.Aminus;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text("A-"),
|
||||
leading: Radio(
|
||||
value: Blood.Aminus,
|
||||
groupValue: bloodType,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (Blood value) {
|
||||
setState(() {
|
||||
bloodType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bloodType = Blood.Bplus;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text("B+"),
|
||||
leading: Radio(
|
||||
value: Blood.Bplus,
|
||||
groupValue: bloodType,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (Blood value) {
|
||||
setState(() {
|
||||
bloodType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bloodType = Blood.Bminus;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text("B-"),
|
||||
leading: Radio(
|
||||
value: Blood.Bminus,
|
||||
groupValue: bloodType,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (Blood value) {
|
||||
setState(() {
|
||||
bloodType = 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(bloodType);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,204 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../Constants.dart';
|
||||
import '../advance_payment_page.dart';
|
||||
|
||||
class SelectBeneficiaryDialog extends StatefulWidget {
|
||||
final BeneficiaryType beneficiaryType;
|
||||
final Function(BeneficiaryType) onValueSelected;
|
||||
|
||||
SelectBeneficiaryDialog({Key key, this.beneficiaryType, this.onValueSelected});
|
||||
|
||||
@override
|
||||
_SelectBeneficiaryDialogState createState() => _SelectBeneficiaryDialogState(this.beneficiaryType);
|
||||
}
|
||||
|
||||
class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
|
||||
_SelectBeneficiaryDialogState(this.beneficiaryType);
|
||||
|
||||
BeneficiaryType beneficiaryType;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Divider(),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
beneficiaryType = BeneficiaryType.MyAccount;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
TranslationBase.of(context).myAccount,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
leading: Radio(
|
||||
value: BeneficiaryType.MyAccount,
|
||||
groupValue: beneficiaryType,
|
||||
activeColor: secondaryColor,
|
||||
onChanged: (BeneficiaryType value) {
|
||||
setState(() {
|
||||
beneficiaryType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
beneficiaryType = BeneficiaryType.MyFamilyFiles;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
TranslationBase.of(context).myFamilyFiles,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
leading: Radio(
|
||||
value: BeneficiaryType.MyFamilyFiles,
|
||||
groupValue: beneficiaryType,
|
||||
activeColor: Color(0xffC5272D),
|
||||
onChanged: (BeneficiaryType value) {
|
||||
setState(() {
|
||||
beneficiaryType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
beneficiaryType = BeneficiaryType.OtherAccount;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
TranslationBase.of(context).otherAccount,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
leading: Radio(
|
||||
value: BeneficiaryType.OtherAccount,
|
||||
groupValue: beneficiaryType,
|
||||
activeColor: Color(0xffC5272D),
|
||||
onChanged: (BeneficiaryType value) {
|
||||
setState(() {
|
||||
beneficiaryType = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
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: Text(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
color: Color(0xffC5272D),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
widget.onValueSelected(beneficiaryType);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
TranslationBase.of(context).ok.toUpperCase(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,145 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../Constants.dart';
|
||||
|
||||
class SelectHospitalDialog extends StatefulWidget {
|
||||
final List<HospitalsModel> hospitals;
|
||||
final Function(HospitalsModel) onValueSelected;
|
||||
HospitalsModel 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].name + ' ${widget.hospitals[index].distanceInKilometers} ' + TranslationBase.of(context).km,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
leading: Radio(
|
||||
value: widget.hospitals[index],
|
||||
groupValue: widget.selectedHospital,
|
||||
activeColor: secondaryColor,
|
||||
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: Text(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
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: Text(
|
||||
TranslationBase.of(context).ok,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,152 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../Constants.dart';
|
||||
|
||||
class SelectPatientFamilyDialog extends StatefulWidget {
|
||||
final List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList;
|
||||
final Function(GetAllSharedRecordsByStatusList) onValueSelected;
|
||||
GetAllSharedRecordsByStatusList selectedPatientFamily;
|
||||
|
||||
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusApprovedList = new List();
|
||||
|
||||
SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected, this.selectedPatientFamily});
|
||||
|
||||
@override
|
||||
_SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState();
|
||||
}
|
||||
|
||||
class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedPatientFamily = widget.selectedPatientFamily ?? widget.getAllSharedRecordsByStatusList[0];
|
||||
|
||||
if (widget.getAllSharedRecordsByStatusList.isNotEmpty)
|
||||
widget.getAllSharedRecordsByStatusList.forEach((element) {
|
||||
if (element.status == 3) widget.getAllSharedRecordsByStatusApprovedList.add(element);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.getAllSharedRecordsByStatusApprovedList.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedPatientFamily = widget.getAllSharedRecordsByStatusApprovedList[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
widget.getAllSharedRecordsByStatusApprovedList[index].patientName,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
leading: Radio(
|
||||
value: widget.getAllSharedRecordsByStatusApprovedList[index],
|
||||
groupValue: widget.selectedPatientFamily,
|
||||
activeColor: secondaryColor,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedPatientFamily = 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: Text(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
widget.onValueSelected(widget.selectedPatientFamily);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
TranslationBase.of(context).ok,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,146 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../Constants.dart';
|
||||
|
||||
class SelectPatientInfoDialog extends StatefulWidget {
|
||||
final List<PatientInfo> patientInfoList;
|
||||
|
||||
final Function(PatientInfo) onValueSelected;
|
||||
PatientInfo selectedPatientInfo;
|
||||
|
||||
SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected, this.selectedPatientInfo});
|
||||
|
||||
@override
|
||||
_SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState();
|
||||
}
|
||||
|
||||
class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedPatientInfo = widget.selectedPatientInfo ?? widget.patientInfoList[0];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.patientInfoList.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedPatientInfo = widget.patientInfoList[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
widget.patientInfoList[index].fullName,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
leading: Radio(
|
||||
value: widget.patientInfoList[index],
|
||||
groupValue: widget.selectedPatientInfo,
|
||||
activeColor: secondaryColor,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedPatientInfo = 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: Text(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
widget.onValueSelected(widget.selectedPatientInfo);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
TranslationBase.of(context).ok.toUpperCase(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.46,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,139 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class RadioStringDialog extends StatefulWidget {
|
||||
final List<String> radioList;
|
||||
final Function(String) onValueSelected;
|
||||
final String title;
|
||||
String selectedValue;
|
||||
|
||||
RadioStringDialog({Key key, this.radioList, this.onValueSelected, this.selectedValue, this.title});
|
||||
|
||||
@override
|
||||
_RadioStringDialogState createState() => _RadioStringDialogState();
|
||||
}
|
||||
|
||||
class _RadioStringDialogState extends State<RadioStringDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedValue = widget.selectedValue ?? widget.radioList[0];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
widget.title,
|
||||
textAlign: TextAlign.center,
|
||||
))),
|
||||
children: [
|
||||
Container(
|
||||
height: widget.radioList.length > 3 ? MediaQuery.of(context).size.height * 0.6 : null,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.radioList.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// SizedBox(
|
||||
// height: 2,
|
||||
// ),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedValue = widget.radioList[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Texts(
|
||||
widget.radioList[index],
|
||||
fontSize: 14,
|
||||
),
|
||||
leading: Radio(
|
||||
value: widget.radioList[index],
|
||||
groupValue: widget.selectedValue,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedValue = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
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.selectedValue);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue