|
|
|
@ -1,11 +1,8 @@
|
|
|
|
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
|
|
|
|
import 'package:diplomaticquarterapp/locator.dart';
|
|
|
|
import 'package:diplomaticquarterapp/locator.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
@ -15,9 +12,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'insurance_card_update_details.dart';
|
|
|
|
|
|
|
|
import 'insurance_page.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InsuranceUpdate extends StatefulWidget {
|
|
|
|
class InsuranceUpdate extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_InsuranceUpdateState createState() => _InsuranceUpdateState();
|
|
|
|
_InsuranceUpdateState createState() => _InsuranceUpdateState();
|
|
|
|
@ -26,13 +20,12 @@ class InsuranceUpdate extends StatefulWidget {
|
|
|
|
class _InsuranceUpdateState extends State<InsuranceUpdate>
|
|
|
|
class _InsuranceUpdateState extends State<InsuranceUpdate>
|
|
|
|
with SingleTickerProviderStateMixin {
|
|
|
|
with SingleTickerProviderStateMixin {
|
|
|
|
TabController _tabController;
|
|
|
|
TabController _tabController;
|
|
|
|
List<ImagesInfo> imagesInfo = List();
|
|
|
|
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
_tabController = TabController(length: 2, vsync: this);
|
|
|
|
_tabController = TabController(length: 2, vsync: this);
|
|
|
|
|
|
|
|
|
|
|
|
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/insurance-card/ar/0.png'));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void dispose() {
|
|
|
|
void dispose() {
|
|
|
|
@ -40,17 +33,14 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
|
|
|
|
_tabController.dispose();
|
|
|
|
_tabController.dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO implement update card
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BaseView<InsuranceViewModel>(
|
|
|
|
return BaseView<InsuranceViewModel>(
|
|
|
|
onModelReady: (model) => model.getInsuranceUpdated(),
|
|
|
|
onModelReady: (model) => model.getInsuranceUpdated(),
|
|
|
|
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
|
|
|
|
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
|
|
|
|
AppScaffold(
|
|
|
|
AppScaffold(
|
|
|
|
appBarTitle: TranslationBase.of(context).insurCards,
|
|
|
|
appBarTitle: TranslationBase.of(context).insurCards,
|
|
|
|
description: TranslationBase.of(context).infoInsurCards,
|
|
|
|
|
|
|
|
infoList: TranslationBase.of(context).infoPrescriptionsPoints,
|
|
|
|
|
|
|
|
imagesInfo: imagesInfo,
|
|
|
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowDecPage: true,
|
|
|
|
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
body: Scaffold(
|
|
|
|
body: Scaffold(
|
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
@ -111,7 +101,196 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
controller: _tabController,
|
|
|
|
controller: _tabController,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
InsurancePage(model:model),
|
|
|
|
Container(
|
|
|
|
|
|
|
|
child: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.isNotEmpty
|
|
|
|
|
|
|
|
? ListView.builder(
|
|
|
|
|
|
|
|
itemCount: model.getAllSharedRecordsByStatusResponse
|
|
|
|
|
|
|
|
.getAllSharedRecordsByStatusList.length,
|
|
|
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
|
|
|
return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
|
|
|
|
|
|
|
|
? Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.all(10.0),
|
|
|
|
|
|
|
|
child: Card(
|
|
|
|
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
|
|
|
|
8.0, 16.0, 8.0, 8.0),
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
|
|
|
borderRadius:
|
|
|
|
|
|
|
|
BorderRadius.circular(10),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
width:
|
|
|
|
|
|
|
|
MediaQuery.of(context).size.width,
|
|
|
|
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
flex: 3,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 2.0,
|
|
|
|
|
|
|
|
left: 10.0,
|
|
|
|
|
|
|
|
right: 20.0),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.getAllSharedRecordsByStatusResponse
|
|
|
|
|
|
|
|
.getAllSharedRecordsByStatusList[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.patientName,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w500,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.fileno +
|
|
|
|
|
|
|
|
": " +
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.getAllSharedRecordsByStatusResponse
|
|
|
|
|
|
|
|
.getAllSharedRecordsByStatusList[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.patientID
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w500,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (false)
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
flex: 2,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(top: 2.0),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
|
|
|
label: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.fetchData,
|
|
|
|
|
|
|
|
small: true,
|
|
|
|
|
|
|
|
textColor:
|
|
|
|
|
|
|
|
Colors.white,
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
getDetails(
|
|
|
|
|
|
|
|
model);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: Container();
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
: Container(
|
|
|
|
|
|
|
|
height: 80,
|
|
|
|
|
|
|
|
margin: EdgeInsets.all(10.0),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
SizedBox(height: 65,),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
flex: 3,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 2.0,
|
|
|
|
|
|
|
|
left: 10.0,
|
|
|
|
|
|
|
|
right: 20.0),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
model.user.firstName+" "+model.user.lastName,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w500,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 8,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.fileno +
|
|
|
|
|
|
|
|
": " +
|
|
|
|
|
|
|
|
model.user.patientID.toString(),
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w500,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (false)
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
flex: 2,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(top: 2.0),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
|
|
|
label: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.fetchData,
|
|
|
|
|
|
|
|
small: true,
|
|
|
|
|
|
|
|
textColor:
|
|
|
|
|
|
|
|
Colors.white,
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
getDetails(
|
|
|
|
|
|
|
|
model);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: ListView.builder(
|
|
|
|
child: ListView.builder(
|
|
|
|
itemCount: model.insuranceUpdate == null
|
|
|
|
itemCount: model.insuranceUpdate == null
|
|
|
|
@ -228,5 +407,12 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getDetails(data) {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
_insuranceCardService.getInsuranceDetails(data).then((value) => {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
|
|
|
FadePage(page: InsuranceCardDetails(data: value[0]['CheckList'])))
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|