|
|
|
|
@ -106,113 +106,113 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: FutureBuilder(
|
|
|
|
|
future: getFamilyFiles(), // async work
|
|
|
|
|
builder: (BuildContext context,
|
|
|
|
|
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
|
|
|
|
|
snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
flex:4,
|
|
|
|
|
child: FutureBuilder(
|
|
|
|
|
future: getFamilyFiles(), // async work
|
|
|
|
|
builder: (BuildContext context,
|
|
|
|
|
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
|
|
|
|
|
snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 50),
|
|
|
|
|
child: Text('Loading....'));
|
|
|
|
|
default:
|
|
|
|
|
if (snapshot.hasError)
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Text(snapshot.error));
|
|
|
|
|
else
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 50),
|
|
|
|
|
child: Text('Loading....'));
|
|
|
|
|
default:
|
|
|
|
|
if (snapshot.hasError)
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Text(snapshot.error));
|
|
|
|
|
else
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 50),
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: Text(TranslationBase.of(context)
|
|
|
|
|
.request)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 2,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.switchUser,
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.deleteView,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: snapshot
|
|
|
|
|
.data.getAllSharedRecordsByStatusList
|
|
|
|
|
.map<Widget>((result) {
|
|
|
|
|
return result.status == 3
|
|
|
|
|
? Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: Text(
|
|
|
|
|
result.patientName)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 2,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(Icons.group),
|
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).request)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 2,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).switchUser,
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).deleteView,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: snapshot
|
|
|
|
|
.data.getAllSharedRecordsByStatusList
|
|
|
|
|
.map<Widget>((result) {
|
|
|
|
|
return result.status == 3
|
|
|
|
|
? Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: Text(
|
|
|
|
|
result.patientName)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 2,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(Icons.group),
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
switchUser(
|
|
|
|
|
result, context);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.delete,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
switchUser(
|
|
|
|
|
result, context);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.delete,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
deleteFamily(
|
|
|
|
|
result, context);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
: SizedBox();
|
|
|
|
|
}).toList())
|
|
|
|
|
]));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
deleteFamily(
|
|
|
|
|
result, context);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
: SizedBox();
|
|
|
|
|
}).toList())
|
|
|
|
|
]));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).addFamilyMember,
|
|
|
|
|
() => {
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(ADD_FAMILY_MEMBER_TYPE)
|
|
|
|
|
},
|
|
|
|
|
color: Colors.grey[900],
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
flex:1,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).addFamilyMember,
|
|
|
|
|
() => {
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(ADD_FAMILY_MEMBER_TYPE)
|
|
|
|
|
},
|
|
|
|
|
color: Colors.grey[900],
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
@ -270,7 +270,53 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [],
|
|
|
|
|
|
|
|
|
|
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())
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
@ -289,7 +335,57 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
FutureBuilder(
|
|
|
|
|
future: getSentRequest(), // async work
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context, AsyncSnapshot<dynamic> snapshot) {
|
|
|
|
|
(BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 50),
|
|
|
|
|
child: Text('Loading....'));
|
|
|
|
|
default:
|
|
|
|
|
if (snapshot.hasError)
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Text(snapshot.error));
|
|
|
|
|
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(),
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
child: ExpansionTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
TranslationBase.of(context).userView,
|
|
|
|
|
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
FutureBuilder(
|
|
|
|
|
future: getUserViewRequest(), // async work
|
|
|
|
|
builder: (BuildContext context,
|
|
|
|
|
AsyncSnapshot<dynamic> snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
return Padding(
|
|
|
|
|
@ -305,44 +401,68 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
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: [],
|
|
|
|
|
|
|
|
|
|
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())
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
child: ExpansionTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
TranslationBase.of(context).userView,
|
|
|
|
|
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
ListTile(
|
|
|
|
|
title: Text('data'),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -364,7 +484,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
return familyFileProvider.getUserViewRequest(user['PatientID']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getSentRequest() async {
|
|
|
|
|
Future<GetAllSharedRecordsByStatusResponse> getSentRequest() async {
|
|
|
|
|
// var user = await sharedPref.getObject(USER_PROFILE);
|
|
|
|
|
return familyFileProvider.getUserSentRequest();
|
|
|
|
|
}
|
|
|
|
|
@ -419,4 +539,10 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
HOME,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
deleteRequest(result, context){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
acceptRequest(result, context){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|