|
|
|
@ -20,18 +20,23 @@ import '../base/base_view.dart';
|
|
|
|
|
class InsuranceCard extends StatefulWidget {
|
|
|
|
|
int appointmentNo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InsuranceCard({this.appointmentNo});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_InsuranceCardState createState() => _InsuranceCardState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _InsuranceCardState extends State<InsuranceCard> {
|
|
|
|
|
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
|
|
|
|
|
List<ImagesInfo> imagesInfo = List();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png'));
|
|
|
|
|
imagesInfo.add(ImagesInfo(
|
|
|
|
|
imageEn:
|
|
|
|
|
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',
|
|
|
|
|
imageAr:
|
|
|
|
|
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png'));
|
|
|
|
|
|
|
|
|
|
return BaseView<InsuranceViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getInsurance(),
|
|
|
|
@ -79,16 +84,16 @@ class _InsuranceCardState extends State<InsuranceCard> {
|
|
|
|
|
padding: EdgeInsets.all(14),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
border: Border.all(color: Colors.grey,width: 0.2),
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(2)),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.white70,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.grey, width: 0.2),
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(2)),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.white70,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
@ -103,28 +108,34 @@ class _InsuranceCardState extends State<InsuranceCard> {
|
|
|
|
|
thickness: 0.5,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.stretch,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).category +
|
|
|
|
|
model.insurance[index].subCategoryDesc,
|
|
|
|
|
model.insurance[index]
|
|
|
|
|
.subCategoryDesc,
|
|
|
|
|
style: TextStyle(fontSize: 18.5),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).expirationDate +
|
|
|
|
|
convertDateFormat(
|
|
|
|
|
model.insurance[index].cardValidTo),
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.expirationDate +
|
|
|
|
|
convertDateFormat(model
|
|
|
|
|
.insurance[index].cardValidTo),
|
|
|
|
|
style: TextStyle(fontSize: 18.5),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).patientCard +
|
|
|
|
|
model.insurance[index].patientCardID,
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.patientCard +
|
|
|
|
|
model
|
|
|
|
|
.insurance[index].patientCardID,
|
|
|
|
|
style: TextStyle(fontSize: 18.5),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).policyNumber +
|
|
|
|
|
model
|
|
|
|
|
.insurance[index].insurancePolicyNumber,
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.policyNumber +
|
|
|
|
|
model.insurance[index]
|
|
|
|
|
.insurancePolicyNumber,
|
|
|
|
|
style: TextStyle(fontSize: 18.5),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -132,16 +143,18 @@ class _InsuranceCardState extends State<InsuranceCard> {
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
model.insurance[index].isActive == true
|
|
|
|
|
? Text('Active',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
? Texts(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.activeInsurence,
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
fontSize: 17.9))
|
|
|
|
|
: Text('Not Active',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 17.9)
|
|
|
|
|
: Texts(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.notActive,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
fontSize: 17.9))
|
|
|
|
|
fontSize: 17.9)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
@ -151,7 +164,9 @@ class _InsuranceCardState extends State<InsuranceCard> {
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.transparent,
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
onTap:()=>{ getDetails(model.insurance[index])},
|
|
|
|
|
onTap: () => {
|
|
|
|
|
getDetails(model.insurance[index])
|
|
|
|
|
},
|
|
|
|
|
label: TranslationBase.of(context).seeDetails,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
),
|
|
|
|
@ -160,8 +175,6 @@ class _InsuranceCardState extends State<InsuranceCard> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -191,13 +204,13 @@ class _InsuranceCardState extends State<InsuranceCard> {
|
|
|
|
|
|
|
|
|
|
return newDate.toString();
|
|
|
|
|
}
|
|
|
|
|
getDetails(data){
|
|
|
|
|
|
|
|
|
|
getDetails(data) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
_insuranceCardService.getInsuranceDetails(data).then((value) => {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
FadePage(page: InsuranceCardDetails(data:value[0]['CheckList'])))
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
FadePage(page: InsuranceCardDetails(data: value[0]['CheckList'])))
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|