Merge branch 'master' into development_aamir

# Conflicts:
#	lib/ui/landing/dashboard_screen.dart
sultan-dev
Aamir Muhammad 3 years ago
commit feff454e65

@ -512,5 +512,6 @@
"youWantToLeaveMarathon": "هل أنت متأكد أنك تريد العودة؟ سوف تخرج من المسابقة.", "youWantToLeaveMarathon": "هل أنت متأكد أنك تريد العودة؟ سوف تخرج من المسابقة.",
"ourSponsor": "راعينا:", "ourSponsor": "راعينا:",
"startingIn": "يبدأ في", "startingIn": "يبدأ في",
"youAreOutOfContest": "أنت خارج المسابقة." "youAreOutOfContest": "أنت خارج المسابقة.",
"winners": "الفائزين!!!"
} }

@ -512,6 +512,7 @@
"youWantToLeaveMarathon": "Are you sure you want to go back? You will be out of the contest.", "youWantToLeaveMarathon": "Are you sure you want to go back? You will be out of the contest.",
"ourSponsor": "Our Sponsor:", "ourSponsor": "Our Sponsor:",
"startingIn": "Starting in", "startingIn": "Starting in",
"youAreOutOfContest": "You are out of the contest." "youAreOutOfContest": "You are out of the contest.",
"winners": "WINNERS!!!"
} }

@ -38,6 +38,7 @@ class AppState {
String? get getForgetPasswordTokenID => forgetPasswordTokenID; String? get getForgetPasswordTokenID => forgetPasswordTokenID;
//Wifi info //Wifi info
String? _mohemmWifiSSID; String? _mohemmWifiSSID;

@ -63,4 +63,5 @@ class MyColors {
static const Color darkDigitColor = Color(0xff2D2F39); static const Color darkDigitColor = Color(0xff2D2F39);
static const Color grey71Color = Color(0xff717171); static const Color grey71Color = Color(0xff717171);
static const Color darkGrey3BColor = Color(0xff3B3B3B); static const Color darkGrey3BColor = Color(0xff3B3B3B);
static const Color lightGreyIconColor = Color(0xff919191);
} }

@ -3,6 +3,7 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart';
class ApiConsts { class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server //static String baseUrl = "http://10.200.204.20:2801/"; // Local server
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
// static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server
static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server

@ -37,7 +37,7 @@ class Utils {
timeInSecForIosWeb: 1, timeInSecForIosWeb: 1,
backgroundColor: Colors.black54, backgroundColor: Colors.black54,
textColor: Colors.white, textColor: Colors.white,
fontSize: 16.0); fontSize: 13.0);
} }
static dynamic getNotNullValue(List<dynamic> list, int index) { static dynamic getNotNullValue(List<dynamic> list, int index) {
@ -121,8 +121,8 @@ class Utils {
), ),
); );
} else { } else {
// showToast(errorMessage); showToast(errorMessage);
confirmDialog(cxt, errorMessage); // confirmDialog(cxt, errorMessage);
} }
} }
} }

