diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e3344b0e..b7670c0e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1814,7 +1814,7 @@ const Map localizedValues = { "drinking": {"en": "Drinkning", "ar": "الشرب"}, "remaining": {"en": "Remaining", "ar": "المتبقي"}, "taken": {"en": "Taken", "ar": " مأخوذ"}, - "ml": {"en": "ml", "ar": "مل"}, + "ml": {"en": "ML", "ar": "مل"}, "l": {"en": "L", "ar": "لتر"}, "custom-label": {"en": "Enter amount", "ar": "أدخل كمية الماء"}, "custom-label-in-litres": { diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index caada21f..6e761991 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -29,3 +29,4 @@ const BLOOD_TYPE = 'blood-type'; const NOTIFICATION_COUNT = 'notification-count'; const PHARMACY_SELECTED_ADDRESS = 'selected-address'; const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN'; +const H2O_UNIT = 'H2O_UNIT'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index f12ef3da..03f12df1 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -68,7 +68,7 @@ class BaseAppClient { body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; - body['LanguageID'] = languageID == 'ar' ? 1 : 2; + body['LanguageID'] = (languageID == 'ar' ? 1 : 2); body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; diff --git a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart index a89ec799..9d163a27 100644 --- a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:charts_flutter/flutter.dart' as charts; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import '../../../locator.dart'; +import 'dart:math' as math; class H2OViewModel extends BaseViewModel { H2OService _h2OService = locator(); @@ -91,11 +92,21 @@ class H2OViewModel extends BaseViewModel { _h2OService.userProgressForWeekDataList.forEach((UserProgressForWeekDataModel data) { globalData.add(new ChartSeries(data.dayName, data.percentageConsumed)); }); + Iterable minMaxList = globalData.map((e) => e.x).toList(); + int maxValue = minMaxList.isEmpty ? 0 : minMaxList.reduce(math.max); + int minValue = minMaxList.isEmpty ? 0 : minMaxList.reduce(math.min); + + if (maxValue == 0 && minValue == 0) { + maxValue = 1; + minValue = -1; + } return [ new charts.Series( id: 'Global Revenue', domainFn: (ChartSeries sales, _) => sales.y, measureFn: (ChartSeries sales, _) => sales.x, + measureLowerBoundFn: (ChartSeries sales, _) => minValue, + measureUpperBoundFn: (ChartSeries sales, _) => maxValue, data: globalData, ), ]; diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart index 4295558a..4acc7eaf 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; @@ -13,6 +14,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'Dialog/setting_page_radio_button_list_dialog.dart'; @@ -31,7 +33,7 @@ class _H2oSettingState extends State { TextEditingController _nameController = TextEditingController(); TextEditingController _heightController = TextEditingController(); TextEditingController _weightController = TextEditingController(); - bool _isUnitML = false; + bool _isUnitML = true; bool _isGenderMale = false; bool _isHeightCM = false; bool _isWeightKG = false; @@ -61,6 +63,14 @@ class _H2oSettingState extends State { _isGenderMale = _userDetailModel.gender == "M" ? true : false; _dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB); _selectedActiveLevel = _userDetailModel.activityID ?? 1; + readPrefs(); + } + + SharedPreferences prefs; + void readPrefs() async { + prefs = await SharedPreferences.getInstance(); + _isUnitML = (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false; + setState(() {}); } @override @@ -68,19 +78,9 @@ class _H2oSettingState extends State { // TODO: implement didChangeDependencies super.didChangeDependencies(); - _activityLevelListEng = [ - TranslationBase.of(context).notActive, - TranslationBase.of(context).lightActive, - TranslationBase.of(context).modActive, - TranslationBase.of(context).active - ]; + _activityLevelListEng = [TranslationBase.of(context).notActive, TranslationBase.of(context).lightActive, TranslationBase.of(context).modActive, TranslationBase.of(context).active]; - _remindedTimeListEng = [ - "1 ${TranslationBase.of(context).time}", - "2 ${TranslationBase.of(context).times}", - "3 ${TranslationBase.of(context).times}", - "4 ${TranslationBase.of(context).times}" - ]; + _remindedTimeListEng = ["1 ${TranslationBase.of(context).time}", "2 ${TranslationBase.of(context).times}", "3 ${TranslationBase.of(context).times}", "4 ${TranslationBase.of(context).times}"]; } @override @@ -339,8 +339,7 @@ class _H2oSettingState extends State { ]); } - Widget _commonSlidersRow( - _controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange) { + Widget _commonSlidersRow(_controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange) { return Container( margin: EdgeInsets.only(top: 6), padding: EdgeInsets.all(6), @@ -451,6 +450,7 @@ class _H2oSettingState extends State { _userDetailModel.dOB = tempDate; _userDetailModel.activityID = _selectedActiveLevel; GifLoaderDialogUtils.showMyDialog(context); + await prefs.setString(H2O_UNIT, _isUnitML ? "ml" : "l"); await widget.viewModel.updateUserDetail(_userDetailModel, (tag) { if (tag) { AppToast.showSuccessToast(message: TranslationBase.of(context).success); diff --git a/lib/pages/AlHabibMedicalService/h2o/month_page.dart b/lib/pages/AlHabibMedicalService/h2o/month_page.dart index e0118495..8867fb77 100644 --- a/lib/pages/AlHabibMedicalService/h2o/month_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; @@ -8,15 +9,17 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class MonthPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getUserProgressForMonthData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - appBarTitle: TranslationBase.of(context).h2o, + appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: Padding( padding: EdgeInsets.all(8.0), @@ -46,7 +49,7 @@ class MonthPage extends StatelessWidget { ], ), // SizedBox(height: 8), - AppBarChart(seriesList: model.userProgressForMonthDataSeries), + AppBarChart(seriesList: model.userProgressForMonthDataSeries, isArabic: projectViewModel.isArabic), ], ), ), diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 33383287..03d11f50 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -7,8 +8,14 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; +import 'package:shared_preferences/shared_preferences.dart'; class TodayPage extends StatelessWidget { + Future readPrefs() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + return (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false; + } + @override Widget build(BuildContext context) { return BaseView( @@ -34,55 +41,75 @@ class TodayPage extends StatelessWidget { : (model.userProgressData.percentageConsumed / 100) >= 1 ? 1 : (model.userProgressData.percentageConsumed / 100), - //, center: Center( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - // SizedBox( - // height: 40, - // ), - Text( - TranslationBase.of(context).consumed, - style: TextStyle(fontSize: 16.0), - ), - SizedBox( - height: 4, - ), - Text( - model.userProgressData == null - ? "0.0" - : model.userProgressData.quantityConsumed.toString() + TranslationBase.of(context).ml, - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")), - ), - SizedBox( - height: 4, - ), - SizedBox( - height: 5, - width: 50, - child: Container(), - ), - SizedBox( - height: 4, - ), - Text( - TranslationBase.of(context).remaining, - style: TextStyle(fontSize: 16.0), - ), - SizedBox( - height: 4, - ), - Text( - model.userProgressData == null - ? "0.0" - : (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed) < 0 - ? "0 ${TranslationBase.of(context).ml}" - : (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed).toString() + - ' ${TranslationBase.of(context).ml}', - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0), - ), - ], + child: FutureBuilder( + future: readPrefs(), + builder: (context, data) { + var isUnitML = true; + String unit; + if (data.connectionState == ConnectionState.done) { + isUnitML = data.data; + } + if (isUnitML) { + unit = TranslationBase.of(context).ml; + } else { + unit = TranslationBase.of(context).l; + } + unit = unit.toLowerCase(); + var totalH2O = model?.userProgressData?.quantityLimit ?? 0.0; + var consumedH2O = model?.userProgressData?.quantityConsumed ?? 0.0; + if (!isUnitML) { + totalH2O = totalH2O / 1000; + consumedH2O = consumedH2O / 1000; + } + var remainingH2O = totalH2O - consumedH2O; + + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + // SizedBox( + // height: 40, + // ), + Text( + TranslationBase.of(context).consumed, + style: TextStyle(fontSize: 16.0), + ), + SizedBox( + height: 4, + ), + Text( + model.userProgressData == null ? "0.0" : "$consumedH2O $unit", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")), + ), + SizedBox( + height: 4, + ), + SizedBox( + height: 5, + width: 50, + child: Container(), + ), + SizedBox( + height: 4, + ), + Text( + TranslationBase.of(context).remaining, + style: TextStyle(fontSize: 16.0), + ), + SizedBox( + height: 4, + ), + Text( + model.userProgressData == null + ? "0.0" + : (remainingH2O) < 0 + ? "0 $unit" + : '$remainingH2O $unit', + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0), + ), + ], + ); + }, ), ), circularStrokeCap: CircularStrokeCap.butt, diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart index 34e365e6..6f4423b2 100644 --- a/lib/pages/AlHabibMedicalService/h2o/week_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; @@ -8,10 +9,12 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class WeekPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getUserProgressForWeekData(), builder: (_, model, widget) => AppScaffold( @@ -46,7 +49,7 @@ class WeekPage extends StatelessWidget { ], ), // SizedBox(height: 8), - AppBarChart(seriesList: model.userProgressForWeekDataSeries), + AppBarChart(seriesList: model.userProgressForWeekDataSeries,isArabic: projectViewModel.isArabic), ], ), ), diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index da66c572..cf58e815 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -33,26 +33,41 @@ class _InsuranceCardState extends State { @override Widget build(BuildContext context) { imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); return BaseView( onModelReady: (model) => model.getInsurance(), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( isShowAppBar: true, baseViewModel: model, + showHomeAppBarIcon: false, appBarTitle: TranslationBase.of(context).insuranceCards, description: TranslationBase.of(context).infoInsuranceCards, infoList: TranslationBase.of(context).infoInsuranceCardsPoints, imagesInfo: imagesInfo, + appBarIcons: [ + IconButton( + padding: EdgeInsets.zero, + icon: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + margin: EdgeInsets.only(right: 8), + padding: EdgeInsets.only(right: 4, left: 4), + child: Image.asset( + 'assets/images/medical/insurance_update_icon_.png', + height: SizeConfig.heightMultiplier * 5, + width: SizeConfig.heightMultiplier * 5, + ), + ), + onPressed: () { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + ), + ], body: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04), + margin: EdgeInsets.only(left: SizeConfig.screenWidth * 0.004, right: SizeConfig.screenWidth * 0.004, top: SizeConfig.screenWidth * 0.04), child: ListView.builder( itemCount: model.insurance == null ? 0 : model.insurance.length, itemBuilder: (BuildContext context, int index) { @@ -82,23 +97,16 @@ class _InsuranceCardState extends State { Container( padding: EdgeInsets.all(14), width: double.infinity, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.grey, width: 0.2), - borderRadius: - BorderRadius.all(Radius.circular(2)), - boxShadow: [ - BoxShadow( - color: Colors.white70, - ), - ]), + decoration: BoxDecoration(shape: BoxShape.rectangle, border: Border.all(color: Colors.grey, width: 0.2), borderRadius: BorderRadius.all(Radius.circular(2)), boxShadow: [ + BoxShadow( + color: Colors.white70, + ), + ]), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).companyName + - model.insurance[index].companyName, + TranslationBase.of(context).companyName + model.insurance[index].companyName, fontSize: 20.0, fontWeight: FontWeight.w700, ), @@ -108,93 +116,46 @@ class _InsuranceCardState extends State { thickness: 0.5, ), Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context) - .category, - fontSize: 18.5), - Texts( - model.insurance[index] - .subCategoryDesc, - fontSize: 18.5) - ], + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts(TranslationBase.of(context).category, fontSize: 18.5), Texts(model.insurance[index].subCategoryDesc, fontSize: 18.5)], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .expirationDate, - fontSize: 18.5), + Texts(TranslationBase.of(context).expirationDate, fontSize: 18.5), Texts( convertDateFormat( - model.insurance[index] - .cardValidTo, + model.insurance[index].cardValidTo, ), fontSize: 18.5), ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .status + - ": ", - fontSize: 18.5), - model.insurance[index].isActive == - true - ? Texts( - TranslationBase.of(context) - .activeInsurence, - color: Colors.green, - fontWeight: FontWeight.w900, - fontSize: 17.9) - : Texts( - TranslationBase.of(context) - .notActive, - color: Colors.red, - fontWeight: FontWeight.w900, - fontSize: 17.9) + Texts(TranslationBase.of(context).status + ": ", fontSize: 18.5), + model.insurance[index].isActive == true + ? Texts(TranslationBase.of(context).activeInsurence, color: Colors.green, fontWeight: FontWeight.w900, fontSize: 17.9) + : Texts(TranslationBase.of(context).notActive, color: Colors.red, fontWeight: FontWeight.w900, fontSize: 17.9) ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context) - .patientCard, - fontSize: 18.5), - Texts( - model.insurance[index] - .patientCardID, - fontSize: 18.5) - ], + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts(TranslationBase.of(context).patientCard, fontSize: 18.5), Texts(model.insurance[index].patientCardID, fontSize: 18.5)], ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context) - .policyNumber, - fontSize: 18.5, - ), - Texts( - model.insurance[index] - .insurancePolicyNumber, - fontSize: 18.5, - ) - ]), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Texts( + TranslationBase.of(context).policyNumber, + fontSize: 18.5, + ), + Texts( + model.insurance[index].insurancePolicyNumber, + fontSize: 18.5, + ) + ]), ], ), SizedBox( @@ -204,11 +165,8 @@ class _InsuranceCardState extends State { Container( color: Colors.transparent, child: SecondaryButton( - onTap: () => { - getDetails(model.insurance[index]) - }, - label: TranslationBase.of(context) - .seeDetails, + onTap: () => {getDetails(model.insurance[index])}, + label: TranslationBase.of(context).seeDetails, textColor: Colors.white, ), width: double.infinity, @@ -235,23 +193,16 @@ class _InsuranceCardState extends State { final startIndex = exDate.indexOf(start); final endIndex = exDate.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(exDate.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(exDate.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + "-" + date.month.toString().padLeft(2, '0') + "-" + date.day.toString().padLeft(2, '0'); return newDate.toString(); } getDetails(data) { GifLoaderDialogUtils.showMyDialog(context); - _insuranceCardService.getInsuranceDetails(data).then((value) => { - GifLoaderDialogUtils.hideDialog(context), - Navigator.push(context, - FadePage(page: InsuranceCardDetails(data: value[0]['CheckList']))) - }); + _insuranceCardService + .getInsuranceDetails(data) + .then((value) => {GifLoaderDialogUtils.hideDialog(context), Navigator.push(context, FadePage(page: InsuranceCardDetails(data: value[0]['CheckList'])))}); } } diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart index 439d5ae9..818de33f 100644 --- a/lib/widgets/charts/app_bar_chart.dart +++ b/lib/widgets/charts/app_bar_chart.dart @@ -4,10 +4,12 @@ import 'package:charts_flutter/flutter.dart' as charts; class AppBarChart extends StatelessWidget { const AppBarChart({ Key key, + @required this.isArabic, @required this.seriesList, }) : super(key: key); final List seriesList; + final bool isArabic; @override Widget build(BuildContext context) { @@ -19,7 +21,7 @@ class AppBarChart extends StatelessWidget { // animate: animate, domainAxis: charts.OrdinalAxisSpec( renderSpec: charts.GridlineRendererSpec( - labelAnchor: charts.TickLabelAnchor.after, + labelAnchor: isArabic ? charts.TickLabelAnchor.before : charts.TickLabelAnchor.after, labelRotation: -30, labelOffsetFromAxisPx: 30, labelOffsetFromTickPx: 15, diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index ca72e267..64dd8c27 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -58,8 +58,7 @@ class AppScaffold extends StatelessWidget { final List appBarIcons; final List imagesInfo; final bool isHelp; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); AppBarWidget appBar; AppScaffold( @@ -130,6 +129,7 @@ class AppScaffold extends StatelessWidget { ) : buildBodyWidget(context), ), + floatingActionButton: floatingActionButton, ); }