bug fixes

fix_issues
Sultan Khan 5 years ago
parent fc0117754d
commit 81c8239412

@ -1215,6 +1215,9 @@ const Map localizedValues = {
"en": "This service is designed to enable you to have a quick link to the list of tasks that need to be done", "en": "This service is designed to enable you to have a quick link to the list of tasks that need to be done",
"ar": "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" "ar": "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها"
}, },
"family-info": {
"en": "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.",
"ar": "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
}
}; };

@ -13,7 +13,7 @@ class WeatherViewModel extends BaseViewModel {
WeatherService _weatherService = locator<WeatherService>(); WeatherService _weatherService = locator<WeatherService>();
List<GetCityInfoList> get weatherIndicatorData => List<GetCityInfoList> get weatherIndicatorData =>
_weatherService.weatherIndicatorData; _weatherService.weatherIndicatorData;
getWeatherData({int id, int projectID}) async { getWeatherData() async {
setState(ViewState.Busy); setState(ViewState.Busy);
// if (id != null && projectID != null) { // if (id != null && projectID != null) {

@ -52,6 +52,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getAuthUser(); getAuthUser();
locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(); locationUtils.getCurrentLocation();
}); });
super.initState(); super.initState();
@ -272,7 +274,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
}); });
} }
var data = await this.sharedPref.getObject(WEATHER); var data = await this.sharedPref.getObject(WEATHER);
weather = data['Temperature'].toString() + '\u2103' ?? '--'; weather = data !=null ? data['Temperature'].toString() + '\u2103' : '--';
print(data); print(data);
} }
} }

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -19,13 +21,15 @@ class HealthWeatherIndicator extends StatefulWidget {
class _HospitalsPageState extends State<HealthWeatherIndicator> { class _HospitalsPageState extends State<HealthWeatherIndicator> {
var data; var data;
LocationUtils locationUtils; LocationUtils locationUtils;
AppSharedPreferences sharedPref = AppSharedPreferences();
var weather = '--';
@override @override
void initState() { void initState() {
locationUtils = locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context); new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance WidgetsBinding.instance
.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); .addPostFrameCallback((_) => locationUtils.getCurrentLocation());
getWeather();
super.initState(); super.initState();
} }
@override @override
@ -33,14 +37,73 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<WeatherViewModel>( return BaseView<WeatherViewModel>(
onModelReady: (model) => model.getWeatherData(), onModelReady: (model) => model.getWeatherData(),
allowAny:true,
builder: (_, mode, widget) => AppScaffold( builder: (_, mode, widget) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).healthWeatherIndicators, appBarTitle: TranslationBase.of(context).healthWeatherIndicators,
isShowAppBar: true, isShowAppBar: true,
baseViewModel: mode,
body: mode.weatherIndicatorData.length>0 ? SingleChildScrollView( body: mode.weatherIndicatorData.length>0 ? SingleChildScrollView(
child: Column(children: [ child: Column(children: [
Container(
margin: EdgeInsets.all(8),
width: double.infinity,
height: 150,
decoration: BoxDecoration(
image: DecorationImage(
image: ExactAssetImage('assets/images/Weather_img.png'),
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(8.0)),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Row(
children: [
Expanded(
flex:3,
child:
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.healthWeatherIndicators,
color: Colors.white,
fontWeight: FontWeight.w600,
),
AppText(
TranslationBase.of(context).healthTipsBasedOnCurrentWeather,
color: Colors.white,
fontSize: 14,
),
],
)),
Expanded(
flex: 2,
child:InkWell(
onTap: (){
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset('assets/images/Weather_ico.png',width: 60,height: 60,),
AppText(weather, fontSize: 22, color:Colors.white)
],),
],
)),
)
],
),
),
),
Padding(padding: EdgeInsets.all(15), child:AppText( projectViewModel.isArabic ? mode.weatherIndicatorData[0].cityNameN : mode.weatherIndicatorData[0].cityName, fontSize: 24, fontWeight: FontWeight.bold,)), Padding(padding: EdgeInsets.all(15), child:AppText( projectViewModel.isArabic ? mode.weatherIndicatorData[0].cityNameN : mode.weatherIndicatorData[0].cityName, fontSize: 24, fontWeight: FontWeight.bold,)),
Padding( Padding(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: Column(children: child: Column(children:
@ -50,7 +113,14 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
data); data);
}).toList() }).toList()
))])) : Container(child:AppText('Loading...'))), ))])) : Container()),
); );
} }
getWeather() async{
var data = await this.sharedPref.getObject(WEATHER);
setState(() {
weather = data['Temperature'].toString() + '\u2103' ?? '--';
});
}
} }