@ -499,5 +499,6 @@ abstract class LocaleKeys {
static const ourSponsor = 'ourSponsor'; static const ourSponsor = 'ourSponsor';
static const startingIn = 'startingIn'; static const startingIn = 'startingIn';
static const youAreOutOfContest = 'youAreOutOfContest'; static const youAreOutOfContest = 'youAreOutOfContest';
static const winners = 'winners';
} }

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:logger/logger.dart'; import 'package:logger/logger.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/classes/consts.dart';
@ -37,6 +38,10 @@ bool isTablet = false;
Future<void> main() async { Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
await EasyLocalization.ensureInitialized(); await EasyLocalization.ensureInitialized();
AppState().setPostParamsInitConfig(); AppState().setPostParamsInitConfig();
HttpOverrides.global = MyHttpOverrides(); HttpOverrides.global = MyHttpOverrides();

@ -1,41 +1,41 @@
class GetTimeCardSummaryList { class GetTimeCardSummaryList {
int? aBSENTDAYS; num? aBSENTDAYS;
dynamic? aCTUALHRS; dynamic? aCTUALHRS;
dynamic? aPPROVEDTIMEBACKHRS; dynamic? aPPROVEDTIMEBACKHRS;
int? aSSIGNMENTID; num? aSSIGNMENTID;
int? aTTENDEDDAYS; num? aTTENDEDDAYS;
int? bUSINESSTRIP; num? bUSINESSTRIP;
dynamic? cOMPOFFHHRS; dynamic? cOMPOFFHHRS;
dynamic? cOMPOFFNHRS; dynamic? cOMPOFFNHRS;
dynamic? cOMPOFFWHRS; dynamic? cOMPOFFWHRS;
dynamic? dESIREDSCHEDULEDHRS; dynamic? dESIREDSCHEDULEDHRS;
dynamic? eARLYOUTHRS; dynamic? eARLYOUTHRS;
dynamic? eXCESSHRS; dynamic? eXCESSHRS;
int? hALFDAYLEAVE; num? hALFDAYLEAVE;
dynamic? lATEINHRS; dynamic? lATEINHRS;
dynamic? lEAVESHOLIDAYSHRS; dynamic? lEAVESHOLIDAYSHRS;
dynamic? nONSCHEDULEDAYS; dynamic? nONSCHEDULEDAYS;
dynamic? nOTANALYZEDDAYS; dynamic? nOTANALYZEDDAYS;
int? oFFDAYS; num? oFFDAYS;
dynamic? oNCALLHRS; dynamic? oNCALLHRS;
dynamic? pAIDLEAVE; dynamic? pAIDLEAVE;
int? pERIODDAYS; num? pERIODDAYS;
dynamic? pLANNEDOTHRS; dynamic? pLANNEDOTHRS;
int? pUBLICHOLIDAY; num? pUBLICHOLIDAY;
dynamic? sCHEDULEDHRS; dynamic? sCHEDULEDHRS;
dynamic? sCHEDULEDONCALLHRS; dynamic? sCHEDULEDONCALLHRS;
dynamic? sCHEDULEDPLANNEDOTHRS; dynamic? sCHEDULEDPLANNEDOTHRS;
int? sCHEDULEDAYS; num? sCHEDULEDAYS;
dynamic? sHORTAGEHRS; dynamic? sHORTAGEHRS;
dynamic? sHORTAGESCHEDULEHRS; dynamic? sHORTAGESCHEDULEHRS;
int? sICKLEAVE; num? sICKLEAVE;
dynamic? tIMEBACKHRS; dynamic? tIMEBACKHRS;
dynamic? tIMEBACKBALANCE; dynamic? tIMEBACKBALANCE;
int? uNAUTHORIZEDLEAVE; num? uNAUTHORIZEDLEAVE;
dynamic? uNCOVERDSHORTAGEHRS; dynamic? uNCOVERDSHORTAGEHRS;
int? uNPAIDLEAVE; num? uNPAIDLEAVE;
GetTimeCardSummaryList( GetTimeCardSummaryList(
{this.aBSENTDAYS, {this.aBSENTDAYS,

@ -48,7 +48,7 @@ class MemberInformationListModel {
String? nATIONALITYCODE; String? nATIONALITYCODE;
String? nATIONALITYMEANING; String? nATIONALITYMEANING;
String? nATIONALIDENTIFIER; String? nATIONALIDENTIFIER;
String? nORMALHOURS; dynamic? nORMALHOURS;
int? nOOFROWS; int? nOOFROWS;
int? oRGANIZATIONID; int? oRGANIZATIONID;
String? oRGANIZATIONNAME; String? oRGANIZATIONNAME;

@ -96,7 +96,7 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
} }
void validateAbsenceTransaction(selectedID) async { void validateAbsenceTransaction(selectedID) async {
//try { try {
Utils.showLoading(context); Utils.showLoading(context);
Map<String, String?> dffDataMap = {}; Map<String, String?> dffDataMap = {};
for (int i = 1; i <= 20; i++) { for (int i = 1; i <= 20; i++) {
@ -145,10 +145,10 @@ class _AddLeaveBalanceScreenState extends State<AddLeaveBalanceScreen> {
} }
await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!); await LeaveBalanceApiClient().cancelHrTransaction(submit.pTRANSACTIONID!);
Utils.hideLoading(context); Utils.hideLoading(context);
// } catch (ex) { } catch (ex) {
// Utils.hideLoading(context); Utils.hideLoading(context);
// Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
// } }
} }
@override @override

@ -642,6 +642,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []); PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID; AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword; AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!); Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!);
Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!); Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!);
Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID!); Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID!);

