From d69b3676a49da0cb89085cebc287ac4776d3516a Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Fri, 4 Dec 2020 08:50:23 +0300 Subject: [PATCH] weather indicator in progress --- .../all_habib_medical_service_page.dart | 62 +++++++++---------- pubspec.yaml | 4 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 88d21bf8..6c03f6ba 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -47,13 +47,13 @@ class _AllHabibMedicalServiceState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser = new AuthenticatedUser(); LocationUtils locationUtils; - var weather ='--'; + var weather = '--'; @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { getAuthUser(); locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); + new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils.getCurrentLocation(); }); super.initState(); @@ -83,15 +83,13 @@ class _AllHabibMedicalServiceState extends State { fit: BoxFit.cover, ), borderRadius: BorderRadius.circular(8.0)), - child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Row( children: [ Expanded( - flex:3, - child: - Column( + flex: 3, + child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -102,7 +100,8 @@ class _AllHabibMedicalServiceState extends State { fontWeight: FontWeight.w600, ), Texts( - TranslationBase.of(context).healthTipsBasedOnCurrentWeather, + TranslationBase.of(context) + .healthTipsBasedOnCurrentWeather, color: Colors.white, fontSize: 14, ), @@ -110,8 +109,8 @@ class _AllHabibMedicalServiceState extends State { )), Expanded( flex: 2, - child:InkWell( - onTap: (){ + child: InkWell( + onTap: () { Navigator.push( context, FadePage( @@ -125,10 +124,15 @@ class _AllHabibMedicalServiceState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset('assets/images/Weather_ico.png',width: 60,height: 60,), - AppText(weather, fontSize: 22, color:Colors.white) - ],), - + Image.asset( + 'assets/images/Weather_ico.png', + width: 60, + height: 60, + ), + AppText(weather, + fontSize: 22, color: Colors.white) + ], + ), Texts( TranslationBase.of(context).moreDetails, color: Colors.white, @@ -147,10 +151,9 @@ class _AllHabibMedicalServiceState extends State { widget.goToMyProfile(); }, imageLocation: - 'assets/images/new-design/my_file_bottom_bar.png', + 'assets/images/new-design/my_file_bottom_bar.png', title: TranslationBase.of(context).myMedicalFile, ), - ServicesContainer( onTap: () => Navigator.push( context, @@ -161,7 +164,7 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/new-design/booking_icon_active.png', + 'assets/images/new-design/booking_icon_active.png', title: TranslationBase.of(context).bookAppo, ), ServicesContainer( @@ -172,10 +175,9 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/al-habib_online_payment_service_icon.png', + 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), - ServicesContainer( onTap: () { Navigator.push( @@ -190,7 +192,6 @@ class _AllHabibMedicalServiceState extends State { imageLocation: 'assets/images/emergency_service_image.png', title: TranslationBase.of(context).emergencyService, ), - ServicesContainer( onTap: () => Navigator.push( context, @@ -199,10 +200,9 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/new-design/family_menu_icon_red.png', + 'assets/images/new-design/family_menu_icon_red.png', title: 'My Family', ), - ServicesContainer( onTap: () => Navigator.push( context, @@ -211,10 +211,9 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/new-design/upcoming_icon_bottom_bar.png', + 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), - ServicesContainer( onTap: () => Navigator.push( context, @@ -223,27 +222,27 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: - 'assets/images/new-design/parking_system_icon.png', + 'assets/images/new-design/parking_system_icon.png', title: TranslationBase.of(context).parking, ), ServicesContainer( onTap: () => launch( "https://hmgwebservices.com/vt_mobile/html/index.html"), imageLocation: - 'assets/images/new-design/virtual_tour_icon.png', + 'assets/images/new-design/virtual_tour_icon.png', title: 'Virtual Tour', ), ServicesContainer( onTap: () { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( - title: "HMG News", - selectedUrl: - "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ))); + title: "HMG News", + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ))); }, imageLocation: - 'assets/images/new-design/twitter_dashboard_icon.png', + 'assets/images/new-design/twitter_dashboard_icon.png', title: 'Latest News', ), ServicesContainer( @@ -265,7 +264,6 @@ class _AllHabibMedicalServiceState extends State { } getAuthUser() async { - if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson( await this.sharedPref.getObject(USER_PROFILE)); @@ -274,7 +272,7 @@ class _AllHabibMedicalServiceState extends State { }); } var data = await this.sharedPref.getObject(WEATHER); - weather = data !=null ? data['Temperature'].toString() + '\u2103' : '--'; + weather = data != null ? data['Temperature'].toString() + '\u2103' : '--'; print(data); } } diff --git a/pubspec.yaml b/pubspec.yaml index 4f21803d..a3844b2b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -151,7 +151,9 @@ dependencies: wakelock: ^0.1.4 after_layout: ^1.0.7 twilio_programmable_video: ^0.6.3+1 - flutter_tts: ^1.2.6 + flutter_tts: + git: + url: https://github.com/dlutton/flutter_tts.git vibration: ^1.7.2 speech_to_text: path: speech_to_text