diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 949c0629..b105cfef 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -683,5 +683,7 @@ const Map> localizedValues = { "Book": {"en": "Book", "ar": "احجز"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, "BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"}, - "marital-status": {"en": "Marital status", "ar": "الحالة الإجتماعية"} + "marital-status": {"en": "Marital status", "ar": "الحالة الإجتماعية"}, + "general": {"en": "General", "ar": "عام"}, + "profile": {"en": "Profile", "ar": "ملفي"}, }; diff --git a/lib/pages/settings/general_setting.dart b/lib/pages/settings/general_setting.dart new file mode 100644 index 00000000..3b0de399 --- /dev/null +++ b/lib/pages/settings/general_setting.dart @@ -0,0 +1,136 @@ +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'; + +class GeneralSettings extends StatefulWidget { + @override + _GeneralSettings createState() => _GeneralSettings(); +} + +class _GeneralSettings extends State + with TickerProviderStateMixin { + Widget build(BuildContext context) { + bool isVibration = true; + var bindValue; + return Container( + child: ListView(scrollDirection: Axis.vertical, children: [ + Container( + padding: EdgeInsets.all(10), + child: AppText( + 'Modes', + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + Container( + color: Colors.white, + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Vibration touch feedback'), + Switch( + value: isVibration, + onChanged: (value) { + setState(() { + isVibration = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Accsibility Mode'), + Switch( + value: isVibration, + onChanged: (value) { + setState(() { + isVibration = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + 'Modes for Partially Blind', + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + new Container( + color: Colors.white, + padding: EdgeInsets.all(8.0), + child: new Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + new Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + 'Carnivore', + style: new TextStyle(fontSize: 16.0), + ), + new Radio( + value: 0, + groupValue: bindValue, + onChanged: (value) { + bindValue = value; + }, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + 'Herbivore', + style: new TextStyle( + fontSize: 16.0, + ), + ), + new Radio( + value: 1, + groupValue: bindValue, + onChanged: (value) { + bindValue = value; + }, + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + 'Omnivore', + style: new TextStyle(fontSize: 16.0), + ), + new Radio( + value: 2, + groupValue: bindValue, + onChanged: (value) { + bindValue = value; + }, + ), + ], + ), + ], + ) + ])) + ])); + } +} diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart new file mode 100644 index 00000000..7a3fceab --- /dev/null +++ b/lib/pages/settings/profile_setting.dart @@ -0,0 +1,53 @@ +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ProfileSettings extends StatefulWidget { + @override + _ProfileSettings createState() => _ProfileSettings(); +} + +class _ProfileSettings extends State + with TickerProviderStateMixin { + Widget build(BuildContext context) { + bool isVibration = true; + return Container( + child: ListView(scrollDirection: Axis.vertical, children: [ + Text('Mode'), + Container( + color: Colors.white, + child: Row( + children: [ + Text('Vibration touch feedback'), + Switch( + value: isVibration, + onChanged: (value) { + setState(() { + isVibration = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + color: Colors.white, + child: Row( + children: [ + Text('Accsibility Mode'), + Switch( + value: isVibration, + onChanged: (value) { + setState(() { + isVibration = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )) + ])); + } +} diff --git a/lib/pages/settings/settings.dart b/lib/pages/settings/settings.dart new file mode 100644 index 00000000..abdac118 --- /dev/null +++ b/lib/pages/settings/settings.dart @@ -0,0 +1,55 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/pages/settings/profile_setting.dart'; +import 'package:diplomaticquarterapp/pages/settings/general_setting.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; +import 'package:flutter/material.dart'; + +class Settings extends StatefulWidget { + final int type; + + Settings({this.type = 0}); + @override + _Settings createState() => _Settings(); +} + +class _Settings extends State with TickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + _tabController = + new TabController(length: 2, vsync: this, initialIndex: widget.type); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + AppGlobal.context = context; + return Scaffold( + appBar: AppBar( + bottom: TabBar( + tabs: [ + Tab(text: TranslationBase.of(context).general), + Tab( + text: TranslationBase.of(context).profile, + ) + ], + controller: _tabController, + ), + title: Text(TranslationBase.of(context).settings, + style: TextStyle(color: Colors.white)), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), + ), + body: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [GeneralSettings(), ProfileSettings()], + controller: _tabController), + ); + } +} diff --git a/lib/routes.dart b/lib/routes.dart index 8a0619e6..bab86a25 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/login/login.dart'; import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/pages/family/add-family_type.dart'; import 'package:diplomaticquarterapp/pages/family/add-family-member.dart'; +import 'package:diplomaticquarterapp/pages/settings/settings.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart'; @@ -33,6 +34,7 @@ const String LIVE_CARE = 'live-care'; const String SYMPTOM_CHECKER = 'symptom-checker'; const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info'; const String SELECT_GENDER = 'select-gender'; +const String SETTINGS = 'settings'; var routes = { SPLASH: (_) => SplashScreen(), HOME: (_) => LandingPage(), @@ -49,5 +51,6 @@ var routes = { LIVE_CARE: (_) => LiveCareHome(), SYMPTOM_CHECKER: (_) => SymptomChecker(), SYMPTOM_CHECKER_INFO: (_) => SymptomInfo(), - SELECT_GENDER: (_) => SelectGender() + SELECT_GENDER: (_) => SelectGender(), + SETTINGS: (_) => Settings() }; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 551cd8ff..50ea757e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -738,6 +738,8 @@ class TranslationBase { localizedValues['loginToUseService'][locale.languageCode]; String get maritalStatus => localizedValues['marital-status'][locale.languageCode]; + String get general => localizedValues['general'][locale.languageCode]; + String get profile => localizedValues['profile'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 1a973864..c510720c 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -99,7 +99,8 @@ class _AppDrawerState extends State { 'File No:' + user.patientID .toString(), - color: Color(0xFF40ACC9), + color: + Color(0xFF40ACC9), fontSize: SizeConfig .textMultiplier * 1.5, @@ -249,7 +250,7 @@ class _AppDrawerState extends State { Icons.settings_input_composite), onTap: () { Navigator.of(context).pushNamed( - WELCOME_LOGIN, + SETTINGS, ); }, ),