@ -5,11 +5,13 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/marathon/marathon_api_client.dart'; import 'package:mohem_flutter_app/api/marathon/marathon_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/models/marathon/marathon_model.dart'; import 'package:mohem_flutter_app/models/marathon/marathon_model.dart';
import 'package:mohem_flutter_app/models/marathon/question_model.dart'; import 'package:mohem_flutter_app/models/marathon/question_model.dart';
import 'package:mohem_flutter_app/models/marathon/winner_model.dart'; import 'package:mohem_flutter_app/models/marathon/winner_model.dart';
import 'package:mohem_flutter_app/models/privilege_list_model.dart';
import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
@ -28,6 +30,9 @@ class MarathonProvider extends ChangeNotifier {
String? selectedOptionId; String? selectedOptionId;
int? totalQualifiers; int? totalQualifiers;
bool iAmWinner = false;
bool isPrivilegedWithMarathon = false;
bool _isLoading = false; bool _isLoading = false;
bool get isLoading => _isLoading; bool get isLoading => _isLoading;
@ -164,7 +169,7 @@ class MarathonProvider extends ChangeNotifier {
oneSec, oneSec,
(Timer timer) async { (Timer timer) async {
// This 2 is just to show the color of answer tile for 2 seconds and then update card status // This 2 is just to show the color of answer tile for 2 seconds and then update card status
if (totalCurrentQuestionTime - currentGapTime == currentQuestion.questionTime! - 2) { if (totalCurrentQuestionTime - currentGapTime == 1) {
getCorrectAnswerAndUpdateAnswerColor(); getCorrectAnswerAndUpdateAnswerColor();
} }
@ -182,7 +187,7 @@ class MarathonProvider extends ChangeNotifier {
if (totalCurrentQuestionTime == 0) { if (totalCurrentQuestionTime == 0) {
updateCardData(); updateCardData();
if (currentQuestionNumber == marathonDetailModel.totalQuestions! - 1) { if (currentQuestionNumber == marathonDetailModel.totalQuestions! ) {
callGetQualifiersApi(); callGetQualifiersApi();
updateQuestionCardStatus(QuestionCardStatus.findingWinner); updateQuestionCardStatus(QuestionCardStatus.findingWinner);
timer.cancel(); timer.cancel();
@ -235,6 +240,19 @@ class MarathonProvider extends ChangeNotifier {
Future<void> callGetSelectedWinnersApi() async { Future<void> callGetSelectedWinnersApi() async {
selectedWinners = await MarathonApiClient().getSelectedWinner(marathonId: marathonDetailModel.id!); selectedWinners = await MarathonApiClient().getSelectedWinner(marathonId: marathonDetailModel.id!);
if (selectedWinners != null) {
selectedWinners!.removeWhere((WinnerModel element) {
print("matching : ${AppState().memberInformationList!.eMPLOYEENUMBER} with ${element.employeeId}");
if (element.employeeId == AppState().memberInformationList!.eMPLOYEENUMBER) {
iAmWinner = true;
return true;
} else {
return false;
}
});
}
print("selectedWinners Length : ${selectedWinners!.length}");
notifyListeners(); notifyListeners();
} }
@ -361,20 +379,35 @@ class MarathonProvider extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
bool checkIfPrivilegedForMarathon() {
for (PrivilegeListModel element in AppState().privilegeListModel!) {
if (element.serviceName == "Marathon") {
if (element.previlege != null) {
return element.previlege!;
}
}
}
return false;
}
Future<void> getMarathonDetailsFromApi() async { Future<void> getMarathonDetailsFromApi() async {
isLoading = true; isLoading = true;
notifyListeners(); notifyListeners();
isPrivilegedWithMarathon = checkIfPrivilegedForMarathon();
if (isPrivilegedWithMarathon) {
await MarathonApiClient().getMarathonToken().whenComplete(() async { await MarathonApiClient().getMarathonToken().whenComplete(() async {
marathonDetailModel = await MarathonApiClient().getMarathonDetails(); marathonDetailModel = await MarathonApiClient().getMarathonDetails();
if (marathonDetailModel.id == null) { if (marathonDetailModel.id == null) {
isUpComingMarathon = false; isUpComingMarathon = false;
isLoading = false;
notifyListeners(); notifyListeners();
return; return;
} }
populateQuestionStatusesList(); populateQuestionStatusesList();
});
}
isLoading = false; isLoading = false;
notifyListeners(); notifyListeners();
});
} }
Future<void> onJoinMarathonPressed(BuildContext context) async { Future<void> onJoinMarathonPressed(BuildContext context) async {

@ -43,24 +43,27 @@ class MarathonScreen extends StatelessWidget {
return Image.asset(MyLottieConsts.congratsGif, height: 200); return Image.asset(MyLottieConsts.congratsGif, height: 200);
} }
// SizedBox(
// height: 200,
// child: Stack(
// fit: StackFit.expand,
// children: <Widget>[
// Lottie.asset(MyLottieConsts.celebrate1Lottie, height: 200),
// // Lottie.asset(MyLottieConsts.celebrate2Lottie, height: 200),
// ],
// ),
// ),
Widget getWinnerWidget(BuildContext context, {required MarathonProvider provider}) { Widget getWinnerWidget(BuildContext context, {required MarathonProvider provider}) {
return Container( return Container(
width: double.infinity, width: double.infinity,
decoration: MyDecorations.shadowDecoration, decoration: MyDecorations.shadowDecoration,
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20), padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 200,
child: Stack( child: Stack(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Lottie.asset(MyLottieConsts.celebrate1Lottie, height: 200),
Lottie.asset(MyLottieConsts.celebrate2Lottie, height: 200),
],
),
),
26.height,
SizedBox( SizedBox(
height: 50, height: 50,
child: Stack( child: Stack(
@ -71,19 +74,44 @@ class MarathonScreen extends StatelessWidget {
), ),
Align( Align(
alignment: Alignment.center, alignment: Alignment.center,
child: LocaleKeys.winner.tr().toText32(color: MyColors.white, isBold: true, isCentered: true).paddingOnly(top: 07), child: LocaleKeys.winners.tr().toText32(color: MyColors.white, isBold: true, isCentered: true).paddingOnly(top: 07),
) )
], ],
), ),
), ),
12.height, 16.height,
if (provider.selectedWinners != null) ...<Widget>[ !provider.iAmWinner
(AppState().isArabic(context) ? provider.selectedWinners!.first.nameEn : provider.selectedWinners!.first.nameEn)!.toText22( ? Column(
children: <Widget>[
(AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn)!.toText22(
color: MyColors.grey3AColor, color: MyColors.grey3AColor,
isCentered: true, isCentered: true,
), ),
8.height, 8.height,
provider.selectedWinners!.first.employeeId!.toText22(color: MyColors.grey57Color), AppState().memberInformationList!.eMPLOYEENUMBER!.toText22(color: MyColors.grey57Color),
],
)
: const SizedBox(),
36.height,
if (provider.selectedWinners != null) ...<Widget>[
ListView.separated(
shrinkWrap: true,
itemCount: provider.selectedWinners!.length,
separatorBuilder: (BuildContext context, int index) {
return const Divider();
},
itemBuilder: (BuildContext context, int index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(AppState().isArabic(context) ? provider.selectedWinners![index].nameEn : provider.selectedWinners![index].nameEn)!.toText16(
color: MyColors.grey3AColor,
),
provider.selectedWinners!.first.employeeId!.toText16(color: MyColors.grey57Color),
],
);
},
),
], ],
60.height, 60.height,
if (provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) ...<Widget>[ if (provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) ...<Widget>[
@ -110,6 +138,9 @@ class MarathonScreen extends StatelessWidget {
], ],
], ],
), ),
Lottie.asset(MyLottieConsts.celebrate1Lottie),
],
),
); );
} }

