family file changes

merge-update-with-lab-changes
Sultan Khan 5 years ago
parent 072e6cffef
commit 8d499704dc

@ -35,7 +35,7 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); await sharedPref.getString(APP_LANGUAGE);
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
@ -87,8 +87,8 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: user['PatientTypeID'] != null :user['PatientType'] != null
? user['PatientTypeID'] ? user['PatientType']
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {

@ -23,6 +23,7 @@ void main() async {
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final themeNotifier = Provider.of<ThemeNotifier>(context);
return LayoutBuilder( return LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
@ -48,6 +49,7 @@ class MyApp extends StatelessWidget {
], ],
child: Consumer<ProjectViewModel>( child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp( builder: (context, projectProvider, child) => MaterialApp(
showSemanticsDebugger: false, showSemanticsDebugger: false,
title: 'Diplomatic Quarter App', title: 'Diplomatic Quarter App',
locale: projectProvider.appLocal, locale: projectProvider.appLocal,
@ -61,8 +63,9 @@ class MyApp extends StatelessWidget {
const Locale('ar', ''), // Arabic const Locale('ar', ''), // Arabic
const Locale('en', ''), // English const Locale('en', ''), // English
], ],
theme: ThemeData( //theme: themeNotifier.getTheme(),
fontFamily: projectProvider.isArabic? 'Cairo' : 'WorkSans', theme:ThemeData(
fontFamily:projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light, brightness: Brightness.light,

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
@ -144,7 +145,7 @@ class _AddMember extends State<AddMember> {
request.zipCode = countryCode; request.zipCode = countryCode;
request.isRegister = false; request.isRegister = false;
request.patientStatus = 2; request.patientStatus = 2;
loading(true); GifLoaderDialogUtils.showMyDialog(context);
familyFileProvider familyFileProvider
.addFamilyFile(request) .addFamilyFile(request)
.then((value) => manageFamily(value)) .then((value) => manageFamily(value))
@ -154,18 +155,21 @@ class _AddMember extends State<AddMember> {
} }
manageFamily(addMemberResult) { manageFamily(addMemberResult) {
loading(false); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog( if(addMemberResult is String ==false){
context: context, ConfirmDialog dialog = new ConfirmDialog(
confirmMessage: addMemberResult['ShareFamilyFileObj']['Message'], context: context,
okText: TranslationBase.of(context).confirm, confirmMessage: addMemberResult['ShareFamilyFileObj']['Message'],
cancelText: TranslationBase.of(context).cancel_nocaps, okText: TranslationBase.of(context).confirm,
okFunction: () => { cancelText: TranslationBase.of(context).cancel_nocaps,
insertFamilyData(addMemberResult), okFunction: () => {
ConfirmDialog.closeAlertDialog(context) insertFamilyData(addMemberResult),
}, ConfirmDialog.closeAlertDialog(context)
cancelFunction: () => {}); },
dialog.showAlertDialog(context); cancelFunction: () => {});
dialog.showAlertDialog(context);
}
} }
insertFamilyData(addMemberResult) { insertFamilyData(addMemberResult) {

@ -75,7 +75,7 @@ class AddFamilyMemberType extends StatelessWidget {
), ),
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.nationalID, .idNo,
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
2, 2,
@ -113,9 +113,10 @@ class AddFamilyMemberType extends StatelessWidget {
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.fileNo, .fileNo,
textAlign: TextAlign.center,
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
2, 1.8,
) )
], ],
), ),

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

@ -15,6 +15,8 @@ import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -46,9 +48,9 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver { class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
int currentTab = 0; int currentTab = 0;
PageController pageController; PageController pageController;
ProjectViewModel projectProvider; ProjectViewModel projectViewModel;
var notificationCount = ''; var notificationCount = '';
var themeNotifier;
///inject the user data ///inject the user data
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
@ -91,6 +93,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
print("didChangeAppLifecycleState"); print("didChangeAppLifecycleState");
print('state = $state'); print('state = $state');
AppGlobal.context = context; AppGlobal.context = context;
if (state == AppLifecycleState.resumed) { if (state == AppLifecycleState.resumed) {
print(LandingPage.isOpenCallPage); print(LandingPage.isOpenCallPage);
if (LandingPage.isOpenCallPage) { if (LandingPage.isOpenCallPage) {
@ -135,6 +138,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) { if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions(); _firebaseMessaging.requestNotificationPermissions();
} }
@ -149,7 +155,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}); });
Future.delayed(Duration.zero, () => setTheme());
//_firebase Background message handler //_firebase Background message handler
// _firebaseMessaging.configure( // _firebaseMessaging.configure(
// onMessage: (Map<String, dynamic> message) async { // onMessage: (Map<String, dynamic> message) async {
@ -334,8 +340,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of<ProjectViewModel>(context);
themeNotifier = Provider.of<ThemeNotifier>(context);
//setTheme();
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
@ -460,7 +467,46 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return TranslationBase.of(context).services; return TranslationBase.of(context).services;
} }
} }
setTheme() async{
//
// defaultTheme =
// ThemeData(
// fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans',
// primarySwatch: Colors.blue,
// visualDensity: VisualDensity.adaptivePlatformDensity,
// brightness: Brightness.light,
// pageTransitionsTheme: const PageTransitionsTheme(
// builders: {
// TargetPlatform.android: ZoomPageTransitionsBuilder(),
// TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
// },
// ),
// hintColor: Colors.grey[400],
// disabledColor: Colors.grey[300],
// errorColor: Color.fromRGBO(235, 80, 60, 1.0),
// scaffoldBackgroundColor: Color(0xffEEEEEE),
// textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
// textSelectionHandleColor: Colors.grey,
// canvasColor: Colors.white,
// backgroundColor: Colors.white,
// highlightColor: Colors.grey[100].withOpacity(0.4),
// splashColor: Colors.transparent,
// primaryColor: Color(0xff40ACC9),
// bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
// cursorColor: Colors.grey,
// cardColor: Colors.white,
// iconTheme: IconThemeData(),
// appBarTheme: AppBarTheme(
// color: Color(0xff40ACC9),
// brightness: Brightness.dark,
// elevation: 10.0,
// actionsIconTheme: IconThemeData(
// color: Color(0xff40ACC9),
// ),
// ),
// );
// themeNotifier.setTheme(defaultTheme);
}
void checkUserStatus(token) async { void checkUserStatus(token) async {
authService authService
.selectDeviceImei(token) .selectDeviceImei(token)

@ -460,7 +460,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this.deviceToken = await sharedPref.getString(PUSH_TOKEN); this.deviceToken = await sharedPref.getString(PUSH_TOKEN);
this.lastLogin = await sharedPref.getInt(LAST_LOGIN) != null this.lastLogin = await sharedPref.getInt(LAST_LOGIN) != null
? await sharedPref.getInt(LAST_LOGIN) ? await sharedPref.getInt(LAST_LOGIN)
: user.logInType !=null ? user.logInType : null; : user !=null ? user.logInType : null;
//this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN);
} }
@ -525,6 +525,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
else else
{ {
sharedPref.remove(FAMILY_FILE),
result.list.isFamily = false, result.list.isFamily = false,
userData = result.list, userData = result.list,
sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(MAIN_USER, result.list),

@ -241,6 +241,7 @@ class _Login extends State<Login> {
} }
// request.isRegister = false; // request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) => { this.authService.checkActivationCode(request, code).then((result) => {
sharedPref.remove(FAMILY_FILE),
result = CheckActivationCode.fromJson(result), result = CheckActivationCode.fromJson(result),
result.list.isFamily =false, result.list.isFamily =false,
this.sharedPref.setObject(USER_PROFILE, result.list), this.sharedPref.setObject(USER_PROFILE, result.list),

@ -296,6 +296,7 @@ class _RegisterInfo extends State<RegisterInfo> {
}else }else
{ {
sharedPref.remove(FAMILY_FILE),
result.list.isFamily = false, result.list.isFamily = false,
sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
this.sharedPref.setObject(MAIN_USER, result.list), this.sharedPref.setObject(MAIN_USER, result.list),
@ -303,20 +304,21 @@ class _RegisterInfo extends State<RegisterInfo> {
sharedPref.setString(TOKEN, result.authenticationTokenID), sharedPref.setString(TOKEN, result.authenticationTokenID),
Navigator.of(context).pushNamed(HOME) Navigator.of(context).pushNamed(HOME)
} }
}).catchError((err) { });
GifLoaderDialogUtils.hideDialog(context); // .catchError((err) {
ConfirmDialog dialog = new ConfirmDialog( // GifLoaderDialogUtils.hideDialog(context);
context: context, // ConfirmDialog dialog = new ConfirmDialog(
confirmMessage: err, // context: context,
okText: TranslationBase.of(context).confirm, // confirmMessage: err,
cancelText: TranslationBase.of(context).cancel_nocaps, // okText: TranslationBase.of(context).confirm,
okFunction: () => { // cancelText: TranslationBase.of(context).cancel_nocaps,
ConfirmDialog.closeAlertDialog(context) // okFunction: () => {
}, // ConfirmDialog.closeAlertDialog(context)
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); // },
dialog.showAlertDialog(context); // cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
// dialog.showAlertDialog(context);
}); //
// });
} }
getRegisterInfo() async { getRegisterInfo() async {
@ -349,15 +351,15 @@ class _RegisterInfo extends State<RegisterInfo> {
"PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1, "PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
"FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr, "FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr,
"FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn, "FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn,
"MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr, "MiddleNameN":registerInfo.secondNameAr,
"MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn, "MiddleName":registerInfo.secondNameEn,
"LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr, "LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr,
"LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn, "LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn,
"StrDateofBirth": registerInfo.dateOfBirth, "StrDateofBirth": registerInfo.dateOfBirth,
"DateofBirth": DateUtil.convertISODateToJsonDate( "DateofBirth": DateUtil.convertISODateToJsonDate(
registerInfo.dateOfBirth.replaceAll('/', '-')), registerInfo.dateOfBirth.replaceAll('/', '-')),
"Gender": registerInfo.gender == 'M' ? 1 : 2, "Gender": registerInfo.gender == 'M' ? 1 : 2,
"NationalityID": registerInfo.nationality, "NationalityID": registerInfo.nationalityCode,
"DateofBirthN": date, "DateofBirthN": date,
"EmailAddress": email, "EmailAddress": email,
"SourceType": location, "SourceType": location,

@ -20,10 +20,10 @@ class _GeneralSettings extends State<GeneralSettings>
with TickerProviderStateMixin { with TickerProviderStateMixin {
var themeNotifier; var themeNotifier;
int blindValue = 0; int blindValue = 0;
bool vibration =false; bool vibration =false;
bool accsibility =false; bool accsibility =false;
bool camera =false; bool camera =false;
bool location =false; bool location =false;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
var permission = new PermissionService(); var permission = new PermissionService();
var mediaQueryData; var mediaQueryData;
@ -81,7 +81,7 @@ class _GeneralSettings extends State<GeneralSettings>
setState(() { setState(() {
accsibility = value; accsibility = value;
}); });
//setAccisibility(value); //setAccessibility(value);
}, },
activeTrackColor: Colors.lightGreenAccent, activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green, activeColor: Colors.green,
@ -238,43 +238,7 @@ class _GeneralSettings extends State<GeneralSettings>
break; break;
case 1: case 1:
{ {
themeNotifier.setTheme(ThemeData( themeNotifier.setTheme(await getTheme(value));
fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.grey,
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
),
),
));
Screen.setBrightness(1.0); Screen.setBrightness(1.0);
} }
break; break;
@ -295,14 +259,14 @@ class _GeneralSettings extends State<GeneralSettings>
} }
break; break;
} }
//permission.setTheme(value); permission.setTheme(value);
} }
setVibration(value){ setVibration(value){
permission.setVibrationPermission(value); permission.setVibrationPermission(value);
} }
setAccisibility(){ setAccessibility(){
if(!accsibility){ if(!accsibility){
} }
@ -311,12 +275,13 @@ class _GeneralSettings extends State<GeneralSettings>
getValues() async{ getValues() async{
blindValue= permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled(); blindValue= permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled();
vibration = permission.isVibrationEnabled() ==null ? false : permission.isVibrationEnabled(); vibration = permission.isVibrationEnabled() ==null ? false : permission.isVibrationEnabled();
accsibility =mediaQueryData.accessibleNavigation; // accsibility = mediaQueryData.accessibleNavigation;
} }
getTheme(value) async{ getTheme(value) async{
if(value ==1){ if(value ==1){
return ThemeData( return ThemeData(
fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'en' ? 'WorkSans' : 'Cairo',
primarySwatch: Colors.grey, primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light, brightness: Brightness.light,
@ -355,7 +320,7 @@ class _GeneralSettings extends State<GeneralSettings>
}else if(value ==3){ }else if(value ==3){
return ThemeData( return ThemeData(
fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'en' ? 'WorkSans' : 'Cairo',
primarySwatch: Colors.grey, primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light, brightness: Brightness.light,
@ -394,7 +359,7 @@ class _GeneralSettings extends State<GeneralSettings>
}else { }else {
return ThemeData( return ThemeData(
fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'en' ? 'WorkSans' : 'Cairo',
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light, brightness: Brightness.light,

@ -37,6 +37,8 @@ const String SENT_REQUEST_URL =
'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus';
const String RECEVIED_REQUEST_URL = const String RECEVIED_REQUEST_URL =
'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId'; 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId';
const ACCEPT_REJECT_FAMILY = 'Services/Authentication.svc/REST/Update_FileStatus';
const DEACTIVATE_FAMILY = 'Services/Authentication.svc/REST/DeactivateRequestByRensponse';
class FamilyFilesProvider with ChangeNotifier { class FamilyFilesProvider with ChangeNotifier {
bool isLogin = false; bool isLogin = false;
@ -300,4 +302,43 @@ class FamilyFilesProvider with ChangeNotifier {
throw error; throw error;
} }
} }
Future<dynamic> acceptRejectFamily(request) async {
try {
dynamic localRes;
await new BaseAppClient().post(ACCEPT_REJECT_FAMILY,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> deactivateFamily(request) async {
try {
dynamic localRes;
await new BaseAppClient().post(DEACTIVATE_FAMILY,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
} }

@ -53,7 +53,7 @@ final blueBackground = Color(0xFFFFFFFF);
), ),
); );
final defaultTheme = ThemeData( var defaultTheme = ThemeData(
//fontFamily: ProjectViewModel().isArabic? 'Cairo' : 'WorkSans', //fontFamily: ProjectViewModel().isArabic? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,

@ -265,10 +265,12 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
Expanded( Expanded(
flex: 7, flex: 7,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ child: Padding(
padding:EdgeInsets.only(left:5, right:5),
child:Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
])), ]))),
], ],
))) )))
: SizedBox(); : SizedBox();

Loading…
Cancel
Save