pull/3/head
haroon amjad 1 year ago
parent d7ab1c8dc2
commit f8c207d33f

@ -27,7 +27,6 @@ import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'package:mohem_flutter_app/models/privilege_list_model.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/button/hmg_connectivity_button.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart';
// import 'package:safe_device/safe_device.dart';
@ -98,6 +97,7 @@ class _LoginScreenState extends State<LoginScreen> {
Future<void> checkFirebaseToken() async {
try {
await checkPrefs();
Utils.showLoading(context);
if (Platform.isAndroid) {
try {
@ -120,6 +120,9 @@ class _LoginScreenState extends State<LoginScreen> {
await Firebase.initializeApp();
_firebaseMessaging = FirebaseMessaging.instance;
firebaseToken = await _firebaseMessaging.getToken();
String? firebaseAPNSToken = await _firebaseMessaging.getAPNSToken();
print("Firebase Token: $firebaseToken");
print("Firebase APNS Token: $firebaseAPNSToken");
AppNotifications().init(firebaseToken);
checkLoginInfo();
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
@ -132,17 +135,21 @@ class _LoginScreenState extends State<LoginScreen> {
}
void checkLoginInfo() async {
loginInfo = await LoginApiClient().getMobileLoginInfoNEW(AppState().getIsHuawei ? AppState().getHuaweiPushToken : firebaseToken ?? "", Platform.isAndroid ? "android" : "ios");
if (loginInfo == null) {
await checkPrefs();
_autoLogin = false;
Utils.hideLoading(context);
return;
} else {
loginInfo!.deviceToken = firebaseToken;
await checkPrefs();
try {
loginInfo = await LoginApiClient().getMobileLoginInfoNEW(AppState().getIsHuawei ? AppState().getHuaweiPushToken : firebaseToken ?? "", Platform.isAndroid ? "android" : "ios");
if (loginInfo == null) {
await checkPrefs();
_autoLogin = false;
Utils.hideLoading(context);
return;
} else {
loginInfo!.deviceToken = firebaseToken;
await checkPrefs();
Utils.hideLoading(context);
performLogin();
}
} catch (ex) {
Utils.hideLoading(context);
performLogin();
}
}

@ -179,37 +179,6 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
),
),
if (tabIndex == 0) _screenParams!.getPRInformationList!.pRHeader![0].dESCRIPTION!.toText14().paddingOnly(top: 20, right: 21, left: 21),
// if (tabIndex == 0)
// ListView.separated(
// padding: const EdgeInsets.all(21),
// shrinkWrap: true,
// physics: const NeverScrollableScrollPhysics(),
// itemBuilder: (cxt, index) => Column(
// children: [
// ItemDetailGrid(
// ItemDetailViewCol("Cost Center", _screenParams!.getPRInformationList!.pRLines![index].cOSTCENTER ?? ""),
// ItemDetailViewCol("Code", _screenParams!.getPRInformationList!.pRLines![index].iTEMCODE ?? ""),
// ),
// ItemDetailGrid(
// ItemDetailViewCol("Unit", _screenParams!.getPRInformationList!.pRLines![index].uOM ?? ""),
// ItemDetailViewCol("Price (SAR)", _screenParams!.getPRInformationList!.pRLines![index].uNITPRICE.toString() ?? ""),
// ),
// ItemDetailGrid(
// ItemDetailViewCol("Amount (SAR)", _screenParams!.getPRInformationList!.pRLines![index].lINEAMOUNT.toString() ?? ""),
// ItemDetailViewCol("Quantity", _screenParams!.getPRInformationList!.pRLines![index].qUANTITY.toString() ?? ""),
// ),
// ItemDetailGrid(
// ItemDetailViewCol("AMU (Last 3 months)", _screenParams!.getPRInformationList!.pRLines![index].iTEMAMU.toString() ?? ""),
// ItemDetailViewCol("PR Number", _screenParams!.getPRInformationList!.pRHeader![0].pRNUMBER!.toString() ?? ""),
// isItLast: true,
// ),
// ],
// ).objectContainerView(),
// separatorBuilder: (cxt, index) => 12.height,
// itemCount: _screenParams!.getPRInformationList!.pRLines!.length),
// if (tabIndex == 1) getPRActionsHistory(), //"ACTIONS".toText14().paddingOnly(top: 20, right: 21, left: 21),
// if (tabIndex == 2) getPRAttachments(),
SizedBox(
height: MediaQuery.of(context).size.height,
child: PageView(
@ -226,7 +195,6 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
});
},
children: [
// if (tabIndex == 0)
ListView.separated(
padding: const EdgeInsets.all(21),
shrinkWrap: true,
@ -254,9 +222,7 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
).objectContainerView(),
separatorBuilder: (cxt, index) => 12.height,
itemCount: _screenParams!.getPRInformationList!.pRLines!.length),
// if (tabIndex == 1)
getPRActionsHistory(), //"ACTIONS".toText14().paddingOnly(top: 20, right: 21, left: 21),
// if (tabIndex == 2)
getPRAttachments(),
],
),

Loading…
Cancel
Save