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,
onSuccess: (dynamic response, int statusCode) {
response['GetCityInfo_List'].forEach((data) {
weatherIndicatorData.add(GetCityInfoList.fromJson(data));
});
print(weatherIndicatorData);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, 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/core/service/weather_service.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/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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:url_launcher/url_launcher.dart';
class AllHabibMedicalService extends StatefulWidget {
@ -48,14 +50,16 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
AuthenticatedUser authUser = new AuthenticatedUser();
LocationUtils locationUtils;
var weather = '--';
WeatherService _weatherService = WeatherService();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getAuthUser();
locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation();
WidgetsBinding.instance.addPostFrameCallback((_) => {
Geolocator.getLastKnownPosition()
.then((value) => setLocation(value))
});
});
super.initState();
}
@ -130,8 +134,11 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
width: 60,
height: 60,
),
AppText(weather,
fontSize: 22, color: Colors.white)
Directionality(
textDirection: TextDirection.ltr,
child: AppText(weather,
fontSize: 22,
color: Colors.white))
],
),
Texts(
@ -276,7 +283,23 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
});
}
var data = await this.sharedPref.getObject(WEATHER);
weather = data != null ? data['Temperature'].toString() + '\u2103' : '--';
print(data);
if (data == null) {
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,
height: 60,
),
AppText(weather,
fontSize: 22, color: Colors.white)
Directionality(
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) => {
setState(() {
notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
['UnreadPatientNotificationCount'] >
99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
})
});

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

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/config.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/services/authentication/auth_provider.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/material.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:provider/provider.dart';
class ProfileSettings extends StatefulWidget {
@override
@ -28,7 +30,9 @@ class _ProfileSettings extends State<ProfileSettings>
@override
void initState() {
Future.delayed(new Duration(seconds: 0), () {
getSettings(context);
ProjectViewModel projectProvider;
projectProvider = Provider.of(context);
if (projectProvider.isLogin == true) getSettings(context);
});
super.initState();
}
@ -37,182 +41,188 @@ class _ProfileSettings extends State<ProfileSettings>
return BaseView<DashboardViewModel>(
onModelReady: (model) => {},
builder: (_, model, wi) => Container(
child:
ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context).fileNo,
color: Colors.black,
child: model.user != null
? ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context).fileNo,
color: Colors.black,
),
AppText(
model.user.patientID.toString(),
color: Colors.black,
),
],
),
),
AppText(
model.user.patientID.toString(),
color: Colors.black,
SizedBox(
height: 1,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey[300],
),
),
],
),
),
SizedBox(
height: 1,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey[300],
),
),
Padding(
child: AppText(TranslationBase.of(context).languageSetting,
fontWeight: FontWeight.bold),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).english),
new Radio(
value: 2,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
)
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).arabic),
new Radio(
value: 1,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).alert),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).emailAlert),
Switch(
value: emailAlert,
onChanged: (value) {
setState(() {
emailAlert = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).smsAlert),
Switch(
value: smsAlert,
onChanged: (value) {
setState(() {
smsAlert = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).contactInfo),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).email),
TextField(
controller: emailController,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).emergencyName),
TextField(
controller: emergencyContactName,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).emergencyContact),
TextField(
controller: emergencyContact,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
),
)
],
)),
Container(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).submit,
() {
saveSettings();
},
)),
],
))
])));
Padding(
child: AppText(
TranslationBase.of(context).languageSetting,
fontWeight: FontWeight.bold),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).english),
new Radio(
value: 2,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).arabic),
new Radio(
value: 1,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).alert),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).emailAlert),
Switch(
value: emailAlert,
onChanged: (value) {
setState(() {
emailAlert = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).smsAlert),
Switch(
value: smsAlert,
onChanged: (value) {
setState(() {
smsAlert = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).contactInfo),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).email),
TextField(
controller: emailController,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).emergencyName),
TextField(
controller: emergencyContactName,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).emergencyContact),
TextField(
controller: emergencyContact,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
),
)
],
)),
Container(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).submit,
() {
saveSettings();
},
)),
],
))
])
: Center(
child:
AppText(TranslationBase.of(context).loginToUseService),
)));
}
getSettings(context) {

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

@ -64,7 +64,10 @@ class SMSOTP {
children: <Widget>[
IconButton(
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,
style: buildTextStyle(),
autofocus: true,
maxLength: 1,
// maxLength: 1,
controller: digit1,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
@ -138,7 +141,7 @@ class SMSOTP {
child: TextFormField(
focusNode: focusD2,
textInputAction: TextInputAction.next,
maxLength: 1,
// maxLength: 1,
controller: digit2,
textAlign: TextAlign.center,
style: buildTextStyle(),
@ -165,7 +168,7 @@ class SMSOTP {
child: TextFormField(
focusNode: focusD3,
textInputAction: TextInputAction.next,
maxLength: 1,
// maxLength: 1,
controller: digit3,
textAlign: TextAlign.center,
style: buildTextStyle(),
@ -191,7 +194,7 @@ class SMSOTP {
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD4,
maxLength: 1,
// maxLength: 1,
textAlign: TextAlign.center,
style: buildTextStyle(),
controller: digit4,

Loading…
Cancel
Save