|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
import 'dart:ui';
|
|
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
@ -31,7 +34,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
AppSharedPreferences sharedPref = new AppSharedPreferences();
|
|
|
|
|
var userID;
|
|
|
|
|
TabController _tabController;
|
|
|
|
|
|
|
|
|
|
int _tabIndex = 0;
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_tabController = new TabController(length: 2, vsync: this, initialIndex: 0);
|
|
|
|
@ -41,41 +44,102 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
|
|
|
|
|
bool expandFlag = false;
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
// return Scaffold(
|
|
|
|
|
// appBar: AppBar(
|
|
|
|
|
// bottom: TabBar(
|
|
|
|
|
// indicatorColor: Colors.red,
|
|
|
|
|
// tabs: [
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: EdgeInsets.all(6),
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context).family,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// )),
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: EdgeInsets.all(6),
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context).request,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// )),
|
|
|
|
|
// ],
|
|
|
|
|
// controller: _tabController,
|
|
|
|
|
// ),
|
|
|
|
|
//
|
|
|
|
|
// ),
|
|
|
|
|
// body: TabBarView(
|
|
|
|
|
// // physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
// children: [myFamilyDetails(context), myFamilyRequest(context)],
|
|
|
|
|
// controller: _tabController),
|
|
|
|
|
// );
|
|
|
|
|
// //bottomNavigationBar: BottomBarSearch());
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).myFamilyFiles,
|
|
|
|
|
isShowAppBar: widget.isAppbarVisible,
|
|
|
|
|
body: Scaffold(
|
|
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
|
appBar: PreferredSize(
|
|
|
|
|
preferredSize: Size.fromHeight(65.0),
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 1,
|
|
|
|
|
left: 0,
|
|
|
|
|
right: 0,
|
|
|
|
|
child: BackdropFilter(
|
|
|
|
|
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Theme.of(context)
|
|
|
|
|
.scaffoldBackgroundColor
|
|
|
|
|
.withOpacity(0.8),
|
|
|
|
|
height: 70.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 60.0,
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.92, // 0.9,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
bottom: BorderSide(
|
|
|
|
|
color: Theme.of(context).dividerColor,
|
|
|
|
|
width: 0.9), //width: 0.7
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: TabBar(
|
|
|
|
|
isScrollable: true,
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
indicatorWeight: 5.0,
|
|
|
|
|
//indicatorSize: TabBarIndicatorSize.label,
|
|
|
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
|
|
|
|
|
|
indicatorColor: Colors.red[800],
|
|
|
|
|
labelColor: Theme.of(context).primaryColor,
|
|
|
|
|
labelPadding:
|
|
|
|
|
EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
|
|
|
|
|
unselectedLabelColor: Colors.grey[800],
|
|
|
|
|
tabs: [
|
|
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.30,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppText(TranslationBase.of(context).family),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.30,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppText(TranslationBase.of(context).request),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
body: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: TabBarView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
children: [
|
|
|
|
|
myFamilyDetails(context),
|
|
|
|
|
myFamilyRequest(context)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).myFamilyFiles,
|
|
|
|
|
isShowAppBar: widget.isAppbarVisible,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: SizeConfig.screenHeight,
|
|
|
|
|
height: SizeConfig.screenHeight *.9,
|
|
|
|
|
width: SizeConfig.realScreenWidth,
|
|
|
|
|
padding: EdgeInsets.all(20),
|
|
|
|
|
child: Stack(
|
|
|
|
@ -84,12 +148,11 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
indicatorColor: Colors.red,
|
|
|
|
|
tabs: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(6),
|
|
|
|
|
child: Text(TranslationBase.of(context).family)),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(6),
|
|
|
|
|
child: Text(TranslationBase.of(context).request)),
|
|
|
|
|
Tab( // padding: EdgeInsets.all(6),
|
|
|
|
|
child:AppText(TranslationBase.of(context).family)),
|
|
|
|
|
Tab(
|
|
|
|
|
// padding: EdgeInsets.all(6),
|
|
|
|
|
child:AppText(TranslationBase.of(context).request)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
TabBarView(
|
|
|
|
@ -228,7 +291,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height,
|
|
|
|
|
margin: EdgeInsets.only(top:50),
|
|
|
|
|
margin: EdgeInsets.only(top:65),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
RoundedContainer(
|
|
|
|
@ -255,34 +318,37 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
else
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
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,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// Padding(padding: EdgeInsets.only(left:10, right:10),
|
|
|
|
|
// child:
|
|
|
|
|
// 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(children: [
|
|
|
|
|
Row(children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left:10, right:10), child:Row(children: [
|
|
|
|
|
Expanded(flex: 3, child: AppText('Name')),
|
|
|
|
|
Expanded(flex: 1, child: AppText('Allow')),
|
|
|
|
|
Expanded(flex: 1, child: AppText('Reject')),
|
|
|
|
|
]),
|
|
|
|
|
])),
|
|
|
|
|
Column(
|
|
|
|
|
children:familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList
|
|
|
|
|
.map<Widget>((result) {
|
|
|
|
@ -302,8 +368,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
acceptRequest(
|
|
|
|
|
result, context);
|
|
|
|
|
acceptRemoveRequest(
|
|
|
|
|
result.iD, 3, context);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
Expanded(
|
|
|
|
@ -314,8 +380,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
deleteRequest(
|
|
|
|
|
result, context);
|
|
|
|
|
acceptRemoveRequest(
|
|
|
|
|
result.iD,4, context);
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
@ -371,7 +437,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
flex: 2,
|
|
|
|
|
child: AppText(
|
|
|
|
|
result.statusDescription,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
color: result.status==3 ? Colors.green: Colors.red,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
@ -405,31 +471,36 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
else
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
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,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding:EdgeInsets.only(left:10, right:10),
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// Expanded(
|
|
|
|
|
// flex: 3,
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context).request),
|
|
|
|
|
// ),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// flex: 2,
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context).switchUser,
|
|
|
|
|
// )),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// flex: 1,
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context).deleteView,
|
|
|
|
|
// )),
|
|
|
|
|
// ],
|
|
|
|
|
// )),
|
|
|
|
|
Column(children: [
|
|
|
|
|
Row(children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding:EdgeInsets.only(left:10, right:10),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
Expanded(flex: 3, child: AppText('Name')),
|
|
|
|
|
Expanded(flex: 1, child: AppText('Delete')),
|
|
|
|
|
]),
|
|
|
|
|
])),
|
|
|
|
|
Column(
|
|
|
|
|
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList
|
|
|
|
|
.map<Widget>((result) {
|
|
|
|
@ -439,7 +510,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: Text(result.patientName)),
|
|
|
|
|
child: AppText(result.patientName)),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: IconButton(
|
|
|
|
@ -448,8 +519,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
deleteRequest(
|
|
|
|
|
result, context);
|
|
|
|
|
deactivateRequest(result.iD,
|
|
|
|
|
5, context);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
@ -514,8 +585,10 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
refreshFamily(context) {
|
|
|
|
|
sharedPref.remove(FAMILY_FILE);
|
|
|
|
|
(context as Element).reassemble();
|
|
|
|
|
//sharedPref.remove(FAMILY_FILE);
|
|
|
|
|
setState(() {
|
|
|
|
|
sharedPref.remove(FAMILY_FILE);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switchUser(user, context) {
|
|
|
|
@ -541,6 +614,24 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deleteRequest(result, context) {}
|
|
|
|
|
acceptRequest(result, context) {}
|
|
|
|
|
deactivateRequest(ID, status, context) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
Map<String, dynamic> request = {};
|
|
|
|
|
request["ID"] = ID;
|
|
|
|
|
request["Status"] = status;
|
|
|
|
|
this.familyFileProvider.deactivateFamily(request).then((value) => {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
|
refreshFamily(context)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
acceptRemoveRequest(ID, status, context) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
Map<String, dynamic> request = {};
|
|
|
|
|
request["ID"] = ID;
|
|
|
|
|
request["Status"] = status;
|
|
|
|
|
this.familyFileProvider.acceptRejectFamily(request).then((value) => {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
|
refreshFamily(context)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|