design issues fixed

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

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

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

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

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

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

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:expandable/expandable.dart'; import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -6,48 +7,89 @@ import 'package:flutter/material.dart';
/// [bodyWidget] widget want to show in the body /// [bodyWidget] widget want to show in the body
/// [title] the widget title /// [title] the widget title
/// [collapsed] The widget shown in the collapsed state /// [collapsed] The widget shown in the collapsed state
class AppExpandableNotifier extends StatelessWidget { class AppExpandableNotifier extends StatefulWidget {
final Widget headerWidget; final Widget headerWidget;
final Widget bodyWidget; final Widget bodyWidget;
final String title; final String title;
final Widget collapsed; final Widget collapsed;
bool expandFlag = false;
var controller = new ExpandableController();
AppExpandableNotifier( AppExpandableNotifier(
{this.headerWidget, this.bodyWidget, this.title, this.collapsed}); {this.headerWidget, this.bodyWidget, this.title, this.collapsed});
_AppExpandableNotifier createState() => _AppExpandableNotifier();
}
class _AppExpandableNotifier extends State<AppExpandableNotifier> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ExpandableNotifier( return ExpandableNotifier(
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 10,right: 10,top: 4), padding: const EdgeInsets.only(left: 10, right: 10, top: 4),
child: Card( child: Card(
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
child: headerWidget, child: widget.headerWidget,
), ),
ScrollOnExpand( ScrollOnExpand(
scrollOnExpand: true, scrollOnExpand: true,
scrollOnCollapse: false, scrollOnCollapse: false,
child: ExpandablePanel( child: ExpandablePanel(
hasIcon: false,
theme: const ExpandableThemeData( theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center, headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true, tapBodyToCollapse: true,
), ),
header: Padding( header: Row(
padding: EdgeInsets.all(10), mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Text( children: [
title?? 'Details', Padding(
style: TextStyle(fontWeight: FontWeight.bold,fontSize: 22,), padding: EdgeInsets.all(10),
), child: Text(
), widget.title ?? 'Details',
collapsed: collapsed ?? Container(), style: TextStyle(
expanded: bodyWidget, 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) { builder: (_, collapsed, expanded) {
return Padding( return Padding(
padding: EdgeInsets.only(left: 5, right: 5, bottom: 5), padding: EdgeInsets.only(left: 5, right: 5, bottom: 5),
child: Expandable( child: Expandable(
controller: widget.controller,
collapsed: collapsed, collapsed: collapsed,
expanded: expanded, expanded: expanded,
theme: const ExpandableThemeData(crossFadePoint: 0), theme: const ExpandableThemeData(crossFadePoint: 0),

Loading…
Cancel
Save