@ -1,12 +1,13 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as list;
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -28,7 +29,6 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class MyFamily extends StatefulWidget { class MyFamily extends StatefulWidget {
final bool isAppbarVisible; final bool isAppbarVisible;
MyFamily({this.isAppbarVisible =true}); MyFamily({this.isAppbarVisible =true});
@ -37,6 +37,7 @@ class MyFamily extends StatefulWidget {
} }
class _MyFamily extends State<MyFamily> with TickerProviderStateMixin { class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
List<ImagesInfo> imagesInfo = List();
final familyFileProvider = FamilyFilesProvider(); final familyFileProvider = FamilyFilesProvider();
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
var userID; var userID;
@ -56,12 +57,27 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
bool expandFlag = false; bool expandFlag = false;
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'),
);
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'),
);
projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles, appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: widget.isAppbarVisible, isShowAppBar: widget.isAppbarVisible,
imagesInfo: imagesInfo,
description: TranslationBase.of(context).familyInfo,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
@ -648,7 +664,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
// Navigator.of(context).pushNamed( // Navigator.of(context).pushNamed(
// HOME, // HOME,
// ); // );
result = CheckActivationCode.fromJson(result); result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE); var familyFile = await sharedPref.getObject(FAMILY_FILE);
var mainUser = await sharedPref.getObject(MAIN_USER); var mainUser = await sharedPref.getObject(MAIN_USER);
this.sharedPref.clear(); this.sharedPref.clear();

@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
@ -71,7 +72,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
bool isPageNavigated = false; bool isPageNavigated = false;
LocationUtils locationUtils;
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
setState(() { setState(() {
currentTab = tab; currentTab = tab;
@ -138,7 +139,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance
.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
if (Platform.isIOS) { if (Platform.isIOS) {

@ -15,12 +15,12 @@ class LocationUtils {
void getCurrentLocation() async { void getCurrentLocation() async {
print("current location"); print("current location");
isLocationServiceEnabled().then((value) { Geolocator.isLocationServiceEnabled().then((value) {
if (value) { if (value) {
checkPermission().then((permission) { Geolocator.checkPermission().then((permission) {
if (permission == LocationPermission.always || if (permission == LocationPermission.always ||
permission == LocationPermission.whileInUse) { permission == LocationPermission.whileInUse) {
getLastKnownPosition().then((value) => setLocation(value)); Geolocator.getLastKnownPosition().then((value) => setLocation(value));
} }
if (permission == LocationPermission.denied || if (permission == LocationPermission.denied ||
@ -48,9 +48,9 @@ class LocationUtils {
okFunction: () => { okFunction: () => {
ConfirmDialog.closeAlertDialog(context), ConfirmDialog.closeAlertDialog(context),
if (isPermissionError) if (isPermissionError)
openAppSettings() Geolocator.openAppSettings()
else else
openLocationSettings() Geolocator.openLocationSettings()
}, },
cancelFunction: () => {}); cancelFunction: () => {});
return dialog.showAlertDialog(context); return dialog.showAlertDialog(context);

@ -910,6 +910,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get infoMyAppointments => localizedValues['info-my-appointments'][locale.languageCode]; String get infoMyAppointments => localizedValues['info-my-appointments'][locale.languageCode];
String get infoTodo => localizedValues['info-todo'][locale.languageCode]; String get infoTodo => localizedValues['info-todo'][locale.languageCode];
String get familyInfo => localizedValues['family-info'][locale.languageCode];
} }

Loading…
Cancel
Save