design issues fixed

merge-update-with-lab-changes
Sultan Khan 5 years ago
parent 63e6d06e74
commit 0a2cb22042

@ -216,87 +216,91 @@ class _MyAppointmentsState extends State<MyAppointments>
Widget getBookedAppointments() {
return Container(
child: widget.bookedAppoList.length != 0
? new ListView.builder(
itemCount: widget.bookedAppoList.length,
itemBuilder: (context, i) {
return AppointmentCard(
appo: widget.bookedAppoList[i],
onReloadAppointmentHistory: getPatientAppointmentHistory,
);
},
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noBookedAppointments,
style: TextStyle(
fontSize: 16.0,
)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Container(
child: widget.bookedAppoList.length != 0
? SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: <Widget>[
...List.generate(
widget._patientBookedAppointmentListHospital.length,
child: widget.bookedAppoList.length != 0
? new ListView.builder(
itemCount: widget.bookedAppoList.length,
itemBuilder: (context, i) {
return AppointmentCard(
appo: widget.bookedAppoList[i],
onReloadAppointmentHistory: getPatientAppointmentHistory,
);
},
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
// Image.asset(
// "assets/images/new-design/noAppointmentIcon.png"),
// Container(
// margin: EdgeInsets.only(top: 10.0),
// child: Text(TranslationBase.of(context).noBookedAppointments,
// style: TextStyle(
// fontSize: 16.0,
// )),
// ),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Container(
child: widget.bookedAppoList.length != 0
? SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: <Widget>[
...List.generate(
widget._patientBookedAppointmentListHospital
.length,
(index) => AppExpandableNotifier(
title: widget
._patientBookedAppointmentListHospital[index]
.filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget
._patientBookedAppointmentListHospital[index]
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList(),
)),
)
],
),
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("No Booked Appointments",
style: TextStyle(
fontSize: 16.0,
)),
title: widget
._patientBookedAppointmentListHospital[
index]
.filterName,
bodyWidget: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: widget
._patientBookedAppointmentListHospital[
index]
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList(),
)),
)
],
),
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("No Booked Appointments",
style: TextStyle(
fontSize: 16.0,
)),
),
],
),
],
),
),
),
),
),
)
],
))));
),
)
],
))));
}
Widget getConfirmedAppointments() {
@ -341,7 +345,8 @@ class _MyAppointmentsState extends State<MyAppointments>
Image.asset("assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noConfirmedAppointments ,
child: Text(
TranslationBase.of(context).noConfirmedAppointments,
style: TextStyle(
fontSize: 16.0,
)),
@ -363,23 +368,24 @@ class _MyAppointmentsState extends State<MyAppointments>
...List.generate(
widget._patientArrivedAppointmentListHospital.length,
(index) => AppExpandableNotifier(
title: widget
title: widget
._patientArrivedAppointmentListHospital[index]
.filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget
._patientArrivedAppointmentListHospital[index]
.filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget
._patientArrivedAppointmentListHospital[index]
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList(),
)),
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList(),
),
),
)
],
),
@ -394,10 +400,11 @@ class _MyAppointmentsState extends State<MyAppointments>
Image.asset("assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noArrivedAppointments,
style: TextStyle(
fontSize: 16.0,
)),
child:
Text(TranslationBase.of(context).noArrivedAppointments,
style: TextStyle(
fontSize: 16.0,
)),
),
],
),

@ -24,7 +24,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
navigateToAppointmentDetails(context, widget.appo);
},
child: Card(
margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0),
// margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
@ -95,7 +95,8 @@ class _ApointmentCardState extends State<AppointmentCard> {
emptyIcon: Icons.star,
),
Container(
transform: Matrix4.translationValues(15.0, -40.0, 0.0),
transform:
Matrix4.translationValues(15.0, -40.0, 0.0),
child: Image.asset(
"assets/images/new-design/arrow.png",
width: 25.0,

@ -106,7 +106,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: Column(
children: <Widget>[
Expanded(
flex:4,
flex: 4,
child: FutureBuilder(
future: getFamilyFiles(), // async work
builder: (BuildContext context,
@ -192,7 +192,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
),
),
Expanded(
flex:1,
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
@ -269,55 +269,52 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
)),
],
),
Column(
children: [
Row(children: [
Expanded(flex:3,child:AppText('Name')),
Expanded(flex:1,child:AppText('Allow')),
Expanded(flex:1,child:AppText('Reject')),
]),
Column(children: snapshot
Column(children: [
Row(children: [
Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Allow')),
Expanded(flex: 1, child: AppText('Reject')),
]),
Column(
children: snapshot
.data['GetAllPendingRecordsList']
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRequest(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
))
],
));
}).toList())
]
)
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRequest(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
))
],
));
}).toList())
])
],
);
}
@ -334,8 +331,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[
FutureBuilder(
future: getSentRequest(), // async work
builder:
(BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
builder: (BuildContext context,
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
@ -345,32 +343,33 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
child: Text('No data found..'));
else
return SingleChildScrollView(
child: Container(
height: SizeConfig.screenHeight *.3,
child: ListView(
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 2,
child: AppText(result.statusDescription, color: Colors.red,)),
],
));
}).toList(),
)));
return SingleChildScrollView(
child: Container(
height: SizeConfig.screenHeight * .3,
child: ListView(
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 2,
child: AppText(
result.statusDescription,
color: Colors.red,
)),
],
));
}).toList(),
)));
}
})
],
@ -384,8 +383,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) {
builder:
(BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
@ -395,69 +394,62 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
child: Text('No data found..'));
else
return Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(TranslationBase.of(context)
.request)),
child: Text(
TranslationBase.of(context).request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context)
.switchUser,
TranslationBase.of(context).switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context)
.deleteView,
TranslationBase.of(context).deleteView,
)),
],
),
Column(
children: [
Row(children: [
Expanded(flex:3,child:AppText('Name')),
Expanded(flex:1,child:AppText('Delete')),
]),
Column(children: snapshot
.data['GetAllPendingRecordsList']
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
)),
],
));
}).toList())
]
)
Column(children: [
Row(children: [
Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Delete')),
]),
Column(
children: snapshot
.data['GetAllPendingRecordsList']
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
)),
],
));
}).toList())
])
],
);
}
@ -539,10 +531,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
HOME,
);
}
deleteRequest(result, context){
}
acceptRequest(result, context){
}
deleteRequest(result, context) {}
acceptRequest(result, context) {}
}

