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'] ['UnreadPatientNotificationCount'] >
.toString(); 99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.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,182 +41,188 @@ 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(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNo, TranslationBase.of(context).fileNo,
color: Colors.black, color: Colors.black,
),
AppText(
model.user.patientID.toString(),
color: Colors.black,
),
],
),
), ),
AppText( SizedBox(
model.user.patientID.toString(), height: 1,
color: Colors.black, width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey[300],
),
), ),
], Padding(
), child: AppText(
), TranslationBase.of(context).languageSetting,
SizedBox( fontWeight: FontWeight.bold),
height: 1, padding: EdgeInsets.all(10),
width: MediaQuery.of(context).size.width, ),
child: Container( Container(
color: Colors.grey[300], color: Colors.white,
), padding: EdgeInsets.only(
), top: 0, left: 10, right: 10, bottom: 0),
Padding( child: Row(
child: AppText(TranslationBase.of(context).languageSetting, mainAxisAlignment: MainAxisAlignment.spaceBetween,
fontWeight: FontWeight.bold), children: [
padding: EdgeInsets.all(10), AppText(TranslationBase.of(context).english),
), new Radio(
Container( value: 2,
color: Colors.white, groupValue: language,
padding: onChanged: (value) {
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), setState(() {
child: Row( language = value;
mainAxisAlignment: MainAxisAlignment.spaceBetween, });
children: [ },
AppText(TranslationBase.of(context).english), )
new Radio( ],
value: 2, )),
groupValue: language, Container(
onChanged: (value) { color: Colors.white,
setState(() { padding: EdgeInsets.only(
language = value; top: 0, left: 10, right: 10, bottom: 0),
}); child: Row(
}, mainAxisAlignment: MainAxisAlignment.spaceBetween,
) children: [
], AppText(TranslationBase.of(context).arabic),
)), new Radio(
Container( value: 1,
color: Colors.white, groupValue: language,
padding: onChanged: (value) {
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), setState(() {
child: Row( language = value;
mainAxisAlignment: MainAxisAlignment.spaceBetween, });
children: [ },
AppText(TranslationBase.of(context).arabic), )
new Radio( ],
value: 1, )),
groupValue: language, Padding(
onChanged: (value) { child: AppText(TranslationBase.of(context).alert),
setState(() { padding: EdgeInsets.all(10),
language = value; ),
}); Container(
}, color: Colors.white,
) padding: EdgeInsets.only(
], top: 0, left: 10, right: 10, bottom: 0),
)), child: Row(
Padding( mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: AppText(TranslationBase.of(context).alert), children: [
padding: EdgeInsets.all(10), AppText(TranslationBase.of(context).emailAlert),
), Switch(
Container( value: emailAlert,
color: Colors.white, onChanged: (value) {
padding: setState(() {
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), emailAlert = value;
child: Row( });
mainAxisAlignment: MainAxisAlignment.spaceBetween, },
children: [ activeTrackColor: Colors.lightGreenAccent,
AppText(TranslationBase.of(context).emailAlert), activeColor: Colors.green,
Switch( )
value: emailAlert, ],
onChanged: (value) { )),
setState(() { Container(
emailAlert = value; color: Colors.white,
}); padding: EdgeInsets.only(
}, top: 0, left: 10, right: 10, bottom: 0),
activeTrackColor: Colors.lightGreenAccent, child: Row(
activeColor: Colors.green, mainAxisAlignment: MainAxisAlignment.spaceBetween,
) children: [
], AppText(TranslationBase.of(context).smsAlert),
)), Switch(
Container( value: smsAlert,
color: Colors.white, onChanged: (value) {
padding: setState(() {
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), smsAlert = value;
child: Row( });
mainAxisAlignment: MainAxisAlignment.spaceBetween, },
children: [ activeTrackColor: Colors.lightGreenAccent,
AppText(TranslationBase.of(context).smsAlert), activeColor: Colors.green,
Switch( )
value: smsAlert, ],
onChanged: (value) { )),
setState(() { Padding(
smsAlert = value; child: AppText(TranslationBase.of(context).contactInfo),
}); padding: EdgeInsets.all(10),
}, ),
activeTrackColor: Colors.lightGreenAccent, Container(
activeColor: Colors.green, color: Colors.white,
) padding: EdgeInsets.only(
], top: 0, left: 10, right: 10, bottom: 0),
)), child: Column(
Padding( crossAxisAlignment: CrossAxisAlignment.start,
child: AppText(TranslationBase.of(context).contactInfo), children: [
padding: EdgeInsets.all(10), AppText(TranslationBase.of(context).email),
), TextField(
Container( controller: emailController,
color: Colors.white, decoration: InputDecoration(
padding: suffixIcon: Icon(Icons.edit),
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), ))
child: Column( ],
crossAxisAlignment: CrossAxisAlignment.start, )),
children: [ Container(
AppText(TranslationBase.of(context).email), color: Colors.white,
TextField( padding: EdgeInsets.only(
controller: emailController, top: 0, left: 10, right: 10, bottom: 0),
decoration: InputDecoration( child: Column(
suffixIcon: Icon(Icons.edit), crossAxisAlignment: CrossAxisAlignment.start,
)) children: [
], AppText(TranslationBase.of(context).emergencyName),
)), TextField(
Container( controller: emergencyContactName,
color: Colors.white, decoration: InputDecoration(
padding: suffixIcon: Icon(Icons.edit),
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), ))
child: Column( ],
crossAxisAlignment: CrossAxisAlignment.start, )),
children: [ Container(
AppText(TranslationBase.of(context).emergencyName), color: Colors.white,
TextField( padding: EdgeInsets.only(
controller: emergencyContactName, top: 0, left: 10, right: 10, bottom: 0),
decoration: InputDecoration( child: Column(
suffixIcon: Icon(Icons.edit), crossAxisAlignment: CrossAxisAlignment.start,
)) children: [
], AppText(
)), TranslationBase.of(context).emergencyContact),
Container( TextField(
color: Colors.white, controller: emergencyContact,
padding: decoration: InputDecoration(
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), suffixIcon: Icon(Icons.edit),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, )
children: [ ],
AppText(TranslationBase.of(context).emergencyContact), )),
TextField( Container(
controller: emergencyContact, padding: EdgeInsets.all(10),
decoration: InputDecoration( child: Row(
suffixIcon: Icon(Icons.edit), children: <Widget>[
), Expanded(
) child: DefaultButton(
], TranslationBase.of(context).submit,
)), () {
Container( saveSettings();
padding: EdgeInsets.all(10), },
child: Row( )),
children: <Widget>[ ],
Expanded( ))
child: DefaultButton( ])
TranslationBase.of(context).submit, : Center(
() { child:
saveSettings(); 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