Merge branch 'mirza_home_page' into development_new_design_2.0

# Conflicts:
#	lib/config/localized_values.dart
#	lib/uitl/translations_delegate_base.dart
merge-requests/439/merge
Sikander Saleem 3 years ago
commit 8f371f87d2

@ -911,14 +911,14 @@ const Map localizedValues = {
"info-todo": { "info-todo": {
"en": "This service is designed to enable you to have a quick link to the list of tasks that need to be done", "en": "This service is designed to enable you to have a quick link to the list of tasks that need to be done",
"ar": "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" "ar": "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها"
},
"family-info": { "family-info": {
"en": "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", "en": "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.",
"ar": "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." "ar": "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
}, },
"update-succ": {"en": "Successfully updated profile", "ar": "تم تحديث البيانات بنجاح"}, "update-succ": {"en": "Successfully updated profile", "ar": "تم تحديث البيانات بنجاح"},
"dental-complains": {"en": "Symptoms", "ar": "الأعراض"}, "dental-complains": {"en": "Symptoms", "ar": "الأعراض"},
"empty-result": {"en": "There is no search results found", "ar": "لايوجد نتائج"}, "empt},y-result": {"en": "There is no search results found", "ar": "لايوجد نتائج"},
"no-booked-appointment": {"en": "No booked appointments", "ar": "لا يوجد مواعيد محجوزة"}, "no-booked-appointment": {"en": "No booked appointments", "ar": "لا يوجد مواعيد محجوزة"},
"no-confirmed-appointment": {"en": "No confirmed appointments", "ar": "لا توجد مواعيد مؤكدة"}, "no-confirmed-appointment": {"en": "No confirmed appointments", "ar": "لا توجد مواعيد مؤكدة"},
"no-arrived-appointment": {"en": "No arrived appointments", "ar": "لا يوجد مواعيد"}, "no-arrived-appointment": {"en": "No arrived appointments", "ar": "لا يوجد مواعيد"},
@ -1497,7 +1497,12 @@ const Map localizedValues = {
"years": {"en": "Years", "ar": "سنوات"}, "years": {"en": "Years", "ar": "سنوات"},
"respirationBPM": {"en": "bpm", "ar": "نفس"}, "respirationBPM": {"en": "bpm", "ar": "نفس"},
"extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"}, "extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"},
"invoiceDetails": { "en": "Invoice Details", "ar": "تفاصيل الفاتورة" }, "selectLanguage": { "en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة" },
"appoDetails": {"en": "Appointment Details", "ar": "تفاصيل الموعد"}, "recAlert": { "en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟" },
"appoPaymentConfirm": {"en": "Are you sure you Want to make payment for this appointment?", "ar": "هل أنت متأكد من أنك تريد سداد هذا الموعد؟"}, "modesBelow": { "en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه" },
"prefferedMode": { "en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه" },
"permissionsBellow": { "en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه" },
"invoiceDetails": { "en": "Invoice Details", "ar": "تفاصيل الفاتورة" },
"appoDetails": {"en": "Appointment Details", "ar": "تفاصيل الموعد"},
"appoPaymentConfirm": {"en": "Are you sure you Want to make payment for this appointment?", "ar": "هل أنت متأكد من أنك تريد سداد هذا الموعد؟"},
}; };

@ -244,10 +244,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
imageLocation: 'assets/images/emergency_service_image.png', imageLocation: 'assets/images/emergency_service_image.png',
title: TranslationBase.of(context).emergencyService, title: TranslationBase.of(context).emergencyService,
), ),
ServicesContainer( ServicesContainer(onTap: () => getPharmacyToken(), imageLocation: 'assets/images/pharmacy_logo.png', title: TranslationBase.of(context).pharmacy),
onTap: () => getPharmacyToken(),
imageLocation: 'assets/images/pharmacy_logo.png',
title: TranslationBase.of(context).pharmacy),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -332,9 +329,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(page: SmartWatchInstructions()),
page: SmartWatchInstructions()
),
), ),
imageLocation: 'assets/images/new-design/smartwatch_icon.png', imageLocation: 'assets/images/new-design/smartwatch_icon.png',
title: TranslationBase.of(context).smartWatches, title: TranslationBase.of(context).smartWatches,

@ -102,13 +102,18 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
LocationUtils locationUtils; LocationUtils locationUtils;
Future<bool> onWillPop() { Future<bool> onWillPop() {
DateTime now = DateTime.now(); if (currentTab != 0) {
if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) { changeCurrentTab(0);
currentBackPressTime = now;
AppToast.showToast(message: TranslationBase.of(context).pressAgain);
return Future.value(false); return Future.value(false);
} else {
DateTime now = DateTime.now();
if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) {
currentBackPressTime = now;
AppToast.showToast(message: TranslationBase.of(context).pressAgain);
return Future.value(false);
}
return Future.value(true);
} }
return Future.value(true);
} }
changeCurrentTab(int tab) { changeCurrentTab(int tab) {
@ -610,21 +615,28 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
changeCurrentTab(1); changeCurrentTab(1);
}, },
), ),
MedicalProfilePageNew(onTap: (){ MedicalProfilePageNew(
changeCurrentTab(0); onTap: () {
},), changeCurrentTab(0);
Search(onBackClick: (){ },
changeCurrentTab(0); ),
},), Search(
onBackClick: () {
changeCurrentTab(0);
},
),
MyFamily( MyFamily(
isAppbarVisible: false, isAppbarVisible: false,
onBackClick: () { onBackClick: () {
changeCurrentTab(0); changeCurrentTab(0);
}, },
), ),
ToDo(isShowAppBar: true,onBackClick: (){ ToDo(
changeCurrentTab(0); isShowAppBar: true,
},), onBackClick: () {
changeCurrentTab(0);
},
),
], // Please do not remove the BookingOptions from this array ], // Please do not remove the BookingOptions from this array
), ),
RobotIcon() RobotIcon()

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart';
import 'package:diplomaticquarterapp/widgets/charts/sync_fu_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -49,15 +50,19 @@ class _VitalSingChartAndDetialsState extends State<VitalSingChartAndDetials> {
return SingleChildScrollView( return SingleChildScrollView(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Card( Container(
shape: cardRadius(12), height: 400,
elevation: 1, child: Card(
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), shape: cardRadius(12),
child: ShowChart( elevation: 1,
title: widget.name, margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
timeSeries: timeSeriesData, child: ShowChart(
indexes: timeSeriesData.length ~/ 5.5, title: widget.name,
horizontalInterval: 8, timeSeries: timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5,
horizontalInterval: 8,
),
// child: SyncFuChart(),
), ),
), ),
Card( Card(

@ -1,9 +1,11 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -16,8 +18,7 @@ class GeneralSettings extends StatefulWidget {
_GeneralSettings createState() => _GeneralSettings(); _GeneralSettings createState() => _GeneralSettings();
} }
class _GeneralSettings extends State<GeneralSettings> 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;
@ -28,6 +29,7 @@ class _GeneralSettings extends State<GeneralSettings>
var permission = new PermissionService(); var permission = new PermissionService();
LocationPermission locationPermission; LocationPermission locationPermission;
var mediaQueryData; var mediaQueryData;
@override @override
void initState() { void initState() {
this.getValues(); this.getValues();
@ -38,196 +40,243 @@ class _GeneralSettings extends State<GeneralSettings>
mediaQueryData = MediaQuery.of(context); mediaQueryData = MediaQuery.of(context);
themeNotifier = Provider.of<ThemeNotifier>(context); themeNotifier = Provider.of<ThemeNotifier>(context);
return Container( return Container(
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[ child: SingleChildScrollView(
Container( child: Padding(
color: Theme.of(context).scaffoldBackgroundColor, padding: const EdgeInsets.all(21.0),
padding: EdgeInsets.all(10), child: Column(
child: AppText( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).modes, children: <Widget>[
fontWeight: FontWeight.bold,
), Text(
), TranslationBase.of(context).alert,
Container( style: TextStyle(
color: Theme.of(context).scaffoldBackgroundColor, fontSize: 16,
padding: EdgeInsets.all(10), fontWeight: FontWeight.w600,
child: Row( letterSpacing: -0.64,
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: [ ),
AppText(TranslationBase.of(context).vibration), Text(
Switch( TranslationBase.of(context).modesBelow,
value: vibration, style: TextStyle(
onChanged: (value) { fontSize: 12,
setState(() { fontWeight: FontWeight.w600,
vibration = value; letterSpacing: -0.48,
}); ),
setVibration(value); ),
}, Row(
activeTrackColor: Colors.lightGreenAccent, children: [
activeColor: Colors.green, Checkbox(
) value: vibration,
], onChanged: (value) {
)), setState(() {
Container( vibration = value;
color: Theme.of(context).scaffoldBackgroundColor, });
padding: EdgeInsets.all(10), },
child: Row( activeColor: CustomColors.accentColor,
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: [ Text(
AppText(TranslationBase.of(context).accessibility), TranslationBase.of(context).prefferedMode,
Switch( style: TextStyle(
value: accsibility, fontSize: 12,
onChanged: (value) { letterSpacing: -0.48,
setState(() {
accsibility = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context).blindMode,
fontWeight: FontWeight.bold,
),
),
new Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(8.0),
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new Text(
TranslationBase.of(context).offTheme,
style: new TextStyle(fontSize: 16.0),
),
Radio(
value: 0,
groupValue: blindValue,
onChanged: (value) {
setState(() => {this.blindValue = value});
setTheme(value);
},
),
],
), ),
Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, ],
children: [ ),
new Text( Row(
TranslationBase.of(context).invertTheme, children: [
style: new TextStyle( Checkbox(
fontSize: 16.0, value: accsibility,
), onChanged: (value) {
), setState(() {
new Radio( accsibility = value;
value: 1, });
groupValue: blindValue, },
onChanged: (value) { activeColor: CustomColors.accentColor,
setState(() => {this.blindValue = value}); ),
setTheme(value); Text(
}, TranslationBase.of(context).accessibility,
) style: TextStyle(
], fontSize: 12,
letterSpacing: -0.48,
), ),
Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, ],
children: [ ),
new Text( mHeight(16),
TranslationBase.of(context).dimTheme, mHeight(12),
style: new TextStyle(fontSize: 16.0), Text(
TranslationBase.of(context).blindMode,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
),
Text(
TranslationBase.of(context).prefferedMode,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
Column(
children: [
Row(
children: [
new Radio(
value: 0,
groupValue: blindValue,
onChanged: (value) {
setState(() {
blindValue = value;
setTheme(value);
});
},
),
Text(
TranslationBase.of(context).offTheme,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
), ),
new Radio( ),
value: 2, ],
groupValue: blindValue, ),
onChanged: (value) { Row(
setState(() => {this.blindValue = value}); children: [
Radio(
value: 1,
groupValue: blindValue,
onChanged: (value) {
setState(() {
blindValue = value;
setTheme(value); setTheme(value);
}, });
},
),
Text(
TranslationBase.of(context).invertTheme,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
), ),
], ),
), ],
Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, Row(
children: [ children: [
new Text( Radio(
TranslationBase.of(context).bwTheme, value: 2,
style: new TextStyle(fontSize: 16.0), groupValue: blindValue,
onChanged: (value) {
setState(() {
blindValue = value;
setTheme(value);
});
},
),
Text(
TranslationBase.of(context).dimTheme,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
), ),
new Radio( ),
value: 3, ],
groupValue: blindValue, ),
onChanged: (value) { Row(
setState(() => {this.blindValue = value}); children: [
Radio(
value: 1,
groupValue: blindValue,
onChanged: (value) {
setState(() {
blindValue = value;
setTheme(value); setTheme(value);
}, });
},
),
Text(
TranslationBase.of(context).bwTheme,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
), ),
], ),
],
),
],
),
mHeight(12),
mHeight(12),
Text(
TranslationBase.of(context).permissions,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
),
Text(
TranslationBase.of(context).permissionsBellow,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
Row(
children: [
Checkbox(
value: camera,
onChanged: (value) {
setState(() {
camera = value;
});
this.permission.openSettings();
},
activeColor: CustomColors.accentColor,
),
Text(
TranslationBase.of(context).cameraPermission,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Checkbox(
value: location,
onChanged: (value) {
if (value == true) {
Navigator.pop(context);
this.setLocationPermission();
} else {
Geolocator.openLocationSettings();
}
},
activeColor: CustomColors.accentColor,
),
Text(
TranslationBase.of(context).locationPermission,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
), ),
], ),
) ],
])), ),
Container( mHeight(16),
color: Theme.of(context).scaffoldBackgroundColor, ],
padding: EdgeInsets.all(10), ),
child: AppText(
TranslationBase.of(context).permissions,
fontWeight: FontWeight.bold,
), ),
), ),
Container( );
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).cameraPermission),
Switch(
value: camera,
onChanged: (value) {
setState(() {
camera = value;
});
this.permission.openSettings();
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).locationPermission),
Switch(
value: location,
onChanged: (value) {
if (value == true) {
Navigator.pop(context);
this.setLocationPermission();
} else {
Geolocator.openLocationSettings();
}
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
))
]));
} }
setLocationPermission() async { setLocationPermission() async {
@ -292,11 +341,8 @@ class _GeneralSettings extends State<GeneralSettings>
getValues() async { getValues() async {
if (permission.isThemeEnabled() != null) { if (permission.isThemeEnabled() != null) {
blindValue = blindValue = permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled();
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;
//setTheme(blindValue); //setTheme(blindValue);
} }
@ -310,19 +356,11 @@ class _GeneralSettings extends State<GeneralSettings>
getTheme(value) async { getTheme(value) async {
if (value == 1) { if (value == 1) {
return invertThemes( return invertThemes(fontName: Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 'Cairo' : 'Poppins');
fontName: Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 'Cairo' : 'Poppins'
);
} else if (value == 3) { } else if (value == 3) {
return bwThemes( return bwThemes(fontName: Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 'Cairo' : 'Poppins');
fontName: Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 'Cairo' : 'Poppins'
);
} else { } else {
return defaultTheme( return defaultTheme(fontName: Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 'Cairo' : 'Poppins');
fontName:
Provider.of<ProjectViewModel>(context, listen: false).isArabic
? 'Cairo'
: 'Poppins');
} }
} }
} }

@ -2,9 +2,11 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -16,8 +18,7 @@ class ProfileSettings extends StatefulWidget {
_ProfileSettings createState() => _ProfileSettings(); _ProfileSettings createState() => _ProfileSettings();
} }
class _ProfileSettings extends State<ProfileSettings> class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMixin {
with TickerProviderStateMixin {
bool smsAlert = true; bool smsAlert = true;
bool emailAlert = true; bool emailAlert = true;
int language = 1; int language = 1;
@ -25,6 +26,7 @@ class _ProfileSettings extends State<ProfileSettings>
TextEditingController emergencyContact = new TextEditingController(); TextEditingController emergencyContact = new TextEditingController();
TextEditingController emailController = new TextEditingController(); TextEditingController emailController = new TextEditingController();
TextEditingController emergencyContactName = new TextEditingController(); TextEditingController emergencyContactName = new TextEditingController();
@override @override
void initState() { void initState() {
Future.delayed(new Duration(seconds: 0), () { Future.delayed(new Duration(seconds: 0), () {
@ -37,199 +39,300 @@ class _ProfileSettings extends State<ProfileSettings>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => {}, onModelReady: (model) => {},
builder: (_, model, wi) => Container( builder: (_, model, wi) => Container(
child: model.user != null child: model.user != null
? ListView(scrollDirection: Axis.vertical, children: <Widget>[ ? Column(
Container( children: [
color: Theme.of(context).textTheme.headline2.color, Expanded(
padding: EdgeInsets.all(15), child: SingleChildScrollView(
child: Row( child: Padding(
mainAxisAlignment: MainAxisAlignment.spaceBetween, padding: const EdgeInsets.all(21.0),
children: [ child: Column(
AppText( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).fileNo, children: <Widget>[
color: Colors.black, Card(
), shape: cardRadius(8),
AppText( margin: EdgeInsets.zero,
model.user.patientID.toString(), elevation: 3,
color: Colors.black, child: Padding(
), padding: const EdgeInsets.all(12.0),
], child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).fileNo + ": ",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
),
Text(
model.user.patientID.toString(),
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
),
],
),
),
),
mHeight(12),
Text(
TranslationBase.of(context).languageSetting,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
),
Text(
TranslationBase.of(context).selectLanguage,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
Row(
children: [
Expanded(
child: Row(
children: [
new Radio(
value: 2,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
),
Text(
TranslationBase.of(context).english,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
),
Expanded(
child: Row(
children: [
Radio(
value: 1,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
),
Text(
TranslationBase.of(context).arabic,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
),
],
),
mHeight(12),
Text(
TranslationBase.of(context).alert,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
),
Text(
TranslationBase.of(context).recAlert,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
Row(
children: [
Checkbox(
value: emailAlert,
onChanged: (value) {
setState(() {
emailAlert = value;
});
},
activeColor: CustomColors.accentColor,
),
Text(
TranslationBase.of(context).emailAlert,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Checkbox(
value: smsAlert,
onChanged: (value) {
setState(() {
smsAlert = value;
});
},
activeColor: CustomColors.accentColor,
),
Text(
TranslationBase.of(context).smsAlert,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
mHeight(16),
Text(
TranslationBase.of(context).contactInfo,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
),
mHeight(12),
inputWidget(TranslationBase.of(context).email, "", emailController),
mHeight(8),
inputWidget(TranslationBase.of(context).emergencyName, "", emergencyContactName),
mHeight(8),
inputWidget(TranslationBase.of(context).emergencyContact, "", emergencyContact),
mHeight(8),
],
),
), ),
), ),
SizedBox( ),
height: 1, Container(
width: MediaQuery.of(context).size.width, width: double.infinity,
child: Container( child: Card(
color: Colors.grey[300], margin: EdgeInsets.zero,
elevation: 20,
child: Padding(
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 16),
child: DefaultButton(
TranslationBase.of(context).save,
() {
saveSettings();
},
),
), ),
), ),
Padding( ),
child: AppText( ],
TranslationBase.of(context).languageSetting, )
fontWeight: FontWeight.bold), : Center(
padding: EdgeInsets.all(10), child: AppText(TranslationBase.of(context).loginToUseService),
),
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
Container( ),
color: Theme.of(context).textTheme.headline2.color, TextField(
padding: EdgeInsets.only( enabled: isEnable,
top: 0, left: 10, right: 10, bottom: 0), scrollPadding: EdgeInsets.zero,
child: Row( keyboardType: TextInputType.number,
mainAxisAlignment: MainAxisAlignment.spaceBetween, controller: _controller,
children: [ // onChanged: (value) => {validateForm()},
AppText(TranslationBase.of(context).english), style: TextStyle(
new Radio( fontSize: 14,
value: 2, height: 21 / 14,
groupValue: language, fontWeight: FontWeight.w400,
onChanged: (value) { color: Color(0xff2B353E),
setState(() { letterSpacing: -0.44,
language = value;
});
},
)
],
)),
Container(
color: Theme.of(context).textTheme.headline2.color,
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) {
setState(() {
language = value;
});
},
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).alert),
padding: EdgeInsets.all(10),
), ),
Container( decoration: InputDecoration(
color: Theme.of(context).textTheme.headline2.color, isDense: true,
padding: EdgeInsets.only( hintText: _hintText,
top: 0, left: 10, right: 10, bottom: 0), hintStyle: TextStyle(
child: Row( fontSize: 14,
mainAxisAlignment: MainAxisAlignment.spaceBetween, height: 21 / 14,
children: [ fontWeight: FontWeight.w400,
AppText(TranslationBase.of(context).emailAlert), color: Color(0xff575757),
Switch( letterSpacing: -0.56,
value: emailAlert, ),
onChanged: (value) { prefixIconConstraints: BoxConstraints(minWidth: 50),
setState(() { prefixIcon: prefix == null
emailAlert = value; ? null
}); : Text(
}, "+" + prefix,
activeTrackColor: Colors.lightGreenAccent, style: TextStyle(
activeColor: Colors.green, fontSize: 14,
) height: 21 / 14,
], fontWeight: FontWeight.w500,
)), color: Color(0xff2E303A),
Container( letterSpacing: -0.56,
color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).smsAlert),
Switch(
value: smsAlert,
onChanged: (value) {
setState(() {
smsAlert = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).contactInfo),
padding: EdgeInsets.all(10),
),
Container(
color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).email),
TextField(
controller: emailController,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).emergencyName),
TextField(
controller: emergencyContactName,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Theme.of(context).textTheme.headline2.color,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).emergencyContact),
TextField(
controller: emergencyContact,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
), ),
) ),
], contentPadding: EdgeInsets.zero,
)), border: InputBorder.none,
Container( focusedBorder: InputBorder.none,
padding: EdgeInsets.all(10), enabledBorder: InputBorder.none,
child: Row( ),
children: <Widget>[ ),
Expanded( ],
child: DefaultButton( ),
TranslationBase.of(context).save, ),
() { if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
saveSettings(); ],
}, ),
)), ),
], );
))
])
: Center(
child:
AppText(TranslationBase.of(context).loginToUseService),
)));
} }
getSettings(context) { getSettings(context) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.getSettings().then((result) => { authService.getSettings().then((result) => {GifLoaderDialogUtils.hideDialog(context), setValue(result["PateintInfoForUpdateList"][0])});
GifLoaderDialogUtils.hideDialog(context),
setValue(result["PateintInfoForUpdateList"][0])
});
} }
setValue(value) { setValue(value) {
@ -252,10 +355,6 @@ class _ProfileSettings extends State<ProfileSettings>
request["IsEmailAlertRequired"] = this.emailAlert; request["IsEmailAlertRequired"] = this.emailAlert;
request["IsSMSAlertRequired"] = this.smsAlert; request["IsSMSAlertRequired"] = this.smsAlert;
request["PreferredLanguage"] = this.language.toString(); request["PreferredLanguage"] = this.language.toString();
authService.saveSettings(request).then((result) => { authService.saveSettings(request).then((result) => {AppToast.showSuccessToast(message: TranslationBase.of(context).profileUpdate), GifLoaderDialogUtils.hideDialog(context)});
AppToast.showSuccessToast(
message: TranslationBase.of(context).profileUpdate),
GifLoaderDialogUtils.hideDialog(context)
});
} }
} }

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/pages/settings/general_setting.dart'; import 'package:diplomaticquarterapp/pages/settings/general_setting.dart';
import 'package:diplomaticquarterapp/pages/settings/profile_setting.dart'; import 'package:diplomaticquarterapp/pages/settings/profile_setting.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -9,6 +11,7 @@ class Settings extends StatefulWidget {
final int type; final int type;
Settings({this.type = 0}); Settings({this.type = 0});
@override @override
_Settings createState() => _Settings(); _Settings createState() => _Settings();
} }
@ -18,8 +21,7 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
@override @override
void initState() { void initState() {
_tabController = _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type);
new TabController(length: 2, vsync: this, initialIndex: widget.type);
if (widget.type == 1) { if (widget.type == 1) {
_tabController.animateTo(1); _tabController.animateTo(1);
@ -31,45 +33,45 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
return Scaffold( return AppScaffold(
appBar: AppBar( isShowAppBar: false,
actions: [ isShowDecPage: false,
IconButton( showNewAppBarTitle: true,
icon: Icon(Icons.info, color: Colors.white), showNewAppBar: true,
onPressed: () { appBarTitle: TranslationBase.of(context).settings,
//openInfoPage() backgroundColor: Color(0xFFF7F7F7),
}, body: Column(
) children: [
], TabBar(
bottom: TabBar( // isScrollable: true,
// isScrollable: true,
indicatorWeight: 5.0, indicatorWeight: 3.0,
//indicatorSize: TabBarIndicatorSize.label, //indicatorSize: TabBarIndicatorSize.label,
// indicatorSize: TabBarIndicatorSize.tab, // indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Theme.of(context).primaryColor, indicatorColor: CustomColors.accentColor,
// labelColor: Theme.of(context).primaryColor, labelColor: Colors.black,
tabs: [ unselectedLabelColor: CustomColors.grey,
Tab(text: TranslationBase.of(context).general), // labelColor: Theme.of(context).primaryColor,
Tab( tabs: [
text: TranslationBase.of(context).profile, Tab(text: TranslationBase.of(context).general),
) Tab(
], text: TranslationBase.of(context).profile,
controller: _tabController, )
), ],
title: Text(TranslationBase.of(context).settings, controller: _tabController,
style: TextStyle(color: Colors.white)), ),
leading: Builder( Expanded(
builder: (BuildContext context) { child: TabBarView(
return ArrowBack(); physics: NeverScrollableScrollPhysics(),
}, children: [
), GeneralSettings(),
ProfileSettings(),
],
controller: _tabController),
),
],
), ),
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [GeneralSettings(), ProfileSettings()],
controller: _tabController),
); );
} }
} }

