Home page 1.4 (Homepage changes)

merge-update-with-lab-changes
Mirza.Shafique 5 years ago
parent 3c438406b5
commit a20185b2b9

@ -51,7 +51,10 @@ class _MyApp extends State<MyApp> {
LocalNotification.getInstance() LocalNotification.getInstance()
.showNow(title: "Payload", subtitle: payload, payload: payload); .showNow(title: "Payload", subtitle: payload, payload: payload);
}); });
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
// final themeNotifier = Provider.of<ThemeNotifier>(context); // final themeNotifier = Provider.of<ThemeNotifier>(context);
precacheImage(AssetImage('assets/images/powerd-by.jpg'), context); precacheImage(AssetImage('assets/images/powerd-by.jpg'), context);
return LayoutBuilder( return LayoutBuilder(

@ -47,9 +47,9 @@ class _HomePageFragmentState extends State<HomePageFragment> {
child: Column( child: Column(
children: [ children: [
AspectRatio( AspectRatio(
aspectRatio: 2, aspectRatio: 2.2,
child: Container( child: Container(
margin: EdgeInsets.all(14), margin: EdgeInsets.only(left: 14,right: 14,top: 10,bottom: 10),
child: SliderView( child: SliderView(
onLoginClick: () { onLoginClick: () {
widget.onLoginClick(); widget.onLoginClick();
@ -62,7 +62,19 @@ class _HomePageFragmentState extends State<HomePageFragment> {
padding: const EdgeInsets.only(left: 20, right: 20), padding: const EdgeInsets.only(left: 20, right: 20),
child: Image.asset("assets/images/bn_offer.png"), child: Image.asset("assets/images/bn_offer.png"),
), ),
mHeight(20), Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 16,
),
child: PharmacyView(
onPharmacyClick: () {
widget.onPharmacyClick();
},
),
),
mHeight(16),
Column( Column(
children: [ children: [
Padding( Padding(
@ -116,18 +128,7 @@ class _HomePageFragmentState extends State<HomePageFragment> {
), ),
], ],
), ),
Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 20,
),
child: PharmacyView(
onPharmacyClick: () {
widget.onPharmacyClick();
},
),
),
mHeight(140), mHeight(140),
], ],
), ),

@ -86,52 +86,23 @@ class _HomePageFragmentState extends State<LoggedHomePageFragment> {
width: double.infinity, width: double.infinity,
child: Column( child: Column(
children: [ children: [
FutureBuilder( AspectRatio(
future: getFamilyFiles(), // async work aspectRatio: 2.2,
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) { child: Padding(
switch (snapshot.connectionState) { padding: const EdgeInsets.only(left: 20,right: 20,top: 16,bottom: 16),
case ConnectionState.waiting: child: LoggedSliderView(
return Padding(padding: EdgeInsets.all(10), child: Text('')); widget.projectViewModel,
default: new SliderData(TranslationBase.of(context).fileno + ": " + widget.projectViewModel.user.patientID.toString(),
if (snapshot.hasError) widget.projectViewModel.user.firstName + ' ' + widget.projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor)),
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]);
},
)
],
), ),
);
}
}
},
), ),
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( Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * 0.143, height: MediaQuery.of(context).size.height * 0.143,
@ -161,19 +132,19 @@ class _HomePageFragmentState extends State<LoggedHomePageFragment> {
? EdgeInsets.only( ? EdgeInsets.only(
right: 20, right: 20,
left: 8, left: 8,
top: 4, top: 0,
) )
: EdgeInsets.only( : EdgeInsets.only(
left: 20, left: 20,
right: 8, right: 8,
top: 4, top: 0,
), ),
child: Row( child: Row(
children: [ children: [
mFlex(1), mFlex(1),
FlatButton( FlatButton(
onPressed: () { onPressed: () {
navigateTo(context, MedicalProfilePage()); navigateTo(context, MedicalProfilePageNew());
}, },
child: Text( child: Text(
TranslationBase.of(context).viewMedicalFile, TranslationBase.of(context).viewMedicalFile,
@ -187,14 +158,18 @@ class _HomePageFragmentState extends State<LoggedHomePageFragment> {
], ],
), ),
), ),
mHeight(4), Padding(
appoCountProvider.count == 0 padding: const EdgeInsets.only(
? Padding( left: 20,
padding: const EdgeInsets.only(left: 20, right: 20), right: 20,
child: Image.asset("assets/images/bn_offer.png"), top: 4,
) ),
: offersView(appoCountProvider.count), child: PharmacyView(
mHeight(14), onPharmacyClick: () {
widget.onPharmacyClick();
},
),
),
Column( Column(
children: [ children: [
Padding( 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), mHeight(140),
], ],
), ),

@ -517,7 +517,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
login(); login();
}, },
), ),
MedicalProfilePage(), MedicalProfilePageNew(),
BookingOptions(), BookingOptions(),
MyFamily(isAppbarVisible: false), MyFamily(isAppbarVisible: false),
ToDo(isShowAppBar: false), ToDo(isShowAppBar: false),

@ -76,26 +76,26 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( // Container(
width: double.infinity, // width: double.infinity,
height: 210, // height: 210,
decoration: containerBottomRightRadiusWithGradientBorder(0, darkColor: Color(0xFFF2B353E), lightColor: Color(0xFFF2B353E)), // decoration: containerBottomRightRadiusWithGradientBorder(0, darkColor: Color(0xFFF2B353E), lightColor: Color(0xFFF2B353E)),
child: Stack( // child: Stack(
children: <Widget>[ // children: <Widget>[
if (model.isLogin) // if (model.isLogin)
ListView.builder( // ListView.builder(
itemBuilder: (context, index) => TimeLineWidget( // itemBuilder: (context, index) => TimeLineWidget(
isUp: index % 2 == 1, // isUp: index % 2 == 1,
appoitmentAllHistoryResul: model.appoitmentAllHistoryResultList[index], // appoitmentAllHistoryResul: model.appoitmentAllHistoryResultList[index],
), // ),
itemCount: model.appoitmentAllHistoryResultList.length, // itemCount: model.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal, // scrollDirection: Axis.horizontal,
reverse: projectViewModel.isArabic, // reverse: projectViewModel.isArabic,
), // ),
], // ],
), // ),
), // ),
TimeLineView(model.isLogin, projectViewModel.isArabic, model.appoitmentAllHistoryResultList), //TimeLineView(model.isLogin, projectViewModel.isArabic, model.appoitmentAllHistoryResultList),
SizedBox( SizedBox(
height: 20, height: 20,
), ),

@ -28,7 +28,10 @@ class _TimeLineViewState extends State<TimeLineView> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.spaceEvenly, // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Row( mFlex(2),
Padding(
padding: EdgeInsets.only(left: 12, right: 12),
child: Row(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -53,16 +56,24 @@ class _TimeLineViewState extends State<TimeLineView> {
), ),
], ],
), ),
ListView.builder( ),
itemBuilder: (context, index) => TimelineNewWidget( mFlex(1),
// isUp: index % 2 == 1, Container(
height: 110,
width: double.infinity,
child: ListView.builder(
itemBuilder: (context, index) => Padding(
padding: EdgeInsets.only(left: index==0?12:0,right: (widget.appoitmentAllHistoryResultList.length-1) != null?20:0),
child: TimelineNewWidget(
appoitmentAllHistoryResul: widget.appoitmentAllHistoryResultList[index], appoitmentAllHistoryResul: widget.appoitmentAllHistoryResultList[index],
), ),
),
itemCount: widget.appoitmentAllHistoryResultList.length, itemCount: widget.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: false,
reverse: widget.isArabic, reverse: widget.isArabic,
), ),
),
], ],
), ),
); );
@ -81,6 +92,7 @@ class TimelineNewWidget extends StatelessWidget {
width: MediaQuery.of(context).size.width / 1.6, width: MediaQuery.of(context).size.width / 1.6,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,

@ -454,7 +454,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
break; break;
case '17': case '17':
{ {
Navigator.push(context, FadePage(page: MedicalProfilePage())); Navigator.push(context, FadePage(page: MedicalProfilePageNew()));
} }
break; break;
case '18': case '18':

Loading…
Cancel
Save