|
|
|
|
@ -86,52 +86,23 @@ class _HomePageFragmentState extends State<LoggedHomePageFragment> {
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
FutureBuilder(
|
|
|
|
|
future: getFamilyFiles(), // async work
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
return Padding(padding: EdgeInsets.all(10), child: Text(''));
|
|
|
|
|
default:
|
|
|
|
|
if (snapshot.hasError)
|
|
|
|
|
return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error));
|
|
|
|
|
else {
|
|
|
|
|
List<SliderData> sliderData = [];
|
|
|
|
|
sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + widget.projectViewModel.user.patientID.toString(),
|
|
|
|
|
widget.projectViewModel.user.firstName + ' ' + widget.projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor));
|
|
|
|
|
for (int i = 0; i < snapshot.data.getAllSharedRecordsByStatusList.length; i++) {
|
|
|
|
|
if (snapshot.data.getAllSharedRecordsByStatusList[i].status == 3)
|
|
|
|
|
sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + snapshot.data.getAllSharedRecordsByStatusList[i].responseID.toString(),
|
|
|
|
|
snapshot.data.getAllSharedRecordsByStatusList[i].patientName, "", bannerColor[i + 1].darkColor, bannerColor[i + 1].lightColor));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return AspectRatio(
|
|
|
|
|
aspectRatio: 2,
|
|
|
|
|
child: CarouselSlider(
|
|
|
|
|
options: CarouselOptions(
|
|
|
|
|
autoPlay: false,
|
|
|
|
|
enlargeCenterPage: true,
|
|
|
|
|
initialPage: 0,
|
|
|
|
|
aspectRatio: 2.5,
|
|
|
|
|
viewportFraction: 0.9,
|
|
|
|
|
enableInfiniteScroll: false,
|
|
|
|
|
onPageChanged: (index, reason) {
|
|
|
|
|
print("onPageChanged");
|
|
|
|
|
}),
|
|
|
|
|
items: [
|
|
|
|
|
for (int i = 0; i < sliderData.length; i++)
|
|
|
|
|
Builder(
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return LoggedSliderView(widget.projectViewModel, sliderData[i]);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
AspectRatio(
|
|
|
|
|
aspectRatio: 2.2,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 20,right: 20,top: 16,bottom: 16),
|
|
|
|
|
child: LoggedSliderView(
|
|
|
|
|
widget.projectViewModel,
|
|
|
|
|
new SliderData(TranslationBase.of(context).fileno + ": " + widget.projectViewModel.user.patientID.toString(),
|
|
|
|
|
widget.projectViewModel.user.firstName + ' ' + widget.projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
appoCountProvider.count == 0
|
|
|
|
|
? Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 20, right: 20),
|
|
|
|
|
child: Image.asset("assets/images/bn_offer.png"),
|
|
|
|
|
)
|
|
|
|
|
: offersView(appoCountProvider.count),
|
|
|
|
|
mHeight(16),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.143,
|
|
|
|
|
@ -161,19 +132,19 @@ class _HomePageFragmentState extends State<LoggedHomePageFragment> {
|
|
|
|
|
? EdgeInsets.only(
|
|
|
|
|
right: 20,
|
|
|
|
|
left: 8,
|
|
|
|
|
top: 4,
|
|
|
|
|
top: 0,
|
|
|
|
|
)
|
|
|
|
|
: EdgeInsets.only(
|
|
|
|
|
left: 20,
|
|
|
|
|
right: 8,
|
|
|
|
|
top: 4,
|
|
|
|
|
top: 0,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
mFlex(1),
|
|
|
|
|
FlatButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
navigateTo(context, MedicalProfilePage());
|
|
|
|
|
navigateTo(context, MedicalProfilePageNew());
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).viewMedicalFile,
|
|
|
|
|
@ -187,14 +158,18 @@ class _HomePageFragmentState extends State<LoggedHomePageFragment> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
mHeight(4),
|
|
|
|
|
appoCountProvider.count == 0
|
|
|
|
|
? Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 20, right: 20),
|
|
|
|
|
child: Image.asset("assets/images/bn_offer.png"),
|
|
|
|
|
)
|
|
|
|
|
: offersView(appoCountProvider.count),
|
|
|
|
|
mHeight(14),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
left: 20,
|
|
|
|
|
right: 20,
|
|
|
|
|
top: 4,
|
|
|
|
|
),
|
|
|
|
|
child: PharmacyView(
|
|
|
|
|
onPharmacyClick: () {
|
|
|
|
|
widget.onPharmacyClick();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
@ -262,18 +237,6 @@ class _HomePageFragmentState extends State<LoggedHomePageFragment> {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
left: 20,
|
|
|
|
|
right: 20,
|
|
|
|
|
top: 20,
|
|
|
|
|
),
|
|
|
|
|
child: PharmacyView(
|
|
|
|
|
onPharmacyClick: () {
|
|
|
|
|
widget.onPharmacyClick();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
mHeight(140),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|