|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/weather_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/locator.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_page.dart';
|
|
|
|
@ -15,14 +17,16 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dar
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/location_util.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart';
|
|
|
|
@ -51,6 +55,9 @@ class AllHabibMedicalService extends StatefulWidget {
|
|
|
|
|
class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
|
|
|
|
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
|
|
|
|
AuthenticatedUser authUser = new AuthenticatedUser();
|
|
|
|
|
AuthProvider authProvider = new AuthProvider();
|
|
|
|
|
PharmacyModuleViewModel pharmacyModuleViewModel =
|
|
|
|
|
locator<PharmacyModuleViewModel>();
|
|
|
|
|
LocationUtils locationUtils;
|
|
|
|
|
var weather = '--';
|
|
|
|
|
WeatherService _weatherService = WeatherService();
|
|
|
|
@ -224,12 +231,13 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
|
|
|
|
|
title: TranslationBase.of(context).emergencyService,
|
|
|
|
|
),
|
|
|
|
|
ServicesContainer(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: ParkingPage(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onTap: () => getPharmacyToken(),
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// FadePage(
|
|
|
|
|
// page: ParkingPage(),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
imageLocation: 'assets/images/pharmacy_logo.png',
|
|
|
|
|
title: TranslationBase.of(context).pharmacy),
|
|
|
|
|
ServicesContainer(
|
|
|
|
@ -380,6 +388,25 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getPharmacyToken() async {
|
|
|
|
|
if (!authProvider.isLogin) {
|
|
|
|
|
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
|
|
|
|
|
if (pharmacyModuleViewModel.error.isNotEmpty) {
|
|
|
|
|
await pharmacyModuleViewModel.createUser().then((value) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getAuthUser() async {
|
|
|
|
|
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
|
|
|
|
|
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
|
|
|
|
|