diff --git a/assets/images/SmartWatches/distance.png b/assets/images/SmartWatches/distance.png new file mode 100644 index 00000000..d07f3e8a Binary files /dev/null and b/assets/images/SmartWatches/distance.png differ diff --git a/assets/images/SmartWatches/steps.png b/assets/images/SmartWatches/steps.png new file mode 100644 index 00000000..974668ea Binary files /dev/null and b/assets/images/SmartWatches/steps.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 7270f91e..d4ab58a9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -452,6 +452,8 @@ const UPDATE_CMC_ORDER_RC = 'rc/api/cmc/update'; // RRT RC SERVICES const ADD_RRT_ORDER_RC = "rc/api/rrt/add"; +const GET_ALL_RRT_ORDERS_RC = "rc/api/rrt/list"; +const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update'; //Pharmacy wishlist const GET_WISHLIST = "shopping_cart_items/"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7584ec6e..d1f138e4 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1584,4 +1584,14 @@ const Map localizedValues = { "avgDistance": { "en": "Average Distance", "ar": "متوسط المسافة" }, "enterDetails": {"en": "Enter Details", "ar": "أدخل التفاصيل"}, "avgHeartRate": { "en": "Average Heart Rate", "ar": "متوسط معدل ضربات القلب" }, + "alreadySynced": { "en": "Already Synced", "ar": "متزامنة" }, + "sync-instructions-intro1": { "en": "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", "ar": "يبدو أنك لم تقم بمزامنة بياناتك الصحية مع تطبيق Dr. Alhabib App من قبل. للمتابعة ، تحتاج إلى مزامنة بياناتك الصحية مع تطبيق Dr. Alhabib" }, + "sync-instructions-intro2": { "en": "Before syncing data, please make sure that you have followed the instructions properly", "ar": "قبل مزامنة البيانات ، يرجى التأكد من اتباع التعليمات بشكل صحيح." }, + "sync-instructions-intro3": { "en": "Before syncing data, please make sure that following instructions are met:", "ar": "قبل مزامنة البيانات ، يرجى التأكد من تلبية الإرشادات التالية:" }, + "ios-instructions-1": { "en": "Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.", "ar": "تأكد من أنك قمت بتثبيت تطبيق 'Health' App & 'Watch' من متجر Apple." }, + "ios-instructions-2": { "en": "Make sure that your Apple Watch is connected with the Watch & Health Apps.", "ar": "تأكد من اتصال Apple Watch بتطبيقات Watch & Health." }, + "ios-instructions-3": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق صحتك." }, + "supportedWatches": { "en": "Supported SmartWatches", "ar": "الساعات الذكية المدعومة" }, + "watchInstructions": { "en": "Watch Instructions:", "ar": "تعليمات الساعة:" }, + "monthlyTab": {"en": "Monthly", "ar": "شهري"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 4f8a3f5d..c35be69b 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -114,8 +114,10 @@ class BaseAppClient { } } + // body['IdentificationNo'] = 1009199553; + // body['MobileNo'] = "966545156035"; // body['PatientID'] = 1018977; - body['TokenID'] = "@dm!n"; + // body['TokenID'] = "@dm!n"; body.removeWhere((key, value) => key == null || value == null); diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart index 83732ebd..60411fab 100644 --- a/lib/core/viewModels/er/rrt-view-model.dart +++ b/lib/core/viewModels/er/rrt-view-model.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; @@ -17,8 +18,8 @@ import '../base_view_model.dart'; class RRTService extends BaseService {} class _RRTServiceData { - List pendingOrders = []; - List completedOrders = []; + List pendingOrders = []; + List completedOrders = []; ServicePrice servicePrice; } @@ -34,7 +35,8 @@ class RRTViewModel extends BaseViewModel { Future<_RRTServiceData> loadRequiredData() async { await getServicePrice(); - await getAllOrders(); + // await getAllOrders(); + await getAllOrdersRC(); return rrtServiceData; } @@ -79,9 +81,9 @@ class RRTViewModel extends BaseViewModel { if (json["ServiceID"] == 5) { if (json["Status"] == 1 || json["Status"] == 2) { // Pending - rrtServiceData.pendingOrders.add(PrescriptionsOrder.fromJson(json)); + rrtServiceData.pendingOrders.add(GetCMCAllOrdersResponseModel.fromJson(json)); } - rrtServiceData.completedOrders.add(PrescriptionsOrder.fromJson(json)); + rrtServiceData.completedOrders.add(GetCMCAllOrdersResponseModel.fromJson(json)); } }); } @@ -91,6 +93,26 @@ class RRTViewModel extends BaseViewModel { return rrtServiceData; } + Future<_RRTServiceData> getAllOrdersRC() async { + await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, body: {}, onSuccess: (response, statusCode) { + var data = response["response"]; + rrtServiceData.completedOrders.clear(); + rrtServiceData.pendingOrders.clear(); + if (data != null && data is List) { + data.forEach((json) { + if (json["StatusId"] == 1 || json["StatusId"] == 2) { + // Pending + rrtServiceData.pendingOrders.add(GetCMCAllOrdersResponseModel.fromJson(json)); + } + rrtServiceData.completedOrders.add(GetCMCAllOrdersResponseModel.fromJson(json)); + }); + } + }, onFailure: (error, statusCode) { + AppToast.showErrorToast(message: error); + }); + return rrtServiceData; + } + Future getOrderDetails() async { return null; } @@ -136,6 +158,19 @@ class RRTViewModel extends BaseViewModel { return Future.value(success); } + Future cancelOrderRC(GetCMCAllOrdersResponseModel order, {String reason = ""}) async { + Map body = {"Id": order.iD, "ClickButton": 16}; + var success = false; + await _service.baseAppClient.post(UPDATE_RRT_ORDER_RC, body: body, onSuccess: (response, statusCode) { + success = true; + rrtServiceData.pendingOrders.remove(order); + }, onFailure: (error, statusCode) { + AppToast.showErrorToast(message: error); + success = false; + }); + return Future.value(success); + } + Future> getAddresses() async { Object error; try { @@ -175,7 +210,6 @@ class RRTViewModel extends BaseViewModel { await getCustomerAddresses(); } - // setState(ViewState.Busy); // await _pharmacy_service.generatePharmacyToken(); // if (_customerAddressesService.hasError) { diff --git a/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart index c7c12a2d..2a1dd3c9 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; @@ -11,7 +12,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; class RRTLogPage extends StatefulWidget { - final List orders; + final List orders; const RRTLogPage({this.orders}); @@ -45,13 +46,13 @@ class RRTLogPageState extends State { }); } - deleteOrder(PrescriptionsOrder order) async { + deleteOrder(GetCMCAllOrdersResponseModel order) async { GifLoaderDialogUtils.showMyDialog(context); - var success = await viewModel.cancelOrder(order); + var success = await viewModel.cancelOrderRC(order); if (success) { viewModel.setState(ViewState.Busy); - await viewModel.getAllOrders(); + await viewModel.getAllOrdersRC(); viewModel.setState(ViewState.Idle); Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); Navigator.push(context, FadePage(page: RRTMainScreen())); diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart index 351c918a..62fa4745 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-logs-page.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -7,10 +8,13 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class RRTMainScreen extends StatefulWidget { final index = 0; + RRTMainScreen({index}); + @override State createState() => RRTMainScreenState(); } @@ -25,6 +29,8 @@ class RRTMainScreenState extends State with SingleTickerProviderS List imagesInfo = List(); + ProjectViewModel projectViewModel; + @override void initState() { super.initState(); @@ -36,6 +42,7 @@ class RRTMainScreenState extends State with SingleTickerProviderS @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); localize = TranslationBase.of(context); return AppScaffold( @@ -80,20 +87,40 @@ class RRTMainScreenState extends State with SingleTickerProviderS margin: EdgeInsets.all(0.0), clipBehavior: Clip.hardEdge, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), - child: TabBar(onTap: onPageChanged, indicatorWeight: 3, indicatorColor: Color(0xFFc5272d), isScrollable: false, controller: tabController, indicatorSize: TabBarIndicatorSize.label, tabs: [ - Tab( - child: Text( - localize.rapidResponseTeam, - style: TextStyle(color: Theme.of(context).appBarTheme.color), + child: TabBar( + onTap: onPageChanged, + controller: tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 5, bottom: 5), + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 15, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, ), - ), - Tab( - child: Text( - localize.orderLog, - style: TextStyle(color: Theme.of(context).appBarTheme.color), + unselectedLabelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 15, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, ), - ), - ]), + tabs: [ + Tab( + child: Text( + localize.rapidResponseTeam, + style: TextStyle(color: Theme.of(context).appBarTheme.color), + ), + ), + Tab( + child: Text( + localize.orderLog, + style: TextStyle(color: Theme.of(context).appBarTheme.color), + ), + ), + ]), ); Widget contentPager() => PageView( diff --git a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart index a2ef7cd0..8a4f1e18 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -16,8 +17,8 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5)); class RRTLogListItem extends StatefulWidget { - final PrescriptionsOrder order; - final Function(PrescriptionsOrder) onCancel; + final GetCMCAllOrdersResponseModel order; + final Function(GetCMCAllOrdersResponseModel) onCancel; RRTLogListItem(this.order, {this.onCancel}); @override @@ -34,8 +35,8 @@ class RRTLogListItemState extends State { ProjectViewModel projectViewModel = Provider.of(context); localize = TranslationBase.of(context); - int status = widget.order.status; - String _statusDisp = projectViewModel.isArabic ? widget.order.descriptionN : widget.order.description; + int status = widget.order.statusId; + String _statusDisp = widget.order.statusText; Color _color; if (status == 1) { //pending @@ -46,7 +47,7 @@ class RRTLogListItemState extends State { } else if (status == 3) { //completed _color = Color(0xff359846); - } else if (status == 4) { + } else if (status == 4 || status == 6 || status == 7) { //cancel // Rejected _color = Color(0xffD02127); } @@ -111,7 +112,7 @@ class RRTLogListItemState extends State { ), Expanded( child: Text( - !projectViewModel.isArabic ? widget.order.nearestProjectDescription.trim().toString() : widget.order.nearestProjectDescriptionN.toString(), + widget.order.projectName.toString(), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), ), @@ -126,7 +127,7 @@ class RRTLogListItemState extends State { ), Expanded( child: Text( - widget.order.getFormattedDateTime(), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order.created)), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), ), @@ -140,11 +141,11 @@ class RRTLogListItemState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormattedLang(widget.order.createdOn, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order.created)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), - if (widget.order.status == 1 || widget.order.status == 2) + if (widget.order.statusId == 1 || widget.order.statusId == 2) InkWell( onTap: () { //onCancel(order); @@ -227,11 +228,11 @@ class RRTLogListItemState extends State { // ); cancelOrders(order) async { GifLoaderDialogUtils.showMyDialog(context); - var success = await viewModel.cancelOrder(order); + var success = await viewModel.cancelOrderRC(order); if (success) { viewModel.setState(ViewState.Busy); - await viewModel.getAllOrders(); + await viewModel.getAllOrdersRC(); viewModel.setState(ViewState.Idle); Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); Navigator.push(context, FadePage(page: RRTMainScreen())); diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart index 4e863bd1..938b0528 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart @@ -217,7 +217,7 @@ class RRTPlaceOrderPage extends StatelessWidget { gotoRRTRoot() async { viewModel.setState(ViewState.Busy); - await viewModel.getAllOrders(); + await viewModel.getAllOrdersRC(); viewModel.setState(ViewState.Idle); Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); Navigator.push(_context, FadePage(page: RRTMainScreen())); diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart index 28cd3cf4..1848f52c 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; @@ -15,7 +16,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class RRTRequestPage extends StatefulWidget { - final List pendingOrders; + final List pendingOrders; final ServicePrice servicePrice; RRTRequestPage({this.pendingOrders, this.servicePrice}); @@ -208,14 +209,14 @@ class RRTRequestPageState extends State { ))); } - deleteOrder(PrescriptionsOrder order) async { + deleteOrder(GetCMCAllOrdersResponseModel order) async { GifLoaderDialogUtils.showMyDialog(context); - var success = await viewModel.cancelOrder(order); + var success = await viewModel.cancelOrderRC(order); GifLoaderDialogUtils.hideDialog(context); if (success) setState(() { widget.pendingOrders.remove(order); }); - await viewModel.getAllOrders(); + await viewModel.getAllOrdersRC(); } } diff --git a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart index 787bc210..cceb8b1e 100644 --- a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart @@ -89,7 +89,7 @@ class _DistanceTrackerState extends State with SingleTickerProv ), tabs: [ Tab(text: TranslationBase.of(context).weekly), - Tab(text: TranslationBase.of(context).monthly), + Tab(text: TranslationBase.of(context).monthlyTab), Tab(text: TranslationBase.of(context).yearly), ], onTap: (value) { diff --git a/lib/pages/medical/smart_watch_health_data/health_data_list.dart b/lib/pages/medical/smart_watch_health_data/health_data_list.dart index f63e3151..f43a6e63 100644 --- a/lib/pages/medical/smart_watch_health_data/health_data_list.dart +++ b/lib/pages/medical/smart_watch_health_data/health_data_list.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/dista import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -30,118 +31,35 @@ class _HealthDataListState extends State { @override Widget build(BuildContext context) { + List myMedicalList = myOptionsList(context); return AppScaffold( appBarTitle: TranslationBase.of(context).smartWatches, isShowAppBar: true, showNewAppBar: true, showNewAppBarTitle: true, body: Container( - height: MediaQuery.of(context).size.height, - margin: EdgeInsets.all(20.0), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: HeartRateTracker(), - ), - ); - }, - child: Row( - children: [ - Container( - child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text(TranslationBase.of(context).heart, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], - ), - ), - Divider( - color: Colors.grey[500], - ), - Row( - children: [ - Container( - child: Image.asset("assets/images/SmartWatches/sleep_data.png", width: 60.0, height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text("Sleep Data", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], + Container( + width: double.infinity, + height: 20, ), - Divider( - color: Colors.grey[500], - ), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: StepsTracker(), - ), - ); - }, - child: Row( - children: [ - Container( - child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text(TranslationBase.of(context).steps, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], + Padding( + padding: EdgeInsets.only(left: 12, right: 12), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.zero, + itemCount: myMedicalList.length, + itemBuilder: (BuildContext context, int index) { + return myMedicalList[index]; + }, ), ), - Divider( - color: Colors.grey[500], - ), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: DistanceTracker(), - ), - ); - }, - child: Row( - children: [ - Container( - child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text(TranslationBase.of(context).distance, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], - ), - ), - Divider( - color: Colors.grey[500], - ), - // Row( - // children: [ - // Container( - // child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), - // ), - // Container( - // margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - // child: Text("Energy", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - // ), - // ], - // ), - // Divider( - // color: Colors.grey[500], - // ), ], ), ), @@ -159,6 +77,53 @@ class _HealthDataListState extends State { ); } + + List myOptionsList(BuildContext context) { + List medical = List(); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: HeartRateTracker()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).heart, + imagePath: 'assets/images/SmartWatches/heartrate_icon.png', + subTitle: null, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: StepsTracker()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).steps, + imagePath: 'assets/images/SmartWatches/steps.png', + subTitle: null, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: DistanceTracker()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).distance, + imagePath: 'assets/images/SmartWatches/distance.png', + subTitle: null, + isPngImage: true, + ), + )); + + return medical; + } + + // void readLast() async { // print("ReadLast"); // final result = await FitKit.readLast(DataType.DISTANCE); diff --git a/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart b/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart index 1c109669..da82d540 100644 --- a/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart @@ -89,7 +89,7 @@ class _HeartRateTrackerState extends State with SingleTickerPr ), tabs: [ Tab(text: TranslationBase.of(context).weekly), - Tab(text: TranslationBase.of(context).monthly), + Tab(text: TranslationBase.of(context).monthlyTab), Tab(text: TranslationBase.of(context).yearly), ], onTap: (value) { diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index b4471611..4c515e3a 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -8,6 +8,8 @@ import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/healt import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -24,13 +26,12 @@ class _SmartWatchInstructionsState extends State { bool hasAlreadySynced = false; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - if(authenticatedUserObject.isLogin) getLastPatientRecord(context); + if (authenticatedUserObject.isLogin) getLastPatientRecord(context); }); super.initState(); } @@ -49,9 +50,7 @@ class _SmartWatchInstructionsState extends State { ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/1.png') ], body: Container( - child: Platform.isIOS - ? _getAppleWatchInstructions() - : _getGoogleWatchInstructions(), + child: Platform.isIOS ? _getAppleWatchInstructions() : _getGoogleWatchInstructions(), )); } @@ -65,10 +64,7 @@ class _SmartWatchInstructionsState extends State { // margin: EdgeInsets.only(top: 10.0), child: CarouselSlider( carouselController: buttonCarouselController, - options: CarouselOptions( - enableInfiniteScroll: false, - viewportFraction: 0.95, - height: MediaQuery.of(context).size.height * 0.9), + options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.9), items: [1, 2].map((i) { return Builder( builder: (BuildContext context) { @@ -83,33 +79,24 @@ class _SmartWatchInstructionsState extends State { ), child: i == 1 ? Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("Supported Smartwatches", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.bold)), + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), ), Container( child: Row( children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 10.0), + margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-1.jpeg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-1.jpeg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 1", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 1", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -117,20 +104,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 10.0), + margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-2.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-2.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 2", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -145,20 +125,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-3.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-3.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 3", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -166,20 +139,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-4.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-4.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 4", overflow: TextOverflow.clip , - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -194,20 +160,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-5.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-5.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 5", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 5", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -215,20 +174,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/Apple-Watch-6.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/Apple-Watch-6.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 6", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 6", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -243,19 +195,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/miBand3.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Mi Band 3", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -263,19 +209,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/miBand4.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Mi Band 4", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -285,143 +225,78 @@ class _SmartWatchInstructionsState extends State { ), ), Container( - margin: EdgeInsets.fromLTRB( - 10.0, 30.0, 10.0, 10.0), - child: Text( - "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 30.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "Before syncing data, please make sure that you have followed the instructions properly", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.all(15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), - ), - minWidth: - MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - buttonCarouselController.nextPage(); - }, - child: Text("CONTINUE", - style: TextStyle(fontSize: 18.0)), - ), + margin: EdgeInsets.fromLTRB(15.0, 40.0, 15.0, 0.0), + child: DefaultButton( + TranslationBase.of(context).continues, + () { + buttonCarouselController.nextPage(); + }, + color: Color(0xff359846), ), ), ], ) : Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("Watch Instructions:", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.bold, - fontFamily: "WorkSans")), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).watchInstructions, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), ), Container( - margin: EdgeInsets.all(10.0), - child: Text( - "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.fromLTRB( - 10.0, 20.0, 10.0, 10.0), - child: Text( - "Before syncing data, please make sure that following instructions are met: ", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.fromLTRB( - 10.0, 20.0, 10.0, 10.0), - child: Text( - "1. Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).iosInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.all(10.0), - child: Text( - "2. Make sure that your Apple Watch is connected with the Watch & Health Apps.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).iosInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.all(10.0), - child: Text( - "3. Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).iosInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), - Container( - margin: EdgeInsets.fromLTRB( - 15.0, 80.0, 15.0, 15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), - ), - minWidth: - MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - buttonCarouselController.nextPage(); - }, - child: Text("SYNC HEALTH DATA", - style: TextStyle(fontSize: 18.0)), - ), + Padding( + padding: const EdgeInsets.fromLTRB(12.0, 50.0, 12.0, 20.0), + child: Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).syncHealthData, + () {}, + color: Color(0xFFD02127), + disabledColor: Color(0xff28323A).withOpacity(0.3), + ), + ), + mWidth(12), + if (hasAlreadySynced) + Expanded( + child: DefaultButton( + TranslationBase.of(context).alreadySynced, + () { + _openHealthDataList(); + }, + color: Color(0xff359846), + ), + ), + ], ), ), - hasAlreadySynced ? Container( - margin: EdgeInsets.fromLTRB( - 15.0, 0.0, 15.0, 15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), - ), - minWidth: - MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - _openHealthDataList(); - }, - child: Text("ALREADY SYNCED", - style: TextStyle(fontSize: 18.0)), - ), - ), - ): Container(), ], ), )); @@ -447,7 +322,7 @@ class _SmartWatchInstructionsState extends State { options: CarouselOptions( // enableInfiniteScroll: true, viewportFraction: 0.99, - height: MediaQuery.of(context).size.height*1.1 ), + height: MediaQuery.of(context).size.height * 0.9), items: [1, 2].map((i) { return Builder( builder: (BuildContext context) { @@ -455,7 +330,7 @@ class _SmartWatchInstructionsState extends State { width: MediaQuery.of(context).size.width, margin: EdgeInsets.symmetric(horizontal: 5.0), child: Card( - margin: EdgeInsets.only(top:16.0 , bottom: 8.0), + margin: EdgeInsets.only(top: 16.0, bottom: 8.0), // fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white.withOpacity(1.0), shape: RoundedRectangleBorder( @@ -466,31 +341,20 @@ class _SmartWatchInstructionsState extends State { children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Supported Smartwatches", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.bold, - fontFamily: "WorkSans")), + child: Text("Supported Smartwatches", style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, fontFamily: "WorkSans")), ), Container( child: Row( children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 10.0), + margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/huawei-watch-2.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/huawei-watch-2.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Huawei Watch 2", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Huawei Watch 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -498,21 +362,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 10.0), + margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/ticwatche2.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/ticwatche2.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Mobovi TicWatch E2", - overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mobovi TicWatch E2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -527,19 +383,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/huawei-watch-2-classic.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/huawei-watch-2-classic.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Huawei Watch", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Huawei Watch", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -547,19 +397,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/ticwatche2.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/ticwatche2.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Fossil Sport", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Fossil Sport", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -574,20 +418,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/misfit-vapor-2.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/misfit-vapor-2.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "MisFit Vapor 2", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("MisFit Vapor 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -595,20 +432,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/lg-watch-sport.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/lg-watch-sport.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "LG Watch Sport", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("LG Watch Sport", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -623,19 +453,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/miBand3.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Mi Band 3", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -643,19 +467,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/miBand4.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Mi Band 4", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -666,18 +484,11 @@ class _SmartWatchInstructionsState extends State { ), InkWell( onTap: () { - launch( - "https://wearos.google.com/#find-your-watch"); + launch("https://wearos.google.com/#find-your-watch"); }, child: Container( margin: EdgeInsets.only(top: 20.0), - child: Text( - "More Supported Smartwatches...", - style: TextStyle( - fontSize: 17.0, - color: Colors.blue, - decoration: - TextDecoration.underline)), + child: Text("More Supported Smartwatches...", style: TextStyle(fontSize: 17.0, color: Colors.blue, decoration: TextDecoration.underline)), ), ), Container( @@ -689,20 +500,16 @@ class _SmartWatchInstructionsState extends State { ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "Before syncing data, please make sure that you have followed the instructions properly", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: + Text("Before syncing data, please make sure that you have followed the instructions properly", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(15.0), child: ButtonTheme( shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width, + minWidth: MediaQuery.of(context).size.width, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -713,8 +520,7 @@ class _SmartWatchInstructionsState extends State { onPressed: () { buttonCarouselController.nextPage(); }, - child: Text("CONTINUE", - style: TextStyle(fontSize: 18.0)), + child: Text("CONTINUE", style: TextStyle(fontSize: 18.0)), ), ), ), @@ -724,11 +530,7 @@ class _SmartWatchInstructionsState extends State { children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Watch Instructions:", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.bold, - fontFamily: "WorkSans")), + child: Text("Watch Instructions:", style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, fontFamily: "WorkSans")), ), Container( margin: EdgeInsets.all(10.0), @@ -739,49 +541,33 @@ class _SmartWatchInstructionsState extends State { ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "Before syncing data, please make sure that following instructions are met: ", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text("Before syncing data, please make sure that following instructions are met: ", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text("1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", + textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "2. Make sure that you have installed your watch related apps from Google PlayStore.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text("2. Make sure that you have installed your watch related apps from Google PlayStore.", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: + Text("3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "4. Make sure that your smart watch apps are linked/associated with Google Fit App.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text("4. Make sure that your smart watch apps are linked/associated with Google Fit App.", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( - margin: EdgeInsets.fromLTRB( - 15.0, 75.0, 15.0, 15.0), + margin: EdgeInsets.fromLTRB(15.0, 75.0, 15.0, 15.0), child: ButtonTheme( shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width, + minWidth: MediaQuery.of(context).size.width, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -792,36 +578,33 @@ class _SmartWatchInstructionsState extends State { onPressed: () { buttonCarouselController.nextPage(); }, - child: Text("SYNC HEALTH DATA", - style: TextStyle(fontSize: 18.0)), + child: Text("SYNC HEALTH DATA", style: TextStyle(fontSize: 18.0)), ), ), ), - hasAlreadySynced ? Container( - margin: EdgeInsets.fromLTRB( - 15.0, 0.0, 15.0, 15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), - ), - minWidth: - MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - _openHealthDataList(); - }, - child: Text("ALREADY SYNCED", - style: TextStyle(fontSize: 18.0)), - ), - ), - ) : Container(), + hasAlreadySynced + ? Container( + margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + elevation: 0, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + _openHealthDataList(); + }, + child: Text("ALREADY SYNCED", style: TextStyle(fontSize: 18.0)), + ), + ), + ) + : Container(), ], ), )); diff --git a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart index c1be5f2d..5f63c2ad 100644 --- a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart @@ -89,7 +89,7 @@ class _StepsTrackerState extends State with SingleTickerProviderSt ), tabs: [ Tab(text: TranslationBase.of(context).weekly), - Tab(text: TranslationBase.of(context).monthly), + Tab(text: TranslationBase.of(context).monthlyTab), Tab(text: TranslationBase.of(context).yearly), ], onTap: (value) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d61b4f10..e82c6521 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2484,7 +2484,9 @@ class TranslationBase { String get mostViewed => localizedValues["mostViewed"][locale.languageCode]; String get newProducts => localizedValues["newProducts"][locale.languageCode]; + String get enterDetails => localizedValues["enterDetails"][locale.languageCode]; + String get paymentSelected => localizedValues["paymentSelected"][locale.languageCode]; String get moreNotifications => localizedValues["moreNotifications"][locale.languageCode]; @@ -2530,6 +2532,26 @@ class TranslationBase { String get avgDistance => localizedValues["avgDistance"][locale.languageCode]; String get avgHeartRate => localizedValues["avgHeartRate"][locale.languageCode]; + + String get alreadySynced => localizedValues["alreadySynced"][locale.languageCode]; + + String get syncInstructionsIntro1 => localizedValues["sync-instructions-intro1"][locale.languageCode]; + + String get syncInstructionsIntro2 => localizedValues["sync-instructions-intro2"][locale.languageCode]; + + String get syncInstructionsIntro3 => localizedValues["sync-instructions-intro3"][locale.languageCode]; + + String get iosInstructions1 => localizedValues["ios-instructions-1"][locale.languageCode]; + + String get iosInstructions2 => localizedValues["ios-instructions-2"][locale.languageCode]; + + String get iosInstructions3 => localizedValues["ios-instructions-3"][locale.languageCode]; + + String get supportedWatches => localizedValues["supportedWatches"][locale.languageCode]; + + String get watchInstructions => localizedValues["watchInstructions"][locale.languageCode]; + + String get monthlyTab => localizedValues["monthlyTab"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {