Silent Login
parent
2b9afe5b58
commit
4eb6faf415
@ -0,0 +1,415 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:hmg_nurses/generated/locale_keys.g.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class AppDateUtils {
|
||||
static String convertDateToFormat(DateTime dateTime, String dateFormat) {
|
||||
return DateFormat(dateFormat).format(dateTime);
|
||||
}
|
||||
|
||||
static DateTime convertISOStringToDateTime(String date) {
|
||||
DateTime newDate;
|
||||
|
||||
newDate = DateTime.parse(date);
|
||||
|
||||
return newDate;
|
||||
}
|
||||
|
||||
static String convertStringToDateFormat(String date, String dateFormat) {
|
||||
DateTime dateTime;
|
||||
if (date.contains("/Date"))
|
||||
dateTime = getDateTimeFromServerFormat(date);
|
||||
else
|
||||
dateTime = DateTime.parse(date);
|
||||
return convertDateToFormat(dateTime, dateFormat);
|
||||
}
|
||||
|
||||
static String convertToServerFormat(String date, String dateFormat) {
|
||||
return '/Date(${DateFormat(dateFormat).parse(date).millisecondsSinceEpoch})/';
|
||||
}
|
||||
|
||||
static String convertDateToServerFormat(DateTime date) {
|
||||
return '/Date(${date.millisecondsSinceEpoch})/';
|
||||
}
|
||||
|
||||
static convertDateFromServerFormat(String str, dateFormat) {
|
||||
var date = getDateTimeFromServerFormat(str);
|
||||
|
||||
return DateFormat(dateFormat).format(date);
|
||||
}
|
||||
|
||||
static DateTime getDateTimeFromServerFormat(String str) {
|
||||
DateTime date = DateTime.now();
|
||||
if (str != null) {
|
||||
const start = "/Date(";
|
||||
|
||||
const end = "+0300)";
|
||||
if (str.contains("/Date")) {
|
||||
final startIndex = str.indexOf(start);
|
||||
|
||||
final endIndex = str.indexOf(end, startIndex + start.length);
|
||||
|
||||
date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex)));
|
||||
} else {
|
||||
date = DateTime.now();
|
||||
}
|
||||
} else {
|
||||
date = DateTime.parse(str);
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate, BuildContext context) {
|
||||
DateTime now = DateTime.now();
|
||||
// now = now.add(Duration(days: 400, minutes: 0));
|
||||
var difference = firstDate.difference(now);
|
||||
|
||||
int years = now.year - firstDate.year;
|
||||
int months = now.month - firstDate.month;
|
||||
int days = now.day - firstDate.day;
|
||||
|
||||
if (months < 0 || (months == 0 && days < 0)) {
|
||||
years--;
|
||||
months += (days < 0 ? 11 : 12);
|
||||
}
|
||||
if (days < 0) {
|
||||
final monthAgo = new DateTime(now.year, now.month - 1, firstDate.day);
|
||||
days = now.difference(monthAgo).inDays + 1;
|
||||
}
|
||||
return "$days ${LocaleKeys.days.tr()}, $months ${LocaleKeys.months.tr()}, $years ${LocaleKeys.years.tr()}";
|
||||
}
|
||||
|
||||
static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context, {bool isShowSecond = false, bool isShowDays = true}) {
|
||||
DateTime now = DateTime.now();
|
||||
var difference = now.difference(firstDate);
|
||||
|
||||
int minutesInDays = difference.inMinutes;
|
||||
int secondInDays = difference.inSeconds;
|
||||
int hoursInDays = minutesInDays ~/ 60; // ~/ : truncating division to make the result int
|
||||
int second = secondInDays % 60;
|
||||
int minutes = minutesInDays % 60;
|
||||
int days = hoursInDays ~/ 24;
|
||||
int hours = hoursInDays % 24;
|
||||
|
||||
double hoursInOneDay = difference.inHours / difference.inDays;
|
||||
|
||||
return (isShowDays ? (days > 0 ? "$days ${LocaleKeys.days.tr()}," : '') : "") +
|
||||
(hours > 0 ? "$hours ${LocaleKeys.hr.tr()}," : "") +
|
||||
" $minutes ${LocaleKeys.min.tr()}" +
|
||||
(isShowSecond ? ", $second Sec" : "");
|
||||
}
|
||||
|
||||
static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) {
|
||||
const start = "/Date(";
|
||||
|
||||
const end = "+0300)";
|
||||
|
||||
final startIndex = str.indexOf(start);
|
||||
|
||||
final endIndex = str.indexOf(end, startIndex + start.length);
|
||||
|
||||
var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex)));
|
||||
return differenceBetweenDateAndCurrent(date, context);
|
||||
}
|
||||
|
||||
/// get month by
|
||||
/// [weekDay] convert week day in int to week day name
|
||||
static getWeekDay(int weekDay) {
|
||||
switch (weekDay) {
|
||||
case 1:
|
||||
return "Monday";
|
||||
case 2:
|
||||
return "Tuesday";
|
||||
case 3:
|
||||
return "Wednesday";
|
||||
case 4:
|
||||
return "Thursday";
|
||||
case 5:
|
||||
return "Friday";
|
||||
case 6:
|
||||
return "Saturday ";
|
||||
case 7:
|
||||
return "Sunday";
|
||||
}
|
||||
}
|
||||
|
||||
/// get month by
|
||||
/// [weekDay] convert week day in int to week day name arabic
|
||||
static getWeekDayArabic(int weekDay) {
|
||||
switch (weekDay) {
|
||||
case 1:
|
||||
return "الاثنين";
|
||||
case 2:
|
||||
return "الثلاثاء";
|
||||
case 3:
|
||||
return "الاربعاء";
|
||||
case 4:
|
||||
return "الخميس";
|
||||
case 5:
|
||||
return "الجمعه";
|
||||
case 6:
|
||||
return "السبت ";
|
||||
case 7:
|
||||
return "الاحد";
|
||||
}
|
||||
}
|
||||
|
||||
/// get month by
|
||||
/// [month] convert month number in to month name
|
||||
static getMonth(int month) {
|
||||
switch (month) {
|
||||
case 1:
|
||||
return "January";
|
||||
case 2:
|
||||
return "February";
|
||||
case 3:
|
||||
return "March";
|
||||
case 4:
|
||||
return "April";
|
||||
case 5:
|
||||
return "May";
|
||||
case 6:
|
||||
return "June";
|
||||
case 7:
|
||||
return "July";
|
||||
case 8:
|
||||
return "August";
|
||||
case 9:
|
||||
return "September";
|
||||
case 10:
|
||||
return "October";
|
||||
case 11:
|
||||
return "November";
|
||||
case 12:
|
||||
return "December";
|
||||
}
|
||||
}
|
||||
|
||||
/// get month by
|
||||
/// [month] convert month number in to month name in Arabic
|
||||
static getMonthArabic(int month) {
|
||||
switch (month) {
|
||||
case 1:
|
||||
return "يناير";
|
||||
case 2:
|
||||
return " فبراير";
|
||||
case 3:
|
||||
return "مارس";
|
||||
case 4:
|
||||
return "أبريل";
|
||||
case 5:
|
||||
return "مايو";
|
||||
case 6:
|
||||
return "يونيو";
|
||||
case 7:
|
||||
return "يوليو";
|
||||
case 8:
|
||||
return "أغسطس";
|
||||
case 9:
|
||||
return "سبتمبر";
|
||||
case 10:
|
||||
return " اكتوبر";
|
||||
case 11:
|
||||
return " نوفمبر";
|
||||
case 12:
|
||||
return "ديسمبر";
|
||||
}
|
||||
}
|
||||
|
||||
static getMonthByName(String month) {
|
||||
switch (month.toLowerCase()) {
|
||||
case 'january':
|
||||
return 1;
|
||||
case 'february':
|
||||
return 2;
|
||||
case 'march':
|
||||
return 3;
|
||||
case 'april':
|
||||
return 4;
|
||||
case 'may':
|
||||
return 5;
|
||||
case 'june':
|
||||
return 6;
|
||||
case 'july':
|
||||
return 7;
|
||||
case 'august':
|
||||
return 8;
|
||||
case 'september':
|
||||
return 9;
|
||||
case 'october':
|
||||
return 10;
|
||||
case 'november':
|
||||
return 11;
|
||||
case 'december':
|
||||
return 12;
|
||||
}
|
||||
}
|
||||
|
||||
static DateTime convertStringToDate(String date) {
|
||||
// /Date(1585774800000+0300)/
|
||||
|
||||
if (date != null) {
|
||||
const start = "/Date(";
|
||||
const end = "+0300)";
|
||||
final startIndex = date.indexOf(start);
|
||||
final endIndex = date.indexOf(end, startIndex + start.length);
|
||||
DateTime newDate = DateTime.fromMillisecondsSinceEpoch(
|
||||
int.parse(
|
||||
date.substring(startIndex + start.length, endIndex),
|
||||
),
|
||||
);
|
||||
return newDate;
|
||||
} else
|
||||
return DateTime.now();
|
||||
}
|
||||
|
||||
/// get data formatted like Apr 26,2020
|
||||
/// [dateTime] convert DateTime to data formatted Arabic
|
||||
static String getMonthDayYearDateFormattedAr(DateTime dateTime) {
|
||||
if (dateTime != null)
|
||||
return getMonthArabic(dateTime.month) + " " + dateTime.day.toString() + ", " + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like Apr 26,2020
|
||||
/// [dateTime] convert DateTime to data formatted
|
||||
static String getMonthDayYearDateFormatted(DateTime dateTime, {bool isArabic = false}) {
|
||||
if (dateTime != null)
|
||||
return isArabic ? getMonthArabic(dateTime.month) : getMonth(dateTime.month) + " " + dateTime.day.toString() + ", " + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like 26 Apr 2020
|
||||
/// [dateTime] convert DateTime to data formatted
|
||||
static String getDayMonthYearDateFormatted(DateTime dateTime, {bool isArabic = false, bool isMonthShort = true}) {
|
||||
if (dateTime != null)
|
||||
return dateTime.day.toString() +
|
||||
" " +
|
||||
"${isArabic ? getMonthArabic(dateTime.month) : isMonthShort ? getMonth(dateTime.month).toString().substring(0, 3) : getMonth(dateTime.month)}" +
|
||||
" " +
|
||||
dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like 26/4/2020
|
||||
/// [dateTime] convert DateTime to data formatted
|
||||
static String getDayMonthYearDate(DateTime dateTime, {bool isArabic = false}) {
|
||||
if (dateTime != null)
|
||||
return dateTime.day.toString() + "/" + "${dateTime.month}" + "/" + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/// get data formatted like 10:45 PM
|
||||
/// [dateTime] convert DateTime to data formatted
|
||||
static String getHour(DateTime dateTime) {
|
||||
return DateFormat('hh:mm a').format(dateTime);
|
||||
}
|
||||
|
||||
static String getAgeByBirthday(String birthOfDate, BuildContext context, {bool isServerFormat = true}) {
|
||||
// https://leechy.dev/calculate-dates-diff-in-dart
|
||||
DateTime birthDate;
|
||||
if (birthOfDate.contains("/Date")) {
|
||||
birthDate = AppDateUtils.getDateTimeFromServerFormat(birthOfDate);
|
||||
} else {
|
||||
birthDate = DateTime.parse(birthOfDate);
|
||||
}
|
||||
final now = DateTime.now();
|
||||
int years = now.year - birthDate.year;
|
||||
int months = now.month - birthDate.month;
|
||||
int days = now.day - birthDate.day;
|
||||
if (months < 0 || (months == 0 && days < 0)) {
|
||||
years--;
|
||||
months += (days < 0 ? 11 : 12);
|
||||
}
|
||||
if (days < 0) {
|
||||
final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day);
|
||||
days = now.difference(monthAgo).inDays + 1;
|
||||
}
|
||||
return "$years ${LocaleKeys.years.tr()} $months ${LocaleKeys.months.tr()} $days ${LocaleKeys.days.tr()}";
|
||||
}
|
||||
|
||||
static bool isToday(DateTime dateTime) {
|
||||
DateTime todayDate = DateTime.now().toUtc();
|
||||
if (dateTime.day == todayDate.day && dateTime.month == todayDate.month && dateTime.year == todayDate.year) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static String getDate(DateTime dateTime) {
|
||||
print(dateTime);
|
||||
if (dateTime != null)
|
||||
return getMonth(dateTime.month) + " " + dateTime.day.toString() + "," + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
static String getDateFormatted(DateTime dateTime) {
|
||||
print(dateTime);
|
||||
if (dateTime != null)
|
||||
return dateTime.day.toString() + "/" + dateTime.month.toString() + "/" + dateTime.year.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
static String getTimeHHMMA(DateTime dateTime) {
|
||||
return DateFormat('hh:mm a').format(dateTime);
|
||||
}
|
||||
|
||||
static String getTimeHHMMA2(DateTime dateTime) {
|
||||
return DateFormat('hh:mm').format(dateTime);
|
||||
}
|
||||
|
||||
static String getStartTime(String dateTime) {
|
||||
String time = dateTime;
|
||||
|
||||
if (dateTime.length > 7) time = dateTime.substring(0, 5);
|
||||
return time;
|
||||
}
|
||||
|
||||
static String getTimeFormated(DateTime dateTime) {
|
||||
print(dateTime);
|
||||
if (dateTime != null)
|
||||
return dateTime.hour.toString() + ":" + dateTime.minute.toString();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
// handel date like "09/05/2021 17:00"
|
||||
static DateTime getDateTimeFromString(String str) {
|
||||
List<String> array = str.split('/');
|
||||
int day = int.parse(array[0]);
|
||||
int month = int.parse(array[1]);
|
||||
|
||||
List<String> array2 = array[2].split(' ');
|
||||
int year = int.parse(array2[0]);
|
||||
String hour = array2[1];
|
||||
List<String> hourList = hour.split(":");
|
||||
|
||||
DateTime date = DateTime(year, month, day, int.parse(hourList[0]), int.parse(hourList[1]));
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
static convertDateFormatImproved(String str) {
|
||||
String newDate = "";
|
||||
const start = "/Date(";
|
||||
if (str.isNotEmpty) {
|
||||
const end = "+0300)";
|
||||
|
||||
final startIndex = str.indexOf(start);
|
||||
final endIndex = str.indexOf(end, startIndex + start.length);
|
||||
|
||||
var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex)));
|
||||
newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + "/" + date.day.toString().padLeft(2, '0');
|
||||
}
|
||||
|
||||
return newDate;
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,35 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_nurses/model/base/generic_response_model2.dart';
|
||||
import 'package:hmg_nurses/provider/base_vm.dart';
|
||||
import 'package:hmg_nurses/services/api_repo/dashboard_api_repo.dart';
|
||||
import 'package:injector/injector.dart';
|
||||
|
||||
import '../classes/utils.dart';
|
||||
import '../main.dart';
|
||||
|
||||
/// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool
|
||||
// ignore: prefer_mixin
|
||||
class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
||||
//Attendance Tracking
|
||||
bool isAttendanceTrackingLoading = true;
|
||||
int endTime = 0, isTimeRemainingInSeconds = 0;
|
||||
double progress = 0.0;
|
||||
class DashboardProviderModel extends BaseViewModel {
|
||||
final IDashboardApiRepo _loginApiRepo = Injector.appInstance.get<IDashboardApiRepo>();
|
||||
|
||||
Future<GenericResponseModel2?> getDocProfile() async {
|
||||
try {
|
||||
Utils.showLoading();
|
||||
|
||||
void notify() {
|
||||
notifyListeners();
|
||||
// Utils.showToast(deviceInfo.length.toString());
|
||||
GenericResponseModel2 docProfileModel = await _loginApiRepo.getDoctorProfile();
|
||||
appState.doctorProfile = docProfileModel;
|
||||
await _loginApiRepo.insertDoctorProfile();
|
||||
Utils.hideLoading();
|
||||
return docProfileModel;
|
||||
} catch (e) {
|
||||
Utils.hideLoading();
|
||||
Utils.handleException(e, navigatorKey.currentContext!, (msg) {
|
||||
Utils.confirmDialog(navigatorKey.currentContext!, msg);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,121 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:hmg_nurses/exceptions/api_exception.dart';
|
||||
import 'package:hmg_nurses/main.dart';
|
||||
import 'package:hmg_nurses/model/base/generic_response_model2.dart';
|
||||
import 'package:hmg_nurses/model/login/member_login_model.dart';
|
||||
import 'package:hmg_nurses/model/login/project_info_model.dart';
|
||||
import 'package:hmg_nurses/services/api_client.dart';
|
||||
import 'package:hmg_nurses/classes/consts.dart';
|
||||
import 'package:hmg_nurses/model/base/generic_response_model.dart';
|
||||
import 'package:hmg_nurses/model/login/imei_details_model.dart';
|
||||
import 'package:hmg_nurses/services/firebase_service.dart';
|
||||
import 'package:injector/injector.dart';
|
||||
|
||||
abstract class IDashboardApiRepo {
|
||||
Future<GenericResponseModel2> getDoctorProfile();
|
||||
|
||||
Future insertDoctorProfile();
|
||||
}
|
||||
|
||||
class DashboardApiRepo implements IDashboardApiRepo {
|
||||
@override
|
||||
Future<GenericResponseModel2> getDoctorProfile() async {
|
||||
String url = "${ApiConsts.baseUrlServices}Doctors.svc/REST/GetDocProfiles";
|
||||
Map<String, dynamic> postParams = {};
|
||||
postParams.addAll(appState.postParamsJson);
|
||||
postParams["ProjectID"] = appState.projectID;
|
||||
postParams["ClinicID"] = appState.clinicId;
|
||||
postParams["doctorID"] = appState.memberBeforeLogin!.doctorId;
|
||||
postParams["IsRegistered"] = true;
|
||||
postParams["License"] = true;
|
||||
postParams["TokenID"] = appState.authenticationTokenID;
|
||||
postParams["DoctorID"] = appState.memberBeforeLogin!.doctorId;
|
||||
postParams["PatientOutSA"] = false;
|
||||
|
||||
GenericResponseModel2 response;
|
||||
try {
|
||||
response = await Injector.appInstance.get<IApiClient>().postJsonForObject((json) => GenericResponseModel2.fromJson(json), url, postParams);
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
@override
|
||||
Future insertDoctorProfile() async {
|
||||
String url = "${ApiConsts.baseUrlServices}DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails";
|
||||
Map<String, dynamic> postParams = {};
|
||||
postParams.addAll(appState.postParamsJson);
|
||||
postParams["IMEI"] = appState.imei;
|
||||
postParams["LogInTypeID"] = appState.lastLoginTyp;
|
||||
postParams["OutSA"] = null;
|
||||
postParams["MobileNo"] = appState.doctorProfile!.doctorProfileList!.first.doctorMobileNumber;
|
||||
postParams["IdentificationNo"] = null;
|
||||
postParams["DoctorID"] = appState.doctorUserId;
|
||||
postParams["DoctorName"] = appState.doctorProfile!.doctorProfileList!.first.doctorName;
|
||||
postParams["DoctorNameN"] = appState.doctorProfile!.doctorProfileList!.first.doctorNameN;
|
||||
postParams["ClinicID"] = appState.doctorProfile!.doctorProfileList!.first.clinicId;
|
||||
postParams["ClinicDescription"] = appState.doctorProfile!.doctorProfileList!.first.clinicDescription;
|
||||
postParams["ClinicDescriptionN"] = appState.doctorProfile!.doctorProfileList!.first.clinicDescriptionN;
|
||||
postParams["ProjectName"] = appState.doctorProfile!.doctorProfileList!.first.projectName;
|
||||
postParams["GenderDescription"] = appState.doctorProfile!.doctorProfileList!.first.genderDescription;
|
||||
postParams["GenderDescriptionN"] = appState.doctorProfile!.doctorProfileList!.first.genderDescriptionN;
|
||||
postParams["TitleDescription"] = appState.doctorProfile!.doctorProfileList!.first.titleDescription;
|
||||
postParams["Title_DescriptionN"] = appState.doctorProfile!.doctorProfileList!.first.titleDescriptionN;
|
||||
postParams["BioMetricEnabled"] = true;
|
||||
postParams["PreferredLanguage"] = null;
|
||||
postParams["IsActive"] = appState.doctorProfile!.doctorProfileList!.first.isActive;
|
||||
postParams["EditedBy"] = appState.doctorProfile!.doctorProfileList!.first.doctorId;
|
||||
postParams["ProjectID"] = appState.doctorProfile!.doctorProfileList!.first.projectId;
|
||||
postParams["TokenID"] = appState.authenticationTokenID;
|
||||
postParams["LoginDoctorID"] = appState.doctorProfile!.doctorProfileList!.first.doctorId;
|
||||
postParams["Password"] = appState.password;
|
||||
|
||||
logger.d(jsonEncode(postParams));
|
||||
GenericResponseModel response;
|
||||
try {
|
||||
response = await Injector.appInstance.get<IApiClient>().postJsonForObject((json) => GenericResponseModel.fromJson(json), url, postParams);
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// {
|
||||
// "IMEI": "es6V9NcpSzCXR665uSDWGo:APA91bGF_FjdOf8ZOZmw5FU7pkDfzNOvkz-IsSBRrJE6OR0ZE2lyeTxzFtvjZEajUEC_ssD6ytKNEm74lm30KpZEvPdrNgSRR8idlGrRqJ6qK2Lp2lrLtgA1OLMjkkQS1bcpvXcdnEg_",
|
||||
// "LogInTypeID": 1,
|
||||
// "OutSA": null,
|
||||
// "MobileNo": "0553755378",
|
||||
// "IdentificationNo": null,
|
||||
// "DoctorID": 13777,
|
||||
// "DoctorName": "EYAD ISMAIL ABU-JAYAB",
|
||||
// "DoctorNameN": null,
|
||||
// "ClinicID": 1,
|
||||
// "ClinicDescription": "INTERNAL MEDICINE CLINIC",
|
||||
// "ClinicDescriptionN": null,
|
||||
// "ProjectName": "Olaya Hospital",
|
||||
// "GenderDescription": "Male",
|
||||
// "GenderDescriptionN": null,
|
||||
// "TitleDescription": "Dr.",
|
||||
// "Title_DescriptionN": null,
|
||||
// "BioMetricEnabled": true,
|
||||
// "PreferredLanguage": null,
|
||||
// "IsActive": false,
|
||||
// "EditedBy": 2477,
|
||||
// "ProjectID": 12,
|
||||
// "TokenID": "W7qObFELE0+VAtKJoTeq+w==",
|
||||
// "LanguageID": 2,
|
||||
// "stamp": "2022-11-27T10:50:25.345098",
|
||||
// "IPAdress": "9.9.9.9",
|
||||
// "VersionID": 9,
|
||||
// "Channel": 9,
|
||||
// "SessionID": "BlUSkYymTt",
|
||||
// "IsLoginForDoctorApp": true,
|
||||
// "PatientOutSA": false,
|
||||
// "VidaAuthTokenID": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMzc3NyIsImp0aSI6IjNiM2U5MTU4LTJhNmEtNGM4MS04OTk5LWU3ZTRhYzUzMmFiOCIsImVtYWlsIjoiUndhaWQuQWxtYWxsYWhAY2xvdWRzb2x1dGlvbnMuY29tLnNhIiwiaWQiOiIxMzc3NyIsIk5hbWUiOiJSd2FpZCBGb3VkIEhhc3NhbiBBbE1hbGxhaCIsIkVtcGxveWVlSWQiOiIyNDc3IiwiRmFjaWxpdHlHcm91cElkIjoiOTE4NzciLCJGYWNpbGl0eUlkIjoiMTIiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NiIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjI0NzciLCJTRVNTSU9OSUQiOiIyMDYzNDY2OCIsIkNsaW5pY0lkIjoiMSIsIm5iZiI6MTY2OTUzNTQxMSwiZXhwIjoxNjcwMzk5NDExLCJpYXQiOjE2Njk1MzU0MTF9.LkZMiDAt9F4yjbuNyMSIcZYIgct6VuPed7uPOw0PTVw",
|
||||
// "VidaRefreshTokenID": "sm30FcA2iL0lJmSCAVlNJJ8e0AbfYzHxg+wMGTBSoP9VM9do55BRxjATjBtOJyo60u8tLRk9LHrmmH8Xn+B25A==",
|
||||
// "Password": "Rr123456",
|
||||
// "LoginDoctorID": 2477,
|
||||
// "DeviceTypeID": 1
|
||||
// }
|
||||
@ -1,27 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:hmg_nurses/services/api_client.dart';
|
||||
import 'package:hmg_nurses/config/app_state.dart';
|
||||
import 'package:hmg_nurses/classes/consts.dart';
|
||||
|
||||
|
||||
class LoginApiClient {
|
||||
static final LoginApiClient _instance = LoginApiClient._internal();
|
||||
|
||||
LoginApiClient._internal();
|
||||
|
||||
factory LoginApiClient() => _instance;
|
||||
|
||||
// Future<GetMobileLoginInfoListModel?> getMobileLoginInfoNEW(String deviceToken, String deviceType) async {
|
||||
// String url = "${ApiConsts.erpRest}Mohemm_GetMobileLoginInfo_NEW";
|
||||
// Map<String, dynamic> postParams = {};
|
||||
// postParams["DeviceToken"] = deviceToken;
|
||||
// postParams["DeviceType"] = deviceType;
|
||||
// return await ApiClient().postJsonForObject((json) {
|
||||
// GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
|
||||
// return (responseData.mohemmGetMobileLoginInfoList?.length ?? 0) > 0 ? (responseData.mohemmGetMobileLoginInfoList!.first) : null;
|
||||
// }, url, postParams);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_nurses/main.dart';
|
||||
import 'package:hmg_nurses/provider/dashboard_provider_model.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class DashboardPage extends StatefulWidget {
|
||||
@override
|
||||
State<DashboardPage> createState() => _DashboardPageState();
|
||||
}
|
||||
|
||||
class _DashboardPageState extends State<DashboardPage> {
|
||||
late DashboardProviderModel provider;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
provider = Provider.of<DashboardProviderModel>(navigatorKey.currentContext!);
|
||||
provider.getDocProfile();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue