|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
import 'dart:ui';
|
|
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
|
|
|
|
@ -35,6 +34,9 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
|
|
|
|
|
class MyFamily extends StatefulWidget {
|
|
|
|
|
final bool isAppbarVisible;
|
|
|
|
@ -123,7 +125,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
children: [myFamilyDetails(context), myFamilyRequest(context)],
|
|
|
|
|
)
|
|
|
|
|
: Container(child: AppText('Loading..')),
|
|
|
|
|
: Container(child: AppText('')),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
@ -153,98 +155,108 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
|
|
|
|
|
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading...'));
|
|
|
|
|
default:
|
|
|
|
|
if (snapshot.hasError)
|
|
|
|
|
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
|
|
|
|
|
else
|
|
|
|
|
return ListView.separated(
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
snapshot.data.getAllSharedRecordsByStatusList[index].gender = 2;
|
|
|
|
|
if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3)
|
|
|
|
|
return Card(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
shape: cardRadius(15),
|
|
|
|
|
shape: cardRadius(25),
|
|
|
|
|
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Color(0xff6EA8FF) : Color(0xffFDA4B0),
|
|
|
|
|
elevation: 3,
|
|
|
|
|
child: Container(
|
|
|
|
|
// height: 130,
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Texts(
|
|
|
|
|
snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach,
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Texts(
|
|
|
|
|
snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach,
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(),
|
|
|
|
|
fontSize: 12, color: Colors.white),
|
|
|
|
|
Texts(
|
|
|
|
|
snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
|
|
|
|
|
' ' +
|
|
|
|
|
TranslationBase.of(context).years +
|
|
|
|
|
', ' +
|
|
|
|
|
snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(),
|
|
|
|
|
fontSize: 12, color: Colors.white),
|
|
|
|
|
Texts(
|
|
|
|
|
snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
|
|
|
|
|
' ' +
|
|
|
|
|
TranslationBase.of(context).years +
|
|
|
|
|
', ' +
|
|
|
|
|
snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
|
|
|
width: 100.0,
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).switchUser,
|
|
|
|
|
() {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// isSwitchUser = value;
|
|
|
|
|
// });
|
|
|
|
|
switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], AppGlobal.context);
|
|
|
|
|
SizedBox(height: 10),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
|
|
|
|
|
},
|
|
|
|
|
fontSize: 12.0,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
textColor: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
|
|
|
|
|
padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
SvgPicture.asset("assets/images/new-design/switch.svg",
|
|
|
|
|
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E)),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 5,
|
|
|
|
|
),
|
|
|
|
|
// CupertinoSwitch(
|
|
|
|
|
// value: isSwitchUser,
|
|
|
|
|
// onChanged: (value) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// isSwitchUser = value;
|
|
|
|
|
// });
|
|
|
|
|
// if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
Texts(TranslationBase.of(context).switchUser,
|
|
|
|
|
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E),
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold)
|
|
|
|
|
],
|
|
|
|
|
))),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// CupertinoSwitch(
|
|
|
|
|
// value: isSwitchUser,
|
|
|
|
|
// onChanged: (value) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// isSwitchUser = value;
|
|
|
|
|
// });
|
|
|
|
|
// if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// Texts(
|
|
|
|
|
// TranslationBase.of(context).switchUser,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context);
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).delete,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.delete,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
|
|
|
|
|
padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
SvgPicture.asset("assets/images/new-design/delete.svg",
|
|
|
|
|
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E)),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 5,
|
|
|
|
|
),
|
|
|
|
|
Texts(TranslationBase.of(context).delete,
|
|
|
|
|
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 1 ? Colors.white : Color(0Xff5A282E),
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
],
|
|
|
|
|
))),
|
|
|
|
|
SizedBox(height: 10),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)));
|
|
|
|
|
else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0)
|
|
|
|
@ -277,180 +289,328 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
child: ExpansionTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
TranslationBase.of(context).userViewRequest,
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
FutureBuilder(
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
widthFactor: 1.0,
|
|
|
|
|
child: AppExpandableNotifier(
|
|
|
|
|
title: TranslationBase.of(context).userViewRequest,
|
|
|
|
|
bodyWidget: FutureBuilder(
|
|
|
|
|
future: getUserViewRequest(), // async work
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
|
|
|
|
|
return SizedBox();
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
if (snapshot.hasError)
|
|
|
|
|
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
|
|
|
|
|
else
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
child: Card(
|
|
|
|
|
elevation: 3,
|
|
|
|
|
shape: cardRadius(8),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Column(children: [
|
|
|
|
|
return ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
|
|
|
|
|
itemBuilder: (context, _index) {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
border: Border.all(width: 1, color: Color(0xffEFEFEF)),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Color(0xff000000).withOpacity(.05),
|
|
|
|
|
//spreadRadius: 5,
|
|
|
|
|
blurRadius: 27,
|
|
|
|
|
offset: Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Column(children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
|
|
|
|
|
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
|
|
|
|
|
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
|
|
|
|
|
])),
|
|
|
|
|
Divider(color: Colors.black, height: 1.5, thickness: 1.5),
|
|
|
|
|
Column(
|
|
|
|
|
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: Texts(
|
|
|
|
|
result.patientName,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
acceptRemoveRequest(result.iD, 3, context);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
acceptRemoveRequest(result.iD, 4, context);
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}).toList())
|
|
|
|
|
])
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
itemCount: 1);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
))),
|
|
|
|
|
|
|
|
|
|
// RoundedContainer(
|
|
|
|
|
// child: ExpansionTile(
|
|
|
|
|
// title: Text(
|
|
|
|
|
// TranslationBase.of(context).userViewRequest,
|
|
|
|
|
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
|
|
|
|
|
// ),
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// FutureBuilder(
|
|
|
|
|
// future: getUserViewRequest(), // async work
|
|
|
|
|
// builder: (BuildContext context, AsyncSnapshot<dynamic> 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(TranslationBase.of(context).noDataAvailable));
|
|
|
|
|
// else
|
|
|
|
|
// return Container(
|
|
|
|
|
// padding: EdgeInsets.all(15),
|
|
|
|
|
// child: Card(
|
|
|
|
|
// elevation: 3,
|
|
|
|
|
// shape: cardRadius(8),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// Column(children: [
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: EdgeInsets.all(10),
|
|
|
|
|
// child: Row(children: [
|
|
|
|
|
// Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
|
|
|
|
|
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
|
|
|
|
|
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
|
|
|
|
|
// ])),
|
|
|
|
|
// Divider(color: Colors.black, height: 1.5, thickness: 1.5),
|
|
|
|
|
// Column(
|
|
|
|
|
// children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
|
|
|
|
|
// return Container(
|
|
|
|
|
// padding: EdgeInsets.all(10),
|
|
|
|
|
// child: Row(
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// Expanded(
|
|
|
|
|
// flex: 3,
|
|
|
|
|
// child: Texts(
|
|
|
|
|
// result.patientName,
|
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// )),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// flex: 1,
|
|
|
|
|
// child: IconButton(
|
|
|
|
|
// icon: Icon(
|
|
|
|
|
// Icons.check_circle,
|
|
|
|
|
// color: Color(0xff349745),
|
|
|
|
|
// ),
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// acceptRemoveRequest(result.iD, 3, context);
|
|
|
|
|
// },
|
|
|
|
|
// )),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// flex: 1,
|
|
|
|
|
// child: IconButton(
|
|
|
|
|
// icon: Icon(
|
|
|
|
|
// Icons.close,
|
|
|
|
|
// color: Colors.red[900],
|
|
|
|
|
// ),
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// acceptRemoveRequest(result.iD, 4, context);
|
|
|
|
|
// },
|
|
|
|
|
// ))
|
|
|
|
|
// ],
|
|
|
|
|
// ));
|
|
|
|
|
// }).toList())
|
|
|
|
|
// ])
|
|
|
|
|
// ],
|
|
|
|
|
// )));
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
SizedBox(height: 15),
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
widthFactor: 1.0,
|
|
|
|
|
child: AppExpandableNotifier(
|
|
|
|
|
title: TranslationBase.of(context).sentRequest,
|
|
|
|
|
bodyWidget: FutureBuilder(
|
|
|
|
|
future: getSentRequest(), // async work
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
return SizedBox();
|
|
|
|
|
default:
|
|
|
|
|
if (snapshot.hasError)
|
|
|
|
|
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
|
|
|
|
|
else
|
|
|
|
|
return ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
|
|
|
|
|
itemBuilder: (context, _index) {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
border: Border.all(width: 1, color: Color(0xffEFEFEF)),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Color(0xff000000).withOpacity(.05),
|
|
|
|
|
//spreadRadius: 5,
|
|
|
|
|
blurRadius: 27,
|
|
|
|
|
offset: Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
|
|
|
|
|
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
|
|
|
|
|
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
|
|
|
|
|
Expanded(flex: 1, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600))
|
|
|
|
|
])),
|
|
|
|
|
Divider(color: Colors.black, height: 1),
|
|
|
|
|
Divider(color: Colors.black, height: 1.5, thickness: 1.5),
|
|
|
|
|
Column(
|
|
|
|
|
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
|
|
|
|
|
return Container(
|
|
|
|
|
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: () {
|
|
|
|
|
acceptRemoveRequest(result.iD, 3, context);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.delete,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
acceptRemoveRequest(result.iD, 4, context);
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}).toList())
|
|
|
|
|
])
|
|
|
|
|
],
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: Texts(
|
|
|
|
|
result.patientName,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Card(
|
|
|
|
|
shape: cardRadius(10),
|
|
|
|
|
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
|
child: AppText(
|
|
|
|
|
result.statusDescription,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
)))),
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
itemCount: 1,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}))),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
child: ExpansionTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
TranslationBase.of(context).sentRequest,
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
FutureBuilder(
|
|
|
|
|
future: getSentRequest(), // 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(TranslationBase.of(context).noDataAvailable));
|
|
|
|
|
else
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
height: SizeConfig.screenHeight * .3,
|
|
|
|
|
child: Card(
|
|
|
|
|
elevation: 3,
|
|
|
|
|
shape: cardRadius(8),
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
Expanded(flex: 3, child: AppText(TranslationBase.of(context).theName, fontWeight: FontWeight.w600)),
|
|
|
|
|
Expanded(flex: 2, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600))
|
|
|
|
|
])),
|
|
|
|
|
Divider(color: Colors.black, height: 1),
|
|
|
|
|
Column(
|
|
|
|
|
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: result.status == 3 ? Colors.green : Colors.red,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
))));
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
child: ExpansionTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
TranslationBase.of(context).userView,
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
FutureBuilder(
|
|
|
|
|
future: getUserViewRequest(), // async work
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<dynamic> 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(TranslationBase.of(context).noDataAvailable));
|
|
|
|
|
else
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
child: Card(
|
|
|
|
|
elevation: 3,
|
|
|
|
|
shape: cardRadius(8),
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
widthFactor: 1.0,
|
|
|
|
|
child: AppExpandableNotifier(
|
|
|
|
|
title: TranslationBase.of(context).userView,
|
|
|
|
|
bodyWidget: FutureBuilder(
|
|
|
|
|
future: getUserViewRequest(), // async work
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
return Padding(padding: EdgeInsets.only(top: 50), child: Text(''));
|
|
|
|
|
default:
|
|
|
|
|
if (snapshot.hasError)
|
|
|
|
|
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
|
|
|
|
|
else
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
border: Border.all(width: 1, color: Color(0xffEFEFEF)),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Color(0xff000000).withOpacity(.05),
|
|
|
|
|
//spreadRadius: 5,
|
|
|
|
|
blurRadius: 27,
|
|
|
|
|
offset: Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Column(children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name)),
|
|
|
|
|
Expanded(flex: 1, child: AppText(TranslationBase.of(context).delete)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).name,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).delete,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
)),
|
|
|
|
|
])),
|
|
|
|
|
Divider(color: Colors.black),
|
|
|
|
|
Divider(color: Colors.black, height: 1.5, thickness: 1.5),
|
|
|
|
|
Column(
|
|
|
|
|
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(flex: 3, child: AppText(result.patientName)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: Texts(
|
|
|
|
|
result.patientName,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.delete,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
deactivateRequest(result.iD, 5, context);
|
|
|
|
@ -461,11 +621,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
}).toList())
|
|
|
|
|
])
|
|
|
|
|
],
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
})))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|