|
|
|
|
@ -4,7 +4,9 @@ import 'dart:typed_data';
|
|
|
|
|
|
|
|
|
|
import 'package:badges/badges.dart';
|
|
|
|
|
import 'package:connectivity/connectivity.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/Blood/my_balance_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
|
|
|
|
|
@ -33,6 +35,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
|
|
|
|
|
import '../Constants.dart';
|
|
|
|
|
import 'app_shared_preferences.dart';
|
|
|
|
|
@ -491,22 +494,24 @@ class Utils {
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
if (projectViewModel.havePrivilege(32)) {
|
|
|
|
|
if (projectViewModel.havePrivilege(32) || true) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (projectViewModel.isLogin) {
|
|
|
|
|
String patientID = AuthProvider().getAuthenticatedUser().patientID.toString();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)});
|
|
|
|
|
} else {
|
|
|
|
|
AlertDialogBox(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: "Please login with your account first to use this feature",
|
|
|
|
|
okText: "OK",
|
|
|
|
|
okFunction: () {
|
|
|
|
|
AlertDialogBox.closeAlertDialog(context);
|
|
|
|
|
}).showAlertDialog(context);
|
|
|
|
|
}
|
|
|
|
|
userData().then((userData_){
|
|
|
|
|
if (projectViewModel.isLogin && userData_ != null) {
|
|
|
|
|
String patientID = userData_.patientID.toString();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)});
|
|
|
|
|
} else {
|
|
|
|
|
AlertDialogBox(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: "Please login with your account first to use this feature",
|
|
|
|
|
okText: "OK",
|
|
|
|
|
okFunction: () {
|
|
|
|
|
AlertDialogBox.closeAlertDialog(context);
|
|
|
|
|
}).showAlertDialog(context);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).internet,
|
|
|
|
|
@ -534,6 +539,11 @@ class Utils {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<AuthenticatedUser> userData() async {
|
|
|
|
|
var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER));
|
|
|
|
|
return userData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// extension function that use in iterations(list.. etc) to iterate items and get index and item it self
|
|
|
|
|
extension IndexedIterable<E> on Iterable<E> {
|
|
|
|
|
Iterable<T> mapIndexed<T>(T Function(E e, int i) f) {
|
|
|
|
|
|