@ -22,10 +22,171 @@ class MarathonBanner extends StatelessWidget {
const MarathonBanner({Key? key, required this.isMarathonUpcoming}) : super(key: key); const MarathonBanner({Key? key, required this.isMarathonUpcoming}) : super(key: key);
Widget getUnPrivilegedMarathon(BuildContext context) {
return Container(
decoration: MyDecorations.shadowDecoration,
height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11,
clipBehavior: Clip.antiAlias,
child: Stack(
children: <Widget>[
Transform(
alignment: Alignment.center,
transform: Matrix4.rotationY(
AppState().isArabic(context) ? math.pi : 0,
),
child: SvgPicture.asset(
"assets/images/marathon_banner_bg.svg",
fit: BoxFit.fill,
width: double.infinity,
),
),
AppState().isArabic(context)
? Positioned(
right: -15,
top: -10,
child: Transform.rotate(
angle: 10,
child: Container(
width: isTablet ? 70 : 65,
height: isTablet ? 40 : 32,
color: MyColors.darkDigitColor,
),
),
)
: Positioned(
left: -20,
top: -10,
child: Transform.rotate(
angle: 15,
child: Container(
width: isTablet ? 70 : 65,
height: isTablet ? 40 : 32,
color: MyColors.darkDigitColor,
),
),
),
SizedBox(
width: double.infinity,
height: double.infinity,
child: Row(
children: <Widget>[
const Expanded(
flex: 3,
child: SizedBox(
width: double.infinity,
height: double.infinity,
),
),
Expanded(
flex: AppState().isArabic(context) ? 4 : 5,
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
AppState().isArabic(context) ? 0.height : 5.height,
Text(
LocaleKeys.getReadyForContest.tr(),
style: TextStyle(
fontSize: isTablet ? 20 : 11,
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w600,
color: MyColors.white.withOpacity(0.83),
letterSpacing: -0.4,
),
),
Text(
LocaleKeys.brainMarathon.tr(),
style: TextStyle(
fontStyle: FontStyle.italic,
fontSize: isTablet ? 30 : 19,
fontWeight: FontWeight.bold,
color: MyColors.white.withOpacity(0.83),
height: 32 / 22,
),
),
],
).paddingOnly(
left: AppState().isArabic(context) ? 12 : 3,
right: AppState().isArabic(context) ? 3 : 12,
)
],
),
),
),
],
),
),
AppState().isArabic(context)
? Align(
alignment: Alignment.topRight,
child: SizedBox(
height: isTablet ? 30 : 20,
width: isTablet ? 45 : 35,
child: Transform.rotate(
angle: math.pi / 4.5,
child: Text(
LocaleKeys.brainMarathon.tr(),
textAlign: TextAlign.center,
maxLines: 2,
style: TextStyle(
color: MyColors.white,
fontWeight: FontWeight.bold,
fontSize: isTablet ? 8 : 6,
height: 1.2,
),
),
),
),
).paddingOnly(top: 5)
: Align(
alignment: Alignment.topLeft,
child: SizedBox(
height: isTablet ? 30 : 20,
width: isTablet ? 45 : 35,
child: Transform.rotate(
angle: -math.pi / 4.5,
child: Text(
LocaleKeys.brainMarathon.tr(),
textAlign: TextAlign.center,
maxLines: 2,
style: TextStyle(
color: MyColors.kWhiteColor,
fontWeight: FontWeight.bold,
fontSize: isTablet ? 8 : 6,
height: 1.2,
),
),
),
),
).paddingOnly(top: 5),
Container(
height: double.infinity,
width: double.infinity,
color: Colors.black.withOpacity(0.6),
child: const Icon(
Icons.lock_rounded,
color: MyColors.lightGreyIconColor,
),
),
],
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
MarathonProvider provider = context.read<MarathonProvider>(); MarathonProvider provider = context.read<MarathonProvider>();
return provider.marathonDetailModel.startTime != null
return !provider.isPrivilegedWithMarathon
? getUnPrivilegedMarathon(context)
: provider.marathonDetailModel.startTime != null
? Container( ? Container(
decoration: MyDecorations.shadowDecoration, decoration: MyDecorations.shadowDecoration,
height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11,
@ -192,6 +353,7 @@ class MarathonBanner extends StatelessWidget {
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor), child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor),
).paddingAll(isTablet ? 20 : 15), ).paddingAll(isTablet ? 20 : 15),
), ),
], ],
).onPress(() async { ).onPress(() async {
int remainingTimeInMinutes = DateTime.parse(provider.marathonDetailModel.startTime!).difference(DateTime.now()).inMinutes; int remainingTimeInMinutes = DateTime.parse(provider.marathonDetailModel.startTime!).difference(DateTime.now()).inMinutes;
@ -204,7 +366,7 @@ class MarathonBanner extends StatelessWidget {
provider.startTimerForSponsorVideo(); provider.startTimerForSponsorVideo();
Navigator.pushNamed(context, AppRoutes.marathonSponsorVideoScreen); Navigator.pushNamed(context, AppRoutes.marathonSponsorVideoScreen);
}); });
} catch (e, s) { } catch (e) {
if (kDebugMode) { if (kDebugMode) {
print("Error in VideoPlayer: ${e.toString()}"); print("Error in VideoPlayer: ${e.toString()}");
} }

@ -160,7 +160,7 @@ class _ContactDetailsState extends State<ContactDetails> {
right: 1, right: 1,
child: const Icon(Icons.add_location_alt_outlined, size: 20).onPress(continueDynamicForms), child: const Icon(Icons.add_location_alt_outlined, size: 20).onPress(continueDynamicForms),
), ),
Utils.getNoDataWidget(context).expanded, Utils.getNoDataWidget(context),
], ],
).objectContainerView() ).objectContainerView()
], ],

@ -106,6 +106,19 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
void getData() async { void getData() async {
// try { // try {
// Utils.showLoading(context); // Utils.showLoading(context);
getEitCollectionNotificationBodyList!.clear();
getAbsenceCollectionNotificationBodyList!.clear();
getPrNotificationBody = null;
getStampMsNotifications.clear();
getStampNsNotifications.clear();
getPoNotificationBody?.pOHeader!.clear();
getItemCreationNtfBody?.itemCreationHeader!.clear();
getPhonesNotificationBodyList!.clear();
getBasicDetNtfBodyList!.clear();
getAbsenceCollectionNotificationBodyList!.clear();
getContactNotificationBodyList = null;
if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") { if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") {
getUserInformation(); getUserInformation();
} }
@ -688,7 +701,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload); GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload);
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
animationIndex=animationIndex+1; animationIndex = animationIndex + 1;
AppState().workList!.removeAt(AppState().workListIndex!); AppState().workList!.removeAt(AppState().workListIndex!);
if (AppState().workList!.isEmpty) { if (AppState().workList!.isEmpty) {
Navigator.pop(context, "delegate_reload"); Navigator.pop(context, "delegate_reload");
@ -725,6 +738,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getEitCollectionNotificationBodyList!.clear();
getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID); getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -742,6 +756,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
memberInformationListModel = null;
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!); memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -759,6 +774,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getPhonesNotificationBodyList!.clear();
getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID); getPhonesNotificationBodyList = await WorkListApiClient().getPhonesNotificationBodyList(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -776,6 +792,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getBasicDetNtfBodyList!.clear();
getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID); getBasicDetNtfBodyList = await WorkListApiClient().getBasicDetNtfBodyList(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -793,6 +810,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getAbsenceCollectionNotificationBodyList!.clear();
getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID); getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID);
apiCallCount--; apiCallCount--;
if (apiCallCount == 0) { if (apiCallCount == 0) {
@ -916,6 +934,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
getNotificationRespondAttributes.clear();
getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!); getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!);
if (getNotificationRespondAttributes.isNotEmpty) { if (getNotificationRespondAttributes.isNotEmpty) {
notificationNoteInput = getNotificationRespondAttributes.first; notificationNoteInput = getNotificationRespondAttributes.first;
@ -936,6 +955,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try { try {
if (apiCallCount == 0) Utils.showLoading(context); if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++; apiCallCount++;
notificationButtonsList.clear();
notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!); notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!);
if (notificationButtonsList.isNotEmpty) { if (notificationButtonsList.isNotEmpty) {
isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE"); isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE");

Loading…
Cancel
Save