From 3daef6e53fba4e1e4b9e208c1b6f14677f662905 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 3 Dec 2020 14:25:43 +0200 Subject: [PATCH] add images info --- ios/Flutter/.last_build_id | 2 +- lib/config/localized_values.dart | 5 ++ lib/core/model/ImagesInfo.dart | 6 +++ .../vital_sign/vital_sign_details_screen.dart | 7 +++ lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/others/app_scaffold_widget.dart | 5 +- lib/widgets/others/not_auh_page.dart | 47 +++++++++++++++---- 7 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 lib/core/model/ImagesInfo.dart diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 44c4b26c..6bca0336 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -da98d9f0c1f407e541c636e84847ac81 \ No newline at end of file +f4a819c27119d0f472892c1088ad1ca3 \ No newline at end of file diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b8e9c9c0..a8449e02 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1044,4 +1044,9 @@ const Map localizedValues = { "ar": "إستبيان" }, + "info-signs": { + "en": "This service allows you to view all vital signs were performed in the Habib Medical Group, e.x (height, weight, body mass index, heart rate, etc.) as well shows some statistics charts.", + "ar": "خدمة المؤشرات الحيوية: هذه الخدمة تمكنك من الاطلاع على جميع المؤشرات الحيوية على سبيل المثال (الطول، الوزن، مؤشر كتلة الجسم، معدل نبضات القلب الخ..) التي تمت في مجموعة الحبيب الطبية وكذلك رسوم بيانية على مستوى المؤشر." + }, + }; diff --git a/lib/core/model/ImagesInfo.dart b/lib/core/model/ImagesInfo.dart new file mode 100644 index 00000000..5ab48fb3 --- /dev/null +++ b/lib/core/model/ImagesInfo.dart @@ -0,0 +1,6 @@ +class ImagesInfo { + final String imageAr; + final String imageEn; + + ImagesInfo({this.imageAr, this.imageEn}); +} diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index 667620a2..c4273a09 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/vital_sign_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item.dart'; @@ -17,9 +18,13 @@ class VitalSignDetailsScreen extends StatelessWidget { int appointmentNo; int projectID; VitalSignDetailsScreen({this.appointmentNo, this.projectID}); + List imagesInfo = List(); + @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/1.png')); return BaseView( onModelReady: appointmentNo != null && projectID != null ? (model) => model.getPatientRadOrders( @@ -29,6 +34,8 @@ class VitalSignDetailsScreen extends StatelessWidget { isShowAppBar: true, appBarTitle: TranslationBase.of(context).vitalSigns, baseViewModel: mode, + description: TranslationBase.of(context).infoSigns, + imagesInfo: imagesInfo, body: mode.vitalSignResModelList.length > 0 ? Container( child: ListView( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index ab32218e..670b1a1b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -867,6 +867,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get openRad => localizedValues['open-rad'][locale.languageCode]; String get sendCopyRad => localizedValues['send-copy'][locale.languageCode]; String get appoSurvey => localizedValues['appoSurvey'][locale.languageCode]; + String get infoSigns => localizedValues['info-signs'][locale.languageCode]; } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index a807b02e..d0372bfc 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -40,6 +41,7 @@ class AppScaffold extends StatelessWidget { final String image; final bool isShowDecPage; final List infoList; + final List imagesInfo; AuthenticatedUserObject authenticatedUserObject = locator(); @@ -57,7 +59,7 @@ class AppScaffold extends StatelessWidget { this.isShowDecPage = true, this.isBottomBar, this.image, - this.infoList}); + this.infoList, this.imagesInfo}); @override Widget build(BuildContext context) { @@ -125,6 +127,7 @@ class AppScaffold extends StatelessWidget { title: appBarTitle, description: description, infoList: infoList, + imagesInfo: imagesInfo, ) : baseViewModel != null ? NetworkBaseView( diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index d1684125..e3fc1802 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -1,4 +1,6 @@ +import 'package:carousel_slider/carousel_slider.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/routes.dart'; @@ -12,12 +14,22 @@ import 'package:provider/provider.dart'; import '../../splashPage.dart'; -class NotAutPage extends StatelessWidget { +class NotAutPage extends StatefulWidget { final String title; final String description; final List infoList; + final List imagesInfo; + + NotAutPage({@required this.title, @required this.description, this.infoList, this.imagesInfo}); + + @override + _NotAutPageState createState() => _NotAutPageState(); +} + +class _NotAutPageState extends State { + + int _current = 0; - NotAutPage({@required this.title, @required this.description, this.infoList}); @override Widget build(BuildContext context) { @@ -29,7 +41,7 @@ class NotAutPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - title ?? 'Service', + widget.title ?? 'Service', fontWeight: FontWeight.w800, fontSize: 25, bold: true, @@ -40,17 +52,17 @@ class NotAutPage extends StatelessWidget { height: 12, ), Texts( - description ?? 'Description', + widget.description ?? 'Description', fontWeight: FontWeight.normal, fontSize: 17, ), - if (infoList != null) + if (widget.infoList != null) SizedBox( height: 12, ), - if (infoList != null) + if (widget.infoList != null) ...List.generate( - infoList.length, + widget.infoList.length, (index) => Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -69,7 +81,7 @@ class NotAutPage extends StatelessWidget { ), ), SizedBox(width: 6,), - Expanded(child: Texts('${infoList[index]}')) + Expanded(child: Texts('${widget.infoList[index]}')) ], ), SizedBox(height: 12,), @@ -80,6 +92,7 @@ class NotAutPage extends StatelessWidget { SizedBox( height: 22, ), + if(!projectViewModel.isInternetConnection) Center( child: SizedBox( height: MediaQuery.of(context).size.height * 0.55, @@ -89,6 +102,24 @@ class NotAutPage extends StatelessWidget { : 'assets/images/wifi-EN.png'), ), ), + if(projectViewModel.isInternetConnection && widget.imagesInfo!=null) + CarouselSlider( + items: widget.imagesInfo.map((image) { + return Builder( + builder: (BuildContext context){ + return SizedBox( + width: MediaQuery.of(context).size.width * 0.50, + child: Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); + }, + ); + }).toList(), + options: CarouselOptions( + height: MediaQuery.of(context).size.height * 0.55, + autoPlay: true, + viewportFraction: 1.0, + ), + ), + SizedBox( height: 77, ),