diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 62b6ab53..3d05f41b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -823,4 +823,41 @@ const Map localizedValues = { "ar": "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية." }, + "language-setting": { + "en": "SMS and Confirmation Calls Language", + "ar": "لغة الرسائل القصيرة و الاتصال الآلي" + }, + "alert": {"en": "Alerts", "ar": "التنبيهات"}, + "email-alert": { + "en": "Alert By Email", + "ar": "استلام التنبيهات بالبريد الالكتروني" + }, + "sms-alert": { + "en": "Alert By SMS", + "ar": "استلام التنبيهات بالرسائل القصيرة" + }, + "contact-info": {"en": "Contact Information", "ar": "معلومات التواصل"}, + "emrg-name": { + "en": "Emergency Contact Name", + "ar": "اسم للتواصل في حالة الطوارئ" + }, + "emrg-no": { + "en": "Emergency Contact Number", + "ar": "رقم للتواصل في حالة الطوارئ" + }, + "modes": {"en": "Modes", "ar": "الاوضاع"}, + "vibration": {"en": "Vibration Touch Feedback", "ar": "الاهتزاز عند اللمس"}, + "blind-modes": { + "en": "Modes for Partially Blind", + "ar": "تأثيرات لدعم ضعاف البصر" + }, + "invert-theme": {"en": "Invert", "ar": "ألوان سلبية"}, + "off-theme": {"en": "Off", "ar": "إيقاف"}, + "dim-theme": {"en": "Dim", "ar": "ضوء خافت"}, + "bw-theme": {"en": "Black and White", "ar": "أبيض و أسود"}, + "permissions": {"en": "Permission", "ar": "الصلاحيات"}, + "camera-permission": {"en": "Camera", "ar": "الكاميرا"}, + "location-permission": {"en": "Location", "ar": "تحديد المواقع"}, + + "accessibility": {"en": "Accessibility Mode", "ar": "وضع امكانية الوصول"}, }; diff --git a/lib/main.dart b/lib/main.dart index bd310dbc..8678cd83 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,7 +1,9 @@ +import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; +import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; @@ -14,13 +16,14 @@ import 'locator.dart'; void main() async { setupLocator(); - runApp(MyApp()); + runApp(ChangeNotifierProvider( + create: (_) => ThemeNotifier(defaultTheme), child: MyApp())); } class MyApp extends StatelessWidget { - /// static final _myTabbedPageKey = new GlobalKey<_LandingPageState>(); @override Widget build(BuildContext context) { + final themeNotifier = Provider.of(context); return LayoutBuilder( builder: (context, constraints) { return OrientationBuilder( @@ -58,40 +61,7 @@ class MyApp extends StatelessWidget { const Locale('ar', ''), // Arabic const Locale('en', ''), // English ], - theme: ThemeData( - fontFamily: projectProvider.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: Color.fromRGBO(255, 255, 255, 1), - highlightColor: Colors.grey[100].withOpacity(0.4), - splashColor: Colors.transparent, - primaryColor: Color(0xff40ACC9), - bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), - cursorColor: Colors.grey, - iconTheme: IconThemeData(), - appBarTheme: AppBarTheme( - color: Color(0xff40ACC9), - brightness: Brightness.dark, - elevation: 10.0, - actionsIconTheme: IconThemeData( - color: Color(0xff40ACC9), - ), - ), - ), + theme: themeNotifier.getTheme(), initialRoute: SPLASH, routes: routes, debugShowCheckedModeBanner: false, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index abb5c06a..b047885e 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -42,13 +42,13 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { ToDoCountProviderModel toDoProvider; - @override - void initState() { - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - getToDoCount(); - }); - super.initState(); - } + // @override + // void initState() { + // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + // getToDoCount(); + // }); + // super.initState(); + // } AuthenticatedUserObject authenticatedUserObject = locator(); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 609f6b2c..6c90e59f 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -83,7 +83,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { print(route.settings.name); } - setState(() { + //setState(() { print("didChangeAppLifecycleState"); print('state = $state'); AppGlobal.context = context; @@ -111,7 +111,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (state == AppLifecycleState.inactive) { isPageNavigated = false; } - }); + //}); } @override @@ -124,9 +124,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); - setState(() { + //setState(() { AppGlobal.context = context; - }); + // }); _requestIOSPermissions(); pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); @@ -137,7 +137,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.getToken().then((String token) { sharedPref.setString(PUSH_TOKEN, token); - if (token != null) { + if (token != null && DEVICE_TOKEN =="") { DEVICE_TOKEN = token; checkUserStatus(token); } @@ -425,11 +425,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) - authService.registeredAuthenticatedUser(data, token, 0, 0); - // setState(() { - // this.user = data; - // print(this.user); - // }); + authService + .registeredAuthenticatedUser(data, token, 0, 0) + .then((res) => {print(res)}); + } } diff --git a/lib/pages/settings/general_setting.dart b/lib/pages/settings/general_setting.dart index ef1ec052..b8cf8742 100644 --- a/lib/pages/settings/general_setting.dart +++ b/lib/pages/settings/general_setting.dart @@ -1,7 +1,11 @@ +import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; +import 'package:diplomaticquarterapp/theme/theme_value.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class GeneralSettings extends StatefulWidget { @override @@ -10,15 +14,18 @@ class GeneralSettings extends StatefulWidget { class _GeneralSettings extends State with TickerProviderStateMixin { + var themeNotifier; + int blindValue = 0; Widget build(BuildContext context) { bool isVibration = true; - var bindValue; + + themeNotifier = Provider.of(context); return Container( child: ListView(scrollDirection: Axis.vertical, children: [ Container( padding: EdgeInsets.all(10), child: AppText( - 'Modes', + TranslationBase.of(context).modes, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -29,7 +36,7 @@ class _GeneralSettings extends State child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Vibration touch feedback'), + Text(TranslationBase.of(context).vibration), Switch( value: isVibration, onChanged: (value) { @@ -48,7 +55,7 @@ class _GeneralSettings extends State child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Accsibility Mode'), + AppText(TranslationBase.of(context).accessibility), Switch( value: isVibration, onChanged: (value) { @@ -64,7 +71,7 @@ class _GeneralSettings extends State Container( padding: EdgeInsets.all(10), child: AppText( - 'Modes for Partially Blind', + TranslationBase.of(context).blindMode, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -82,14 +89,15 @@ class _GeneralSettings extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ new Text( - 'Off', + TranslationBase.of(context).offTheme, style: new TextStyle(fontSize: 16.0), ), - new Radio( + Radio( value: 0, - groupValue: bindValue, + groupValue: blindValue, onChanged: (value) { - bindValue = value; + setState(() => {this.blindValue = value}); + setTheme(value); }, ), ], @@ -98,16 +106,17 @@ class _GeneralSettings extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ new Text( - 'Invert', + TranslationBase.of(context).invertTheme, style: new TextStyle( fontSize: 16.0, ), ), new Radio( value: 1, - groupValue: bindValue, + groupValue: blindValue, onChanged: (value) { - bindValue = value; + setState(() => {this.blindValue = value}); + setTheme(value); }, ) ], @@ -116,14 +125,15 @@ class _GeneralSettings extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ new Text( - 'Dim', + TranslationBase.of(context).dimTheme, style: new TextStyle(fontSize: 16.0), ), new Radio( value: 2, - groupValue: bindValue, + groupValue: blindValue, onChanged: (value) { - bindValue = value; + setState(() => {this.blindValue = value}); + setTheme(value); }, ), ], @@ -132,14 +142,16 @@ class _GeneralSettings extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ new Text( - 'Black and White', + TranslationBase.of(context).bwTheme, style: new TextStyle(fontSize: 16.0), ), new Radio( - value: 2, - groupValue: bindValue, + value: 3, + groupValue: blindValue, onChanged: (value) { - bindValue = value; + setState(() => {this.blindValue = value}); + + setTheme(value); }, ), ], @@ -150,7 +162,7 @@ class _GeneralSettings extends State Container( padding: EdgeInsets.all(10), child: AppText( - 'Permission', + TranslationBase.of(context).permissions, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -161,7 +173,7 @@ class _GeneralSettings extends State child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Camera'), + AppText(TranslationBase.of(context).cameraPermission), Switch( value: isVibration, onChanged: (value) { @@ -180,7 +192,7 @@ class _GeneralSettings extends State child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Location'), + AppText(TranslationBase.of(context).locationPermission), Switch( value: isVibration, onChanged: (value) { @@ -195,4 +207,21 @@ class _GeneralSettings extends State )) ])); } + + setTheme(value) { + switch (value) { + case 0: + themeNotifier.setTheme(defaultTheme); + break; + case 1: + themeNotifier.setTheme(invertTheme); + break; + case 2: + themeNotifier.setTheme(dimTheme); + break; + default: + themeNotifier.setTheme(defaultTheme); + break; + } + } } diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index 3a8f01dc..0658e2e6 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -15,168 +17,180 @@ class _ProfileSettings extends State Widget build(BuildContext context) { bool isVibration = true; var language = 1; - return Container( - child: ListView(scrollDirection: Axis.vertical, children: [ - Container( - padding: EdgeInsets.all(15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - 'File No', - color: Colors.black, - ), - AppText( - '124545', - color: Colors.black, - ), - ], - ), - ), - SizedBox( - height: 1, - width: MediaQuery.of(context).size.width, - child: Container( - color: Colors.grey[300], - ), - ), - Padding( - child: AppText('SMS and Confirmation Calls Language ', - fontWeight: FontWeight.bold), - padding: EdgeInsets.all(10), - ), - Container( - color: Colors.white, - padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText('English'), - new Radio( - value: 2, - groupValue: language, - onChanged: (value) { - language = value; - }, - ) - ], - )), - Container( - color: Colors.white, - padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText('Arabic'), - new Radio( - value: 1, - groupValue: language, - onChanged: (value) { - language = value; - }, - ) - ], - )), - Padding( - child: AppText('Alert'), - padding: EdgeInsets.all(10), - ), - Container( - color: Colors.white, - padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText('Alert by Email'), - Switch( - value: isVibration, - onChanged: (value) { - setState(() { - isVibration = value; - }); - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )), - Container( - color: Colors.white, - padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText('Alert by SMS'), - Switch( - value: isVibration, - onChanged: (value) { - setState(() { - isVibration = value; - }); - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )), - Padding( - child: AppText('Alert'), - padding: EdgeInsets.all(10), - ), - Container( - color: Colors.white, - padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText('Email'), - TextField( - style: TextStyle(color: Colors.red), - ) - ], - )), - Container( - color: Colors.white, - padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText('Emergency contact name'), - TextField( - style: TextStyle(color: Colors.red), - decoration: InputDecoration( - suffixIcon: Icon(Icons.edit), - )) - ], - )), - Container( - color: Colors.white, - padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText('Emergency contact number'), - TextField( - style: TextStyle(color: Colors.red), - decoration: InputDecoration( - suffixIcon: Icon(Icons.edit), + return BaseView( + onModelReady: (model) => model.getPatientRadOrders(), + builder: (_, model, wi) => Container( + child: + ListView(scrollDirection: Axis.vertical, children: [ + Container( + padding: EdgeInsets.all(15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + ), + AppText( + model.user.patientID.toString(), + color: Colors.black, + ), + ], + ), + ), + SizedBox( + height: 1, + width: MediaQuery.of(context).size.width, + child: Container( + color: Colors.grey[300], ), - ) - ], - )), - Container( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).submit, - () { + ), + Padding( + child: AppText(TranslationBase.of(context).languageSetting, + fontWeight: FontWeight.bold), + padding: EdgeInsets.all(10), + ), + Container( + color: Colors.white, + padding: + EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).english), + new Radio( + value: 2, + groupValue: language, + onChanged: (value) { + language = value; + }, + ) + ], + )), + Container( + color: Colors.white, + padding: + EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).arabic), + new Radio( + value: 1, + groupValue: language, + onChanged: (value) { + language = value; + }, + ) + ], + )), + Padding( + child: AppText(TranslationBase.of(context).alert), + padding: EdgeInsets.all(10), + ), + Container( + color: Colors.white, + padding: + EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).emailAlert), + Switch( + value: isVibration, + onChanged: (value) { + setState(() { + isVibration = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + color: Colors.white, + padding: + EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).smsAlert), + Switch( + value: isVibration, + onChanged: (value) { + setState(() { + isVibration = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Padding( + child: AppText(TranslationBase.of(context).contactInfo), + padding: EdgeInsets.all(10), + ), + Container( + color: Colors.white, + padding: + EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).email), + TextField( + style: TextStyle(color: Colors.red), + decoration: InputDecoration( + suffixIcon: Icon(Icons.edit), + )) + ], + )), + Container( + color: Colors.white, + padding: + EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).emergencyName), + TextField( + style: TextStyle(color: Colors.red), + decoration: InputDecoration( + suffixIcon: Icon(Icons.edit), + )) + ], + )), + Container( + color: Colors.white, + padding: + EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).emergencyContact), + TextField( + style: TextStyle(color: Colors.red), + decoration: InputDecoration( + suffixIcon: Icon(Icons.edit), + ), + ) + ], + )), + Container( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).submit, + () { // print(mobileNo.text); - }, - )), - ], - )) - ])); + }, + )), + ], + )) + ]))); } } diff --git a/lib/theme/theme_notifier.dart b/lib/theme/theme_notifier.dart new file mode 100644 index 00000000..98e24cf5 --- /dev/null +++ b/lib/theme/theme_notifier.dart @@ -0,0 +1,15 @@ +import 'package:diplomaticquarterapp/theme/theme_value.dart'; +import 'package:flutter/material.dart'; + +class ThemeNotifier with ChangeNotifier { + ThemeData _themeData = defaultTheme; + + ThemeNotifier(this._themeData); + + getTheme() => _themeData; + + setTheme(ThemeData themeData) async { + _themeData = themeData; + notifyListeners(); + } +} diff --git a/lib/theme/theme_value.dart b/lib/theme/theme_value.dart new file mode 100644 index 00000000..1d84ee11 --- /dev/null +++ b/lib/theme/theme_value.dart @@ -0,0 +1,116 @@ +import 'dart:ui'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +/// ---- Default Theme ---- +/// + +//final projectProvider = Provider.of(AppGlobal.context); +final bluePrimary = Color(0xFF3F51B5); +final blueAccent = Color(0xFFFF9800); +final blueBackground = Color(0xFFFFFFFF); +final defaultTheme = ThemeData( + // fontFamily: projectProvider.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: Color.fromRGBO(255, 255, 255, 1), + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Color(0xff40ACC9), + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Color(0xff40ACC9), + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Color(0xff40ACC9), + ), + ), +); + +final invertTheme = ThemeData( + // fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', + primarySwatch: Colors.black, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.dark, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), + hintColor: Colors.white, + disabledColor: Colors.white, + errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Color(0xffEEEEEE), + textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + textSelectionHandleColor: Colors.white, + canvasColor: Colors.white, + backgroundColor: Color.fromRGBO(255, 255, 255, 1), + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Color(0xff40ACC9), + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Color(0xff000000), + brightness: Brightness.dark, + elevation: 5.0, + actionsIconTheme: IconThemeData( + color: Color(0xff000000), + ), + ), +); + +final dimTheme = ThemeData( + // fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', + primarySwatch: Colors.blue, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.dark, + 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: Color.fromRGBO(255, 255, 255, 1), + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Color(0xff40ACC9), + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Color(0xff40ACC9), + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Color(0xff40ACC9), + ), + ), +); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 6029f46d..a32f335f 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -776,6 +776,32 @@ class TranslationBase { localizedValues['month-report'][locale.languageCode]; String get infoMonthReport => localizedValues['info-month-report'][locale.languageCode]; + String get languageSetting => + localizedValues['language-setting'][locale.languageCode]; + String get alert => localizedValues['alert'][locale.languageCode]; + String get emailAlert => localizedValues['email-alert'][locale.languageCode]; + String get smsAlert => localizedValues['sms-alert'][locale.languageCode]; + String get contactInfo => + localizedValues['contact-info'][locale.languageCode]; + String get emergencyName => localizedValues['emrg-name'][locale.languageCode]; + String get emergencyContact => + localizedValues['emrg-no'][locale.languageCode]; + String get modes => localizedValues['modes'][locale.languageCode]; + String get vibration => localizedValues['vibration'][locale.languageCode]; + String get blindMode => localizedValues['blind-modes'][locale.languageCode]; + String get invertTheme => + localizedValues['invert-theme'][locale.languageCode]; + String get offTheme => localizedValues['off-theme'][locale.languageCode]; + String get dimTheme => localizedValues['dim-theme'][locale.languageCode]; + String get bwTheme => localizedValues['bw-theme'][locale.languageCode]; + + String get permissions => localizedValues['permissions'][locale.languageCode]; + String get cameraPermission => + localizedValues['camera-permission'][locale.languageCode]; + String get locationPermission => + localizedValues['location-permission'][locale.languageCode]; + String get accessibility => + localizedValues['accessibility'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {