hot fixes

merge-requests/215/head
Sultan Khan 4 years ago
parent e312671e24
commit 040c8f38ab

@ -21,17 +21,15 @@ class WeatherService extends BaseService {
await baseAppClient.post(WEATHER_INDICATOR, await baseAppClient.post(WEATHER_INDICATOR,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['GetCityInfo_List'].forEach((data) { response['GetCityInfo_List'].forEach((data) {
weatherIndicatorData.add(GetCityInfoList.fromJson(data)); weatherIndicatorData.add(GetCityInfoList.fromJson(data));
}); });
print(weatherIndicatorData); print(weatherIndicatorData);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
await this.sharedPref.setObject(WEATHER,weatherIndicatorData[0]); await this.sharedPref.setObject(WEATHER, weatherIndicatorData[0]);
return Future.value(weatherIndicatorData[0]);
} }
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/weather_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart';
@ -31,6 +32,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class AllHabibMedicalService extends StatefulWidget { class AllHabibMedicalService extends StatefulWidget {
@ -48,14 +50,16 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
LocationUtils locationUtils; LocationUtils locationUtils;
var weather = '--'; var weather = '--';
WeatherService _weatherService = WeatherService();
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getAuthUser();
locationUtils = locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context); new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(); WidgetsBinding.instance.addPostFrameCallback((_) => {
Geolocator.getLastKnownPosition()
.then((value) => setLocation(value))
});
}); });
super.initState(); super.initState();
} }
@ -130,8 +134,11 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
width: 60, width: 60,
height: 60, height: 60,
), ),
AppText(weather, Directionality(
fontSize: 22, color: Colors.white) textDirection: TextDirection.ltr,
child: AppText(weather,
fontSize: 22,
color: Colors.white))
], ],
), ),
Texts( Texts(
@ -276,7 +283,23 @@ 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' : '--'; if (data == null) {
print(data); var d = await _weatherService.getWeatherData();
print(d);
setState(() {
weather = d != null ? d.temperature.toString() + '\u2103' : '--';
});
} else {
setState(() {
weather =
data != null ? data['Temperature'].toString() + '\u2103' : '--';
});
}
}
void setLocation(Position position) {
this.sharedPref.setDouble(USER_LAT, position.latitude ?? 0.0);
this.sharedPref.setDouble(USER_LONG, position.longitude ?? 0.0);
getAuthUser();
} }
} }

@ -97,8 +97,11 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
width: 60, width: 60,
height: 60, height: 60,
), ),
AppText(weather, Directionality(
fontSize: 22, color: Colors.white) textDirection: TextDirection.ltr,
child: AppText(weather,
fontSize: 22,
color: Colors.white))
], ],
), ),
], ],

@ -577,8 +577,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
authService.getDashboard().then((value) => { authService.getDashboard().then((value) => {
setState(() { setState(() {
notificationCount = value['List_PatientDashboard'][0] notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount'] >
99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount'] ['UnreadPatientNotificationCount']
.toString(); .toString();
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}) })
}); });

@ -360,8 +360,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
context, context,
type, type,
this.mobileNumber, this.mobileNumber,
(value) => {this.checkActivationCode(value: value)}, (value) {
this.checkActivationCode(value: value);
},
() => { () => {
Navigator.pop(context),
print('Faild..'), print('Faild..'),
}, },
).displayDialog(context); ).displayDialog(context);

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:provider/provider.dart';
class ProfileSettings extends StatefulWidget { class ProfileSettings extends StatefulWidget {
@override @override
@ -28,7 +30,9 @@ class _ProfileSettings extends State<ProfileSettings>
@override @override
void initState() { void initState() {
Future.delayed(new Duration(seconds: 0), () { Future.delayed(new Duration(seconds: 0), () {
getSettings(context); ProjectViewModel projectProvider;
projectProvider = Provider.of(context);
if (projectProvider.isLogin == true) getSettings(context);
}); });
super.initState(); super.initState();
} }
@ -37,8 +41,8 @@ class _ProfileSettings extends State<ProfileSettings>
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => {}, onModelReady: (model) => {},
builder: (_, model, wi) => Container( builder: (_, model, wi) => Container(
child: child: model.user != null
ListView(scrollDirection: Axis.vertical, children: <Widget>[ ? ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container( Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: Row( child: Row(
@ -63,14 +67,15 @@ class _ProfileSettings extends State<ProfileSettings>
), ),
), ),
Padding( Padding(
child: AppText(TranslationBase.of(context).languageSetting, child: AppText(
TranslationBase.of(context).languageSetting,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
Container( Container(
color: Colors.white, color: Colors.white,
padding: padding: EdgeInsets.only(
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -88,8 +93,8 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
Container( Container(
color: Colors.white, color: Colors.white,
padding: padding: EdgeInsets.only(
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -111,8 +116,8 @@ class _ProfileSettings extends State<ProfileSettings>
), ),
Container( Container(
color: Colors.white, color: Colors.white,
padding: padding: EdgeInsets.only(
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -131,8 +136,8 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
Container( Container(
color: Colors.white, color: Colors.white,
padding: padding: EdgeInsets.only(
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -155,8 +160,8 @@ class _ProfileSettings extends State<ProfileSettings>
), ),
Container( Container(
color: Colors.white, color: Colors.white,
padding: padding: EdgeInsets.only(
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -170,8 +175,8 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
Container( Container(
color: Colors.white, color: Colors.white,
padding: padding: EdgeInsets.only(
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -185,12 +190,13 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
Container( Container(
color: Colors.white, color: Colors.white,
padding: padding: EdgeInsets.only(
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), top: 0, left: 10, right: 10, bottom: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText(TranslationBase.of(context).emergencyContact), AppText(
TranslationBase.of(context).emergencyContact),
TextField( TextField(
controller: emergencyContact, controller: emergencyContact,
decoration: InputDecoration( decoration: InputDecoration(
@ -212,7 +218,11 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
], ],
)) ))
]))); ])
: Center(
child:
AppText(TranslationBase.of(context).loginToUseService),
)));
} }
getSettings(context) { getSettings(context) {

@ -30,6 +30,14 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
bottom: TabBar( bottom: TabBar(
// isScrollable: true,
indicatorWeight: 5.0,
//indicatorSize: TabBarIndicatorSize.label,
// indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Theme.of(context).primaryColor,
// labelColor: Theme.of(context).primaryColor,
tabs: [ tabs: [
Tab(text: TranslationBase.of(context).general), Tab(text: TranslationBase.of(context).general),
Tab( Tab(

@ -64,7 +64,10 @@ class SMSOTP {
children: <Widget>[ children: <Widget>[
IconButton( IconButton(
icon: Icon(Icons.close), icon: Icon(Icons.close),
onPressed: () => {Navigator.pop(context), this.onSuccess()}, onPressed: () {
Navigator.pop(context);
this.onFailure();
},
) )
], ],
), ),
@ -111,7 +114,7 @@ class SMSOTP {
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
style: buildTextStyle(), style: buildTextStyle(),
autofocus: true, autofocus: true,
maxLength: 1, // maxLength: 1,
controller: digit1, controller: digit1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
@ -138,7 +141,7 @@ class SMSOTP {
child: TextFormField( child: TextFormField(
focusNode: focusD2, focusNode: focusD2,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
maxLength: 1, // maxLength: 1,
controller: digit2, controller: digit2,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: buildTextStyle(), style: buildTextStyle(),
@ -165,7 +168,7 @@ class SMSOTP {
child: TextFormField( child: TextFormField(
focusNode: focusD3, focusNode: focusD3,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
maxLength: 1, // maxLength: 1,
controller: digit3, controller: digit3,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: buildTextStyle(), style: buildTextStyle(),
@ -191,7 +194,7 @@ class SMSOTP {
width: SizeConfig.realScreenWidth * 0.15, width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField( child: TextFormField(
focusNode: focusD4, focusNode: focusD4,
maxLength: 1, // maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: buildTextStyle(), style: buildTextStyle(),
controller: digit4, controller: digit4,

Loading…
Cancel
Save