Home page 1.4 (Homepage changes)

merge-requests/390/head
Mirza.Shafique 5 years ago
parent 3c438406b5
commit a20185b2b9

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

@ -47,9 +47,9 @@ class _HomePageFragmentState extends State<HomePageFragment> {
child: Column(
children: [
AspectRatio(
aspectRatio: 2,
aspectRatio: 2.2,
child: Container(
margin: EdgeInsets.all(14),
margin: EdgeInsets.only(left: 14,right: 14,top: 10,bottom: 10),
child: SliderView(
onLoginClick: () {
widget.onLoginClick();
@ -62,7 +62,19 @@ class _HomePageFragmentState extends State<HomePageFragment> {
padding: const EdgeInsets.only(left: 20, right: 20),
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(
children: [
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),
],
),

@ -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),
],
),

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

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

@ -28,40 +28,51 @@ class _TimeLineViewState extends State<TimeLineView> {
crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Appointments",
style: TextStyle(
color: CustomColors.white,
fontSize: 14,
fontWeight: FontWeight.bold,
mFlex(2),
Padding(
padding: EdgeInsets.only(left: 12, right: 12),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Appointments",
style: TextStyle(
color: CustomColors.white,
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
),
Text(
"Timeline",
style: TextStyle(
color: CustomColors.white,
fontSize: 24,
fontWeight: FontWeight.bold,
Text(
"Timeline",
style: TextStyle(
color: CustomColors.white,
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
),
],
),
],
],
),
],
),
),
ListView.builder(
itemBuilder: (context, index) => TimelineNewWidget(
// isUp: index % 2 == 1,
appoitmentAllHistoryResul: widget.appoitmentAllHistoryResultList[index],
mFlex(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],
),
),
itemCount: widget.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal,
shrinkWrap: false,
reverse: widget.isArabic,
),
itemCount: widget.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal,
shrinkWrap: true,
reverse: widget.isArabic,
),
],
),
@ -81,6 +92,7 @@ class TimelineNewWidget extends StatelessWidget {
width: MediaQuery.of(context).size.width / 1.6,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: double.infinity,

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

Loading…
Cancel
Save