weather indicator in progress

fix_issues
Sultan Khan 4 years ago
parent 81c8239412
commit d69b3676a4

@ -47,13 +47,13 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
LocationUtils locationUtils; LocationUtils locationUtils;
var weather ='--'; var weather = '--';
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getAuthUser(); getAuthUser();
locationUtils = locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context); new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(); locationUtils.getCurrentLocation();
}); });
super.initState(); super.initState();
@ -83,15 +83,13 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
borderRadius: BorderRadius.circular(8.0)), borderRadius: BorderRadius.circular(8.0)),
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.0), padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex:3, flex: 3,
child: child: Column(
Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -102,7 +100,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
Texts( Texts(
TranslationBase.of(context).healthTipsBasedOnCurrentWeather, TranslationBase.of(context)
.healthTipsBasedOnCurrentWeather,
color: Colors.white, color: Colors.white,
fontSize: 14, fontSize: 14,
), ),
@ -110,8 +109,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
)), )),
Expanded( Expanded(
flex: 2, flex: 2,
child:InkWell( child: InkWell(
onTap: (){ onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -125,10 +124,15 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Image.asset('assets/images/Weather_ico.png',width: 60,height: 60,), Image.asset(
AppText(weather, fontSize: 22, color:Colors.white) 'assets/images/Weather_ico.png',
],), width: 60,
height: 60,
),
AppText(weather,
fontSize: 22, color: Colors.white)
],
),
Texts( Texts(
TranslationBase.of(context).moreDetails, TranslationBase.of(context).moreDetails,
color: Colors.white, color: Colors.white,
@ -147,10 +151,9 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
widget.goToMyProfile(); widget.goToMyProfile();
}, },
imageLocation: imageLocation:
'assets/images/new-design/my_file_bottom_bar.png', 'assets/images/new-design/my_file_bottom_bar.png',
title: TranslationBase.of(context).myMedicalFile, title: TranslationBase.of(context).myMedicalFile,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -161,7 +164,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
imageLocation: imageLocation:
'assets/images/new-design/booking_icon_active.png', 'assets/images/new-design/booking_icon_active.png',
title: TranslationBase.of(context).bookAppo, title: TranslationBase.of(context).bookAppo,
), ),
ServicesContainer( ServicesContainer(
@ -172,10 +175,9 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
imageLocation: imageLocation:
'assets/images/al-habib_online_payment_service_icon.png', 'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).onlinePaymentService, title: TranslationBase.of(context).onlinePaymentService,
), ),
ServicesContainer( ServicesContainer(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -190,7 +192,6 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
imageLocation: 'assets/images/emergency_service_image.png', imageLocation: 'assets/images/emergency_service_image.png',
title: TranslationBase.of(context).emergencyService, title: TranslationBase.of(context).emergencyService,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -199,10 +200,9 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
imageLocation: imageLocation:
'assets/images/new-design/family_menu_icon_red.png', 'assets/images/new-design/family_menu_icon_red.png',
title: 'My Family', title: 'My Family',
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -211,10 +211,9 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
imageLocation: imageLocation:
'assets/images/new-design/upcoming_icon_bottom_bar.png', 'assets/images/new-design/upcoming_icon_bottom_bar.png',
title: TranslationBase.of(context).todoList, title: TranslationBase.of(context).todoList,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -223,27 +222,27 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
imageLocation: imageLocation:
'assets/images/new-design/parking_system_icon.png', 'assets/images/new-design/parking_system_icon.png',
title: TranslationBase.of(context).parking, title: TranslationBase.of(context).parking,
), ),
ServicesContainer( ServicesContainer(
onTap: () => launch( onTap: () => launch(
"https://hmgwebservices.com/vt_mobile/html/index.html"), "https://hmgwebservices.com/vt_mobile/html/index.html"),
imageLocation: imageLocation:
'assets/images/new-design/virtual_tour_icon.png', 'assets/images/new-design/virtual_tour_icon.png',
title: 'Virtual Tour', title: 'Virtual Tour',
), ),
ServicesContainer( ServicesContainer(
onTap: () { onTap: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => MyWebView( builder: (BuildContext context) => MyWebView(
title: "HMG News", title: "HMG News",
selectedUrl: selectedUrl:
"https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live",
))); )));
}, },
imageLocation: imageLocation:
'assets/images/new-design/twitter_dashboard_icon.png', 'assets/images/new-design/twitter_dashboard_icon.png',
title: 'Latest News', title: 'Latest News',
), ),
ServicesContainer( ServicesContainer(
@ -265,7 +264,6 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
} }
getAuthUser() async { getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE)); await this.sharedPref.getObject(USER_PROFILE));
@ -274,7 +272,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
}); });
} }
var data = await this.sharedPref.getObject(WEATHER); var data = await this.sharedPref.getObject(WEATHER);
weather = data !=null ? data['Temperature'].toString() + '\u2103' : '--'; weather = data != null ? data['Temperature'].toString() + '\u2103' : '--';
print(data); print(data);
} }
} }

@ -151,7 +151,9 @@ dependencies:
wakelock: ^0.1.4 wakelock: ^0.1.4
after_layout: ^1.0.7 after_layout: ^1.0.7
twilio_programmable_video: ^0.6.3+1 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 vibration: ^1.7.2
speech_to_text: speech_to_text:
path: speech_to_text path: speech_to_text

Loading…
Cancel
Save