diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index dd4911e1..8fdbb15e 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -64,7 +65,7 @@ class _Login extends State { @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, @@ -196,6 +197,19 @@ class _Login extends State { }) .catchError((err) { print(err); + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: err, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + Navigator.of(context).pushNamed( + REGISTER, + ), + ConfirmDialog.closeAlertDialog(context) + }, + cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); + dialog.showAlertDialog(context); GifLoaderDialogUtils.hideDialog(context); }); // SMSOTP.showLoadingDialog(context, false), @@ -226,10 +240,10 @@ class _Login extends State { this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), this.sharedPref.setString(TOKEN, result.authenticationTokenID), authenticatedUserObject.getUser(), - // authenticatedUserObject.user = AuthenticatedUser.fromJson(result.list), + // authenticatedUserObject.user = AuthenticatedUser.fromJson(result.list), authenticatedUserObject.isLogin = true, appointmentRateViewModel.isLogin = true, - projectViewModel.isLogin = true, + projectViewModel.isLogin = true, appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { diff --git a/lib/pages/settings/general_setting.dart b/lib/pages/settings/general_setting.dart index b8cf8742..275b8748 100644 --- a/lib/pages/settings/general_setting.dart +++ b/lib/pages/settings/general_setting.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:screen/screen.dart'; class GeneralSettings extends StatefulWidget { @override @@ -16,8 +17,11 @@ class _GeneralSettings extends State with TickerProviderStateMixin { var themeNotifier; int blindValue = 0; + bool vibration =false; + bool accessibility =false; + bool camera =false; + bool location =false ; Widget build(BuildContext context) { - bool isVibration = true; themeNotifier = Provider.of(context); return Container( @@ -36,12 +40,12 @@ class _GeneralSettings extends State child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(TranslationBase.of(context).vibration), + AppText(TranslationBase.of(context).vibration), Switch( - value: isVibration, + value: vibration, onChanged: (value) { setState(() { - isVibration = value; + vibration = value; }); }, activeTrackColor: Colors.lightGreenAccent, @@ -57,10 +61,10 @@ class _GeneralSettings extends State children: [ AppText(TranslationBase.of(context).accessibility), Switch( - value: isVibration, + value: accessibility, onChanged: (value) { setState(() { - isVibration = value; + accessibility = value; }); }, activeTrackColor: Colors.lightGreenAccent, @@ -96,7 +100,7 @@ class _GeneralSettings extends State value: 0, groupValue: blindValue, onChanged: (value) { - setState(() => {this.blindValue = value}); + setState(() => {this.blindValue = value}); setTheme(value); }, ), @@ -175,10 +179,10 @@ class _GeneralSettings extends State children: [ AppText(TranslationBase.of(context).cameraPermission), Switch( - value: isVibration, + value: camera, onChanged: (value) { setState(() { - isVibration = value; + camera = value; }); }, activeTrackColor: Colors.lightGreenAccent, @@ -194,10 +198,10 @@ class _GeneralSettings extends State children: [ AppText(TranslationBase.of(context).locationPermission), Switch( - value: isVibration, + value: location, onChanged: (value) { setState(() { - isVibration = value; + location = value; }); }, activeTrackColor: Colors.lightGreenAccent, @@ -212,15 +216,23 @@ class _GeneralSettings extends State switch (value) { case 0: themeNotifier.setTheme(defaultTheme); + Screen.setBrightness(1.0); break; case 1: themeNotifier.setTheme(invertTheme); + Screen.setBrightness(1.0); break; case 2: - themeNotifier.setTheme(dimTheme); + //themeNotifier.setTheme(dimTheme); + Screen.setBrightness(0.01); + break; + case 3: + themeNotifier.setTheme(bwTheme); + Screen.setBrightness(1.0); break; default: themeNotifier.setTheme(defaultTheme); + Screen.setBrightness(1.0); break; } } diff --git a/lib/theme/theme_value.dart b/lib/theme/theme_value.dart index 1d84ee11..703ea8f4 100644 --- a/lib/theme/theme_value.dart +++ b/lib/theme/theme_value.dart @@ -28,12 +28,13 @@ final defaultTheme = ThemeData( textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionHandleColor: Colors.grey, canvasColor: Colors.white, - backgroundColor: Color.fromRGBO(255, 255, 255, 1), + 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), @@ -47,70 +48,76 @@ final defaultTheme = ThemeData( final invertTheme = ThemeData( // fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', - primarySwatch: Colors.black, + primarySwatch: Colors.grey, visualDensity: VisualDensity.adaptivePlatformDensity, - brightness: Brightness.dark, + brightness: Brightness.light, pageTransitionsTheme: const PageTransitionsTheme( builders: { TargetPlatform.android: ZoomPageTransitionsBuilder(), TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), }, ), - hintColor: Colors.white, - disabledColor: Colors.white, + hintColor: Colors.grey[400], + cardColor: Colors.black, + buttonColor: Colors.grey[400], + disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), - scaffoldBackgroundColor: Color(0xffEEEEEE), + scaffoldBackgroundColor: Colors.grey, textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), - textSelectionHandleColor: Colors.white, + textSelectionHandleColor: Colors.grey, canvasColor: Colors.white, - backgroundColor: Color.fromRGBO(255, 255, 255, 1), + backgroundColor: Colors.grey, highlightColor: Colors.grey[100].withOpacity(0.4), splashColor: Colors.transparent, - primaryColor: Color(0xff40ACC9), + primaryColor: Colors.grey, bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), cursorColor: Colors.grey, + iconTheme: IconThemeData(), appBarTheme: AppBarTheme( - color: Color(0xff000000), + color: Colors.grey, brightness: Brightness.dark, - elevation: 5.0, + elevation: 10.0, actionsIconTheme: IconThemeData( - color: Color(0xff000000), + color: Colors.grey, ), ), ); -final dimTheme = ThemeData( +final bwTheme = ThemeData( // fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', - primarySwatch: Colors.blue, + primarySwatch: Colors.black54, visualDensity: VisualDensity.adaptivePlatformDensity, - brightness: Brightness.dark, + brightness: Brightness.light, pageTransitionsTheme: const PageTransitionsTheme( builders: { TargetPlatform.android: ZoomPageTransitionsBuilder(), TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), }, ), - hintColor: Colors.grey[400], - disabledColor: Colors.grey[300], + hintColor: Colors.black54, + cardColor:Colors.black54, + buttonColor: Colors.black54, + disabledColor: Colors.black54, errorColor: Color.fromRGBO(235, 80, 60, 1.0), - scaffoldBackgroundColor: Color(0xffEEEEEE), + scaffoldBackgroundColor: Colors.black54, textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), - textSelectionHandleColor: Colors.grey, - canvasColor: Colors.white, - backgroundColor: Color.fromRGBO(255, 255, 255, 1), + textSelectionHandleColor: Colors.black54, + canvasColor:Colors.black54, + backgroundColor: Colors.black54, highlightColor: Colors.grey[100].withOpacity(0.4), splashColor: Colors.transparent, - primaryColor: Color(0xff40ACC9), + primaryColor: Colors.black54, bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), - cursorColor: Colors.grey, + cursorColor: Colors.black54, + iconTheme: IconThemeData(), appBarTheme: AppBarTheme( - color: Color(0xff40ACC9), + color: Colors.black54, brightness: Brightness.dark, elevation: 10.0, actionsIconTheme: IconThemeData( - color: Color(0xff40ACC9), + color: Colors.black54, ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index 80855c8b..cef4f5b2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -139,7 +139,7 @@ dependencies: #Handle Geolocation geolocator: ^6.0.0+1 - + screen: ^0.0.5 #google maps places google_maps_place_picker: ^1.0.0