@ -2361,14 +2361,19 @@ class TranslationBase {
String get selectSlot => localizedValues["selectSlot"][locale.languageCode]; String get selectSlot => localizedValues["selectSlot"][locale.languageCode];
String get selectLanguage => localizedValues["selectLanguage"][locale.languageCode];
String get recAlert => localizedValues["recAlert"][locale.languageCode];
String get modesBelow => localizedValues["modesBelow"][locale.languageCode];
String get prefferedMode => localizedValues["prefferedMode"][locale.languageCode];
String get permissionsBellow => localizedValues["permissionsBellow"][locale.languageCode];
String get invoiceDetails => localizedValues["invoiceDetails"][locale.languageCode]; String get invoiceDetails => localizedValues["invoiceDetails"][locale.languageCode];
String get appoDetails => localizedValues["appoDetails"][locale.languageCode]; String get appoDetails => localizedValues["appoDetails"][locale.languageCode];
String get appoPaymentConfirm => localizedValues["appoPaymentConfirm"][locale.languageCode]; String get appoPaymentConfirm => localizedValues["appoPaymentConfirm"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -0,0 +1,52 @@
// import 'package:flutter/material.dart';
// import 'package:syncfusion_flutter_charts/charts.dart';
// import 'package:syncfusion_flutter_charts/sparkcharts.dart';
//
// class SyncFuChart extends StatelessWidget {
// List<_SalesData> data = [
// _SalesData('Jan', 35),
// _SalesData('Feb', 28),
// _SalesData('Mar', 34),
// _SalesData('Apr', 32),
// _SalesData('May', 40),
// ];
//
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// body: Column(
// children: [
// //Initialize the chart widget
// SfCartesianChart(
//
// primaryXAxis: CategoryAxis(),
// primaryYAxis: CategoryAxis(minimum: 28),
// // Chart title
// title: ChartTitle(text: 'Half yearly sales analysis'),
// // Enable legend
// legend: Legend(isVisible: true),
// // Enable tooltip
// tooltipBehavior: TooltipBehavior(enable: true),
// series: <ChartSeries<_SalesData, String>>[
// LineSeries<_SalesData, String>(
// dataSource: data,
// xValueMapper: (_SalesData sales, _) => sales.year,
// yValueMapper: (_SalesData sales, _) => sales.sales,
// name: 'Sales',
// // Enable data label
// dataLabelSettings: DataLabelSettings(isVisible: true),
// ),
// ],
// ),
// ],
// ),
// );
// }
// }
//
// class _SalesData {
// _SalesData(this.year, this.sales);
//
// final String year;
// final double sales;
// }

@ -104,6 +104,7 @@ dependencies:
# Calendar # Calendar
# table_calendar: ^2.3.0 # table_calendar: ^2.3.0
syncfusion_flutter_calendar: ^18.4.49 syncfusion_flutter_calendar: ^18.4.49
# syncfusion_flutter_charts: any
# SVG Images # SVG Images
flutter_svg: ^0.18.0 flutter_svg: ^0.18.0

Loading…
Cancel
Save