@ -468,7 +468,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 2,
fontSize: SizeConfig.textMultiplier * 1.9,
)
],
),
@ -500,7 +500,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 2,
fontSize: SizeConfig.textMultiplier * 1.9,
)
],
),
@ -515,8 +515,12 @@ class _HomePageState extends State<HomePage> {
Container(
width: MediaQuery.of(context).size.width * 0.29,
child: InkWell(
onTap: ()=>Navigator.push(context,
FadePage(page: ErOptions(isAppbar: true,))),
onTap: () => Navigator.push(
context,
FadePage(
page: ErOptions(
isAppbar: true,
))),
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
@ -531,11 +535,12 @@ class _HomePageState extends State<HomePage> {
height: 15,
),
Texts(
TranslationBase.of(context).emergencyServices,
TranslationBase.of(context)
.emergencyServices,
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier * 1.9,
)
],
),
@ -598,9 +603,9 @@ class _HomePageState extends State<HomePage> {
context, FadePage(page: AllHabibMedicalService())),
),
DashboardItem(
onTap: (){
Navigator.push(context, FadePage(page: FeedbackHomePage()));
onTap: () {
Navigator.push(
context, FadePage(page: FeedbackHomePage()));
},
child: Container(
width: double.infinity,

@ -73,8 +73,7 @@ class FamilyFilesProvider with ChangeNotifier {
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
return Future.value(error);
}, body: request);
sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value(
@ -94,8 +93,9 @@ class FamilyFilesProvider with ChangeNotifier {
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
return Future.value(error);
//AppToast.showErrorToast(message: error);
//throw error;
}, body: request);
sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
@ -6,48 +7,89 @@ import 'package:flutter/material.dart';
/// [bodyWidget] widget want to show in the body
/// [title] the widget title
/// [collapsed] The widget shown in the collapsed state
class AppExpandableNotifier extends StatelessWidget {
class AppExpandableNotifier extends StatefulWidget {
final Widget headerWidget;
final Widget bodyWidget;
final String title;
final Widget collapsed;
bool expandFlag = false;
var controller = new ExpandableController();
AppExpandableNotifier(
{this.headerWidget, this.bodyWidget, this.title, this.collapsed});
_AppExpandableNotifier createState() => _AppExpandableNotifier();
}
class _AppExpandableNotifier extends State<AppExpandableNotifier> {
@override
Widget build(BuildContext context) {
return ExpandableNotifier(
child: Padding(
padding: const EdgeInsets.only(left: 10,right: 10,top: 4),
padding: const EdgeInsets.only(left: 10, right: 10, top: 4),
child: Card(
clipBehavior: Clip.antiAlias,
child: Column(
children: <Widget>[
SizedBox(
child: headerWidget,
child: widget.headerWidget,
),
ScrollOnExpand(
scrollOnExpand: true,
scrollOnCollapse: false,
child: ExpandablePanel(
hasIcon: false,
theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true,
),
header: Padding(
padding: EdgeInsets.all(10),
child: Text(
title?? 'Details',
style: TextStyle(fontWeight: FontWeight.bold,fontSize: 22,),
),
),
collapsed: collapsed ?? Container(),
expanded: bodyWidget,
header: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Text(
widget.title ?? 'Details',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2,
),
),
),
new IconButton(
icon: new Container(
height: 28.0,
width: 30.0,
decoration: new BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: new Center(
child: new Icon(
widget.expandFlag
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.white,
size: 30.0,
),
),
),
onPressed: () {
setState(() {
widget.expandFlag = !widget.expandFlag;
if (widget.expandFlag == true) {
widget.controller.expanded = true;
} else {
widget.controller.expanded = false;
}
});
}),
]),
collapsed: widget.collapsed ?? Container(),
expanded: widget.bodyWidget,
builder: (_, collapsed, expanded) {
return Padding(
padding: EdgeInsets.only(left: 5, right: 5, bottom: 5),
child: Expandable(
controller: widget.controller,
collapsed: collapsed,
expanded: expanded,
theme: const ExpandableThemeData(crossFadePoint: 0),

Loading…
Cancel
Save