Compare commits

..

1 Commits

Author SHA1 Message Date
aamir-csol 9bcff4f737 added safe area 3 months ago

@ -6,8 +6,6 @@ import 'package:flutter/foundation.dart';
import 'package:http/http.dart';
import 'package:http/io_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/config/routes.dart';
import 'package:mohem_flutter_app/exceptions/api_exception.dart';
import 'package:mohem_flutter_app/main.dart';
// ignore_for_file: avoid_annotating_with_dynamic
@ -15,7 +13,7 @@ import 'package:mohem_flutter_app/main.dart';
typedef FactoryConstructor<U> = U Function(dynamic);
class APIError {
dynamic errorCode;
int? errorCode;
int? errorType;
String? errorMessage;
int? errorStatusCode;
@ -104,10 +102,7 @@ class ApiClient {
if (jsonData["ErrorMessage"] == null) {
return factoryConstructor(jsonData);
} else if (jsonData["MessageStatus"] == 2 && jsonData["IsOTPMaxLimitExceed"] == true) {
await Utils.performLogout(AppRoutes.navigatorKey.currentContext, null);
throw const APIException(APIException.UNAUTHORIZED, error: null);
} else {
} else {
APIError? apiError;
apiError = APIError(jsonData['ErrorCode'], jsonData['ErrorEndUserMessage'], jsonData['ErrorType'] ?? 0, jsonData['ErrorStatusCode']);
throw APIException(APIException.BAD_REQUEST, error: apiError);

@ -216,24 +216,9 @@ class WorkListApiClient {
);
}
// Future<MemberInformationListModel> getUserInformation(int pSelectedResopID, String selectedEmployeeNumber) async {
// String url = "${ApiConsts.erpRest}Get_UserInformation";
// Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": pSelectedResopID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1};
// postParams.addAll(AppState().postParamsJson);
// if (selectedEmployeeNumber != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = selectedEmployeeNumber;
// return await ApiClient().postJsonForObject(
// (json) {
// GenericResponseModel responseData = GenericResponseModel.fromJson(json);
// return responseData.memberInformationList![0];
// },
// url,
// postParams,
// );
// }
Future<MemberInformationListModel> getNotificationUserInformation(int pSelectedResopID, String selectedEmployeeNumber, int pNotificationID) async {
String url = "${ApiConsts.erpRest}Get_Notification_UserInformation";
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": pSelectedResopID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1, "P_NOTIFICATION_ID": pNotificationID};
Future<MemberInformationListModel> getUserInformation(int pSelectedResopID, String selectedEmployeeNumber) async {
String url = "${ApiConsts.erpRest}Get_UserInformation";
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": pSelectedResopID, "P_PAGE_LIMIT": 100, "P_PAGE_NUM": 1};
postParams.addAll(AppState().postParamsJson);
if (selectedEmployeeNumber != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = selectedEmployeeNumber;
return await ApiClient().postJsonForObject(

@ -90,7 +90,7 @@ class AppState {
String get getHuaweiPushToken => _huaweiPushToken;
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 9.3, mobileType: Platform.isAndroid ? "android" : "ios");
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 9.2, mobileType: Platform.isAndroid ? "android" : "ios");
void setPostParamsInitConfig() {
isAuthenticated = false;

@ -6,16 +6,16 @@ class ApiConsts {
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.201.204.101:2024";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server
// static String baseUrl = "https://mohemm.hmg.com"; // New Live server
static String baseUrl = "https://mohemm.hmg.com"; // New Live server
//
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.20.200.111:1010/";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://mohemm.hmg.com";
// static String baseUrl = "https://mohemm.hmg.com";
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server
@ -68,6 +68,8 @@ class ApiConsts {
static String marathonGetMarathonersCount = marathonBaseUrl + "Participant/GetRemainingParticipants";
static String marathonGetTutorial = marathonBaseUrl + "tutorial/GetTutorialNotification";
//DummyCards for the UI
static int tabletMinLength = 500;

@ -16,7 +16,6 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
import 'package:mohem_flutter_app/widgets/loading_dialog.dart';
import 'package:nfc_manager/nfc_manager.dart';
@ -387,16 +386,4 @@ class Utils {
return false;
}
}
static Future<void> performLogout(BuildContext? context, ChatProviderModel? chatData) async {
AppState().isAuthenticated = false;
AppState().isLogged = false;
AppState().setPostParamsInitConfig();
if (chatData != null) {
chatData.disposeData();
}
// SharedPreferences prefs = await SharedPreferences.getInstance();
// await prefs.clear();
Navigator.pushNamedAndRemoveUntil(context!, AppRoutes.login, (Route<dynamic> route) => false, arguments: null);
}
}

@ -56,8 +56,6 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
int currentIndex = 0;
bool isDisplayMazaya = false;
@override
void initState() {
WidgetsBinding.instance.addObserver(this);
@ -151,11 +149,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
data.fetchAttendanceTracking(context);
data.fetchWorkListCounter(context);
data.fetchMissingSwipe(context);
data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries();
data.fetchEventActivity();
data.getCategoryOffersListAPI(context);
// data.getCategoryOffersListAPI(context);
marathonProvider.getMarathonDetailsFromApi();
marathonProvider.getMarathonTutorial();
if (isFromInit) {
@ -163,12 +160,6 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
}
if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon();
_refreshController.refreshCompleted();
await data.fetchTicketBooking();
// if (data.ticketBookingResponse != null && !data.ticketBookingResponse!.success) {
// // data.fetchTicketBalance();
// }
//continue here
}
int ermIndex = 0;
@ -314,103 +305,103 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
child: Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer()
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
gradient: const LinearGradient(
transform: GradientRotation(.46),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
),
),
child: Stack(
alignment: Alignment.center,
children: [
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
? GetAttendanceTrackingShimmer()
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
gradient: const LinearGradient(
transform: GradientRotation(.46),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
),
),
child: Stack(
alignment: Alignment.center,
children: [
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
9.height,
Directionality(
textDirection: ui.TextDirection.ltr,
child: CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20)),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
),
),
],
),
],
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
children: [
9.height,
Directionality(
textDirection: ui.TextDirection.ltr,
child: CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14(
color: Colors.white,
isBold: true,
),
4.height,
],
).paddingOnly(left: 12, right: 12),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20)),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
Container(
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: const Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15),
bottomLeft: AppState().isArabic(context) ? const Radius.circular(15) : const Radius.circular(0),
),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"),
).onPress(() {
showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true));
}),
],
),
],
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14(
color: Colors.white,
isBold: true,
),
4.height,
],
).paddingOnly(left: 12, right: 12),
],
),
Container(
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: const Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15),
bottomLeft: AppState().isArabic(context) ? const Radius.circular(15) : const Radius.circular(0),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"),
).onPress(() {
showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true));
}),
],
),
],
),
],
),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
}))
).onPress(() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
}))
.animatedSwither();
},
),
@ -423,238 +414,116 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
eventActivityWidget(context),
if (isDisplayMazaya) ...[
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Directionality(
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
),
child: Padding(
padding: const EdgeInsets.all(3.0), // This creates the border width
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(17), // Slightly less than outer radius
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 2,
child: RichText(
text:
AppState().isArabic(context)
? TextSpan(
children: [
TextSpan(
text: 'اطلع على مميزات',
style: TextStyle(
fontSize: 16,
letterSpacing: -0.2,
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
fontWeight: FontWeight.w700,
height: 24 / 16,
color: Color(0xFF5D5E5E),
),
),
TextSpan(
text: ' مزايا',
style: TextStyle(
fontSize: 16,
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
fontWeight: FontWeight.w700,
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
),
],
)
: TextSpan(
children: [
TextSpan(
text: LocaleKeys.explore.tr() + ' ',
style: const TextStyle(
fontSize: 16,
letterSpacing: -0.2,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 24 / 16,
color: Color(0xFF5D5E5E),
),
),
TextSpan(
text: LocaleKeys.mazaya.tr(),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
),
TextSpan(
text: ' ' + LocaleKeys.benefits.tr(),
style: const TextStyle(
fontSize: 16,
letterSpacing: -0.2,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
height: 24 / 16,
color: Color(0xFF5D5E5E),
),
),
],
),
),
),
const Expanded(flex: 1, child: SizedBox()),
],
),
const SizedBox(height: 8),
LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)),
],
),
),
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47),
const SizedBox(height: 28),
LocaleKeys.viewallofferMazaya.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
}),
],
),
),
],
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
),
),
).paddingOnly(left: 21, right: 21, top: 0, bottom: 21),
),
],
),
],
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.offers.tr().toText12(),
Row(
children: [
LocaleKeys.discounts.tr().toText24(isBold: true),
6.width,
Container(
padding: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: MyColors.yellowColor,
borderRadius: BorderRadius.circular(10),
),
child: LocaleKeys.newString.tr().toText10(isBold: true)),
],
),
],
),
Directionality(
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
),
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
})
],
).paddingOnly(left: 21, right: 21),
Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return SizedBox(
height: 103 + 33,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext cxt, int index) {
return model.isOffersLoading
? const OffersShimmerWidget()
: InkWell(
onTap: () {
navigateToDetails(data.getOffersList[index]);
},
child: SizedBox(
width: 73,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 73,
height: 73,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.all(
Radius.circular(100),
),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
),
child: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(50),
),
child: Hero(
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
transitionOnUserGestures: true,
child: Image.network(
data.getOffersList[index].logo ?? "",
fit: BoxFit.contain,
),
child: Padding(
padding: const EdgeInsets.all(3.0), // This creates the border width
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(17), // Slightly less than outer radius
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 2,
child: RichText(
text:
AppState().isArabic(context)
? TextSpan(
children: [
TextSpan(
text: 'اطلع على مميزات',
style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins', fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
TextSpan(
text: ' مزايا',
style: TextStyle(
fontSize: 16,
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
fontWeight: FontWeight.w700,
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
),
],
)
: TextSpan(
children: [
TextSpan(
text: LocaleKeys.explore.tr() + ' ',
style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: 'Poppins', fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
TextSpan(
text: LocaleKeys.mazaya.tr(),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
),
TextSpan(
text: ' ' + LocaleKeys.benefits.tr(),
style: const TextStyle(fontSize: 16, letterSpacing: -0.2,
fontFamily: 'Poppins',fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
],
),
),
),
),
4.height,
Expanded(
child: AppState().isArabic(context)
? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
: data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1),
),
],
),
const Expanded(flex: 1, child: SizedBox()),
],
),
const SizedBox(height: 8),
LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)),
],
),
);
},
separatorBuilder: (BuildContext cxt, int index) => 8.width,
itemCount: 9),
);
},
),
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47),
const SizedBox(height: 28),
LocaleKeys.viewallofferMazaya.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
}),
],
),
),
],
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
),
),
).paddingOnly(left: 21, right: 21, top: 0, bottom: 21),
),
],
),
Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 31),
@ -726,10 +595,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
height: Platform.isAndroid ? 70 : 100,
child: BottomNavigationBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
label: LocaleKeys.home.tr(),
),
BottomNavigationBarItem(icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.home.tr()),
BottomNavigationBarItem(
icon: SvgPicture.asset("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
label: LocaleKeys.mowadhafhiRequest.tr(),
@ -771,28 +637,28 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
SvgPicture.asset(
"assets/icons/chat/chat.svg",
color:
!checkIfPrivilegedForChat()
? MyColors.lightGreyE3Color
: currentIndex == 4
? MyColors.grey3AColor
: cProvider.disbaleChatForThisUser
? MyColors.lightGreyE3Color
: MyColors.grey98Color,
!checkIfPrivilegedForChat()
? MyColors.lightGreyE3Color
: currentIndex == 4
? MyColors.grey3AColor
: cProvider.disbaleChatForThisUser
? MyColors.lightGreyE3Color
: MyColors.grey98Color,
).paddingAll(4),
Consumer<ChatProviderModel>(
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
return !checkIfPrivilegedForChat()
? const SizedBox()
: Positioned(
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
),
);
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
),
);
},
),
],
@ -863,4 +729,4 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
}
return false;
}
}
}

@ -120,7 +120,7 @@ class _AppDrawerState extends State<AppDrawer> {
menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())),
if (AppState().businessCardPrivilege)
menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog(), isBusniessCard: true)),
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: (){Utils.performLogout(context, chatData);}),
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: performLogout),
// menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,);
],
).expanded,
@ -171,13 +171,13 @@ class _AppDrawerState extends State<AppDrawer> {
setState(() {});
}
// void performLogout() async {
// // AppState().isAuthenticated = false;
// // AppState().isLogged = false;
// // AppState().setPostParamsInitConfig();
// // chatData.disposeData();
// // // SharedPreferences prefs = await SharedPreferences.getInstance();
// // // await prefs.clear();
// // Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: null);
// }
void performLogout() async {
AppState().isAuthenticated = false;
AppState().isLogged = false;
AppState().setPostParamsInitConfig();
chatData.disposeData();
// SharedPreferences prefs = await SharedPreferences.getInstance();
// await prefs.clear();
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: null);
}
}

@ -254,22 +254,22 @@ class ServicesWidget extends StatelessWidget {
}
} else {
if (menuEntry.menuName == "HMG_TICKET_REQUESTS") {
// Utils.showLoading(context);
// TicketBookingResult response = await pro.fetchTicketBooking();
// Utils.hideLoading(context);
// if (response.success) {
// SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: response.clientId);
// if (ssoToken != null) {
// logger.d(ssoToken.data!.toJson());
// logger.d(ssoToken.data!.accessToken);
// dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!);
// Navigator.push(context, MaterialPageRoute(builder: (context) => SsoLoginWebView(url: url ?? "", jwtToken: ssoToken.data!.accessToken!)));
// }
// } else {
Utils.showLoading(context);
TicketBookingResult response = await pro.fetchTicketBooking();
Utils.hideLoading(context);
if (response.success) {
SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: response.clientId);
if (ssoToken != null) {
logger.d(ssoToken.data!.toJson());
logger.d(ssoToken.data!.accessToken);
dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!);
Navigator.push(context, MaterialPageRoute(builder: (context) => SsoLoginWebView(url: url ?? "", jwtToken: ssoToken.data!.accessToken!)));
}
} else {
List<GetMenuEntriesList> _menuList =
pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? [];
Navigator.pushNamed(context, AppRoutes.servicesMenuListScreen, arguments: ServicesMenuListScreenParams(menuEntry.prompt!, _menuList.isEmpty ? menuList : _menuList));
// }
}
} else {
List<GetMenuEntriesList> _menuList =
pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? [];

@ -39,7 +39,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true, showLogo: false, logoPath: "assets/icons/mazaya_brand.svg"),
appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true, showLogo: true, logoPath: "assets/icons/mazaya_brand.svg"),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -1,5 +1,4 @@
import 'dart:collection';
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
@ -33,16 +32,8 @@ class DelegateSheet extends StatefulWidget {
VoidCallback callBackFunc;
List<NotificationGetRespondAttributesList> getNotificationRespondAttributes;
DelegateSheet({
super.key,
required this.title,
required this.apiMode,
this.notificationID,
this.actionHistoryList,
this.wFHistory,
required this.callBackFunc,
this.getNotificationRespondAttributes = const <NotificationGetRespondAttributesList>[],
});
DelegateSheet(
{required this.title, required this.apiMode, this.notificationID, this.actionHistoryList, this.wFHistory, required this.callBackFunc, this.getNotificationRespondAttributes = const []});
@override
State<DelegateSheet> createState() => _DelegateSheetState();
@ -55,8 +46,8 @@ class _DelegateSheetState extends State<DelegateSheet> {
String? selectedFavLetter;
String selectedType = "Workflow";
String inputRes = "";
List<String>? favLetters;
List<GetFavoriteReplacements>? favUsersList;
List<GetFavoriteReplacements>? filteredFavUsersList = <GetFavoriteReplacements>[];
List<ReplacementList>? replacementList;
bool isImageLoaded = false;
@ -66,14 +57,14 @@ class _DelegateSheetState extends State<DelegateSheet> {
super.initState();
if (widget.wFHistory != null) {
widget.wFHistory = widget.wFHistory!.reversed.toList();
Set<String?> ids = widget.wFHistory!.map((WFHistory e) => e.employeeID).toSet();
widget.wFHistory!.retainWhere((WFHistory x) => ids.remove(x.employeeID));
var ids = widget.wFHistory!.map((e) => e.employeeID).toSet();
widget.wFHistory!.retainWhere((x) => ids.remove(x.employeeID));
}
if (widget.actionHistoryList != null) {
widget.actionHistoryList = widget.actionHistoryList!.reversed.toList();
Set<String?> ids = widget.actionHistoryList!.map((GetActionHistoryList e) => e.uSERNAME).toSet();
widget.actionHistoryList!.retainWhere((GetActionHistoryList x) => ids.remove(x.uSERNAME));
var ids = widget.actionHistoryList!.map((e) => e.uSERNAME).toSet();
widget.actionHistoryList!.retainWhere((x) => ids.remove(x.uSERNAME));
}
}
@ -82,96 +73,36 @@ class _DelegateSheetState extends State<DelegateSheet> {
super.dispose();
}
Future<void> fetchFavUsers({bool isNeedLoading = true}) async {
favUsersList = <GetFavoriteReplacements>[];
filteredFavUsersList = <GetFavoriteReplacements>[];
Future fetchFavLetters({bool isNeedLoading = true}) async {
favLetters = [];
if (isNeedLoading) Utils.showLoading(context);
try {
List<GetFavoriteReplacements>? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage();
favUsersList = favList;
if (favUsersList != null && favUsersList!.isNotEmpty) {
favUsersList!.sort((GetFavoriteReplacements a, GetFavoriteReplacements b) => (a.employeeDisplayName ?? '').toLowerCase().compareTo((b.employeeDisplayName ?? '').toLowerCase()));
filteredFavUsersList = favUsersList;
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
_fetchAndAttachUserImages();
} else {
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
}
} catch (e) {
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
}
List<GetFavoriteReplacements>? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage();
List<String> result = [];
favList!.forEach((element) {
result.add(element.employeeDisplayName![0]);
});
favLetters = LinkedHashSet<String>.from(result).toList();
if (isNeedLoading) Utils.hideLoading(context);
setState(() {
favLetters!.sort((a, b) {
return a.toLowerCase().compareTo(b.toLowerCase());
});
});
return null;
}
Future<void> _fetchAndAttachUserImages() async {
try {
List<GetFavoriteReplacements>? tempList = await WorkListApiClient().getFavoriteReplacementWithImageNew("");
if (tempList != null && tempList.isNotEmpty && favUsersList != null) {
for (GetFavoriteReplacements element in favUsersList!) {
for (GetFavoriteReplacements element2 in tempList) {
if (element.userName == element2.userName && element2.employeeImage != null && element2.employeeImage!.isNotEmpty) {
element.employeeImage = element2.employeeImage;
}
}
}
filteredFavUsersList = favUsersList;
setState(() {});
}
} catch (e) {}
Future fetchFavUsersList({bool isNeedLoading = true}) async {
if (isNeedLoading) Utils.showLoading(context);
favUsersList = await WorkListApiClient().getFavoriteReplacementWithImage(selectedFavLetter ?? "");
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
fetchFavUsersListNew(isNeedLoading: false);
return null;
}
// Future<void> fetchFavUsers({bool isNeedLoading = true}) async {
// favUsersList = <GetFavoriteReplacements>[];
// if (isNeedLoading) Utils.showLoading(context);
//
// try {
// List<GetFavoriteReplacements>? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage();
// favUsersList = favList;
//
// if (favUsersList != null && favUsersList!.isNotEmpty) {
// setState(() {
// favUsersList!.sort((GetFavoriteReplacements a, GetFavoriteReplacements b) => (a.employeeDisplayName ?? '').toLowerCase().compareTo((b.employeeDisplayName ?? '').toLowerCase()));
// });
// if (isNeedLoading) Utils.hideLoading(context);
//
// List<GetFavoriteReplacements>? tempList = await WorkListApiClient().getFavoriteReplacementWithImageNew("");
// if (tempList != null && tempList.isNotEmpty) {
// for (GetFavoriteReplacements element in favUsersList!) {
// for (GetFavoriteReplacements element2 in tempList) {
// if (element.userName == element2.userName) {
// if (element2.employeeImage != null && element2.employeeImage!.isNotEmpty) {
// element.employeeImage = element2.employeeImage;
// }
// }
// }
// }
// setState(() {});
// }
// }
// } catch (e) {
// // if (isNeedLoading) Utils.hideLoading(context);
// }
// }
// Future fetchFavUsersList({bool isNeedLoading = true}) async {
// if (isNeedLoading) Utils.showLoading(context);
// favUsersList = await WorkListApiClient().getFavoriteReplacementWithImage(selectedFavLetter ?? "");
// if (isNeedLoading) Utils.hideLoading(context);
// setState(() {});
// fetchFavUsersListNew(isNeedLoading: false);
// return null;
// }
Future fetchFavUsersListNew({bool isNeedLoading = true}) async {
if (isNeedLoading) Utils.showLoading(context);
filteredFavUsersList = await WorkListApiClient().getFavoriteReplacementWithImageNew(selectedFavLetter ?? "");
favUsersList = await WorkListApiClient().getFavoriteReplacementWithImageNew(selectedFavLetter ?? "");
if (isNeedLoading) Utils.hideLoading(context);
setState(() {
isImageLoaded = true;
@ -181,10 +112,18 @@ class _DelegateSheetState extends State<DelegateSheet> {
void fetchChangeFav({required String email, required String employeName, required String image, required String userName, bool isFav = false, bool isNeedToRefresh = false}) async {
Utils.showLoading(context);
GenericResponseModel model = await WorkListApiClient().changeFavoriteReplacements(email: email, employeName: employeName, image: image, userName: userName, isFav: isFav);
favLetters = null;
selectedFavLetter = null;
GenericResponseModel model = await WorkListApiClient().changeFavoriteReplacements(
email: email,
employeName: employeName,
image: image,
userName: userName,
isFav: isFav,
);
if (isNeedToRefresh) {
await fetchFavUsers(isNeedLoading: false);
// if (favUsersList != null) await fetchFavUsersList(isNeedLoading: false);
await fetchFavLetters(isNeedLoading: false);
if (favLetters != null) await fetchFavUsersList(isNeedLoading: false);
}
Utils.hideLoading(context);
@ -198,58 +137,44 @@ class _DelegateSheetState extends State<DelegateSheet> {
userName: selectedType == "Employee Name" ? inputRes : "",
email: selectedType == "Employee Email" ? inputRes : "",
);
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
return null;
}
Future<void> searchFavUser() async {
if (favUsersList != null && favUsersList!.isNotEmpty) {
// if (inputRes.length > 0) {
filteredFavUsersList =
favUsersList!.where((GetFavoriteReplacements element) {
String query = inputRes.toLowerCase();
return (element.employeeDisplayName != null && element.employeeDisplayName!.toLowerCase().startsWith(query)) ||
(element.userName != null && element.userName!.toLowerCase().contains(query)) ||
(element.emailAddress != null && element.emailAddress!.toLowerCase().contains(query));
}).toList();
// } else {
// filteredFavUsersList = favUsersList;
// }
} else {
filteredFavUsersList = <GetFavoriteReplacements>[];
}
setState(() {});
}
@override
Widget build(BuildContext context) {
return SizedBox(
return Container(
width: double.infinity,
height: MediaQuery.of(context).size.height - 80,
child: Column(
children: <Widget>[
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
widget.title.toText24(isBold: true),
21.height,
LocaleKeys.search.tr().toText16(),
11.height,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
children: [
Container(
padding: const EdgeInsets.only(left: 8, right: 4, top: 6, bottom: 6),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.transparent, border: Border.all(color: const Color(0xffefefef), width: 1)),
padding: EdgeInsets.only(left: 8, right: 4, top: 6, bottom: 6),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.transparent,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: Row(
children: <Widget>[
children: [
Expanded(
child: InputWidget(
"Search By " + selectedType,
@ -260,18 +185,29 @@ class _DelegateSheetState extends State<DelegateSheet> {
verticalPadding: 3,
isInputTypeNum: selectedType == "Employee ID" ? true : false,
isEnable: isNeedEnableTextField,
onChange: (String v) {
onChange: (v) {
inputRes = v;
if (selectedType == "Favorites") {
searchFavUser();
}
},
),
),
Container(height: 36, width: 1, color: const Color(0xffE5E5E5)),
Container(
padding: const EdgeInsets.all(8),
child: Row(children: <Widget>[selectedType.toText12(), 4.width, const Icon(Icons.keyboard_arrow_down, color: Colors.black, size: 16)]),
height: 36,
width: 1,
color: Color(0xffE5E5E5),
),
Container(
padding: EdgeInsets.all(8),
child: Row(
children: [
selectedType.toText12(),
4.width,
const Icon(
Icons.keyboard_arrow_down,
color: Colors.black,
size: 16,
),
],
),
).onPress(() {
showMyBottomSheet(
context,
@ -283,17 +219,19 @@ class _DelegateSheetState extends State<DelegateSheet> {
if (value == "Workflow") {
setState(() {
isNeedEnableTextField = false;
// selectedFavLetter = null;
filteredFavUsersList = null;
selectedFavLetter = null;
favLetters = null;
favUsersList = null;
});
} else if (value == "Favorites") {
isNeedEnableTextField = true;
fetchFavUsers();
isNeedEnableTextField = false;
fetchFavLetters();
} else {
setState(() {
isNeedEnableTextField = true;
// selectedFavLetter = null;
filteredFavUsersList = null;
selectedFavLetter = null;
favLetters = null;
favUsersList = null;
});
}
},
@ -303,105 +241,143 @@ class _DelegateSheetState extends State<DelegateSheet> {
],
),
),
if (isNeedEnableTextField && selectedType != "Favorites")
if (isNeedEnableTextField)
TextButton(
onPressed: () {
fetchUserByInput();
},
child: const Text("Search", style: TextStyle(color: Colors.blue, decoration: TextDecoration.underline)),
),
child: const Text(
"Search",
style: TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline,
),
),
)
],
),
if (!isNeedEnableTextField) 12.height,
Row(
children: <Widget>[
children: [
Expanded(
child: SizedBox(
child: Container(
width: double.infinity,
child:
// selectedFavLetter == null && favLetters != null
// ? Container(width: double.infinity, alignment: Alignment.center, child: "Please select letter to see Fav results".toText12())
// :
filteredFavUsersList != null && selectedType == "Favorites"
child: selectedFavLetter == null && favLetters != null
? Container(
width: double.infinity,
alignment: Alignment.center,
child: "Please select letter to see Fav results".toText12(),
)
: favUsersList != null
? ListView.separated(
itemBuilder: (BuildContext context, int index) {
return showFavUserItem(filteredFavUsersList![index]);
},
separatorBuilder: (BuildContext context, int index) {
return Container(color: MyColors.borderColor, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8)).onPress(() {});
},
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: filteredFavUsersList!.length,
padding: const EdgeInsets.only(top: 8, bottom: 8),
)
itemBuilder: (context, index) {
return showFavUserItem(favUsersList![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderColor,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
).onPress(() {});
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: favUsersList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)
: isNeedEnableTextField && replacementList == null
? Container(width: double.infinity, alignment: Alignment.center, child: "Search User".toText12())
: isNeedEnableTextField && replacementList!.isEmpty
? Container(width: double.infinity, alignment: Alignment.center, child: "No Data Found".toText12())
: isNeedEnableTextField
? ListView.separated(
itemBuilder: (BuildContext context, int index) {
return showInputUserItem(replacementList![index]);
},
separatorBuilder: (BuildContext context, int index) {
return Container(color: MyColors.borderE3Color, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8));
},
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: replacementList!.length,
padding: const EdgeInsets.only(top: 8, bottom: 8),
)
: (widget.wFHistory != null
? ListView.separated(
itemBuilder: (BuildContext context, int index) {
return showItgItem(widget.wFHistory![index]);
},
separatorBuilder: (BuildContext context, int index) {
return Container(color: MyColors.borderE3Color, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8));
},
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.wFHistory!.length,
padding: const EdgeInsets.only(top: 8, bottom: 8),
)
: ListView.separated(
itemBuilder: (BuildContext context, int index) {
return showItem(widget.actionHistoryList![index]);
},
separatorBuilder: (BuildContext context, int index) {
return Container(color: MyColors.borderE3Color, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8));
},
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.actionHistoryList!.length,
padding: const EdgeInsets.only(top: 8, bottom: 8),
)),
? Container(
width: double.infinity,
alignment: Alignment.center,
child: "Search User".toText12(),
)
: isNeedEnableTextField && replacementList!.length == 0
? Container(
width: double.infinity,
alignment: Alignment.center,
child: "No Data Found".toText12(),
)
: isNeedEnableTextField
? ListView.separated(
itemBuilder: (context, index) {
return showInputUserItem(replacementList![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderE3Color,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: replacementList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)
: (widget.wFHistory != null
? ListView.separated(
itemBuilder: (context, index) {
return showItgItem(widget.wFHistory![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderE3Color,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.wFHistory!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)
: ListView.separated(
itemBuilder: (context, index) {
return showItem(widget.actionHistoryList![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderE3Color,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.actionHistoryList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)),
),
),
// if (favLetters != null)
// SizedBox(
// width: 30,
// // color: Colors.red,
// child: ListView.separated(
// itemBuilder: (BuildContext context, int index) {
// return Container(
// padding: const EdgeInsets.all(8),
// alignment: Alignment.center,
// child: favLetters![index].toText14(color: selectedFavLetter == favLetters![index] ? MyColors.gradiantStartColor : Colors.black),
// ).onPress(() {
// selectedFavLetter = favLetters![index].toUpperCase();
// fetchFavUsersList();
// });
// },
// separatorBuilder: (BuildContext context, int index) {
// return const SizedBox(height: 0);
// },
// physics: const NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemCount: favLetters!.length,
// ),
// ),
if (favLetters != null)
Container(
width: 30,
// color: Colors.red,
child: ListView.separated(
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(8),
alignment: Alignment.center,
child: favLetters![index].toText14(color: selectedFavLetter == favLetters![index] ? MyColors.gradiantStartColor : Colors.black),
).onPress(() {
selectedFavLetter = favLetters![index].toUpperCase();
fetchFavUsersList();
});
},
separatorBuilder: (context, index) {
return SizedBox(
height: 0,
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: favLetters!.length,
),
),
],
),
],
@ -409,15 +385,22 @@ class _DelegateSheetState extends State<DelegateSheet> {
),
),
),
Container(width: double.infinity, height: 1, color: MyColors.borderColor),
Container(
width: double.infinity,
height: 1,
color: MyColors.borderColor,
),
DefaultButton(
"Cancel",
() {
Navigator.pop(context);
},
textColor: Colors.black,
colors: const <Color>[Color(0xffE6E6E6), Color(0xffE6E6E6)],
).insideContainer,
colors: [
Color(0xffE6E6E6),
Color(0xffE6E6E6),
],
).insideContainer
],
),
);
@ -427,22 +410,25 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
Navigator.pop(context);
showMyBottomSheet(
context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
actionHistoryList: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
),
);
showMyBottomSheet(context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
actionHistoryList: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
));
},
child: Row(
children: <Widget>[
CircularAvatar(url: actionHistory.eMPLOYEEIMAGE ?? "", height: 30, width: 30, isImageBase64: true),
children: [
CircularAvatar(
url: actionHistory.eMPLOYEEIMAGE ?? "",
height: 30,
width: 30,
isImageBase64: true,
),
9.width,
(actionHistory.nAME ?? "").toText12().expanded,
IconButton(
@ -458,8 +444,12 @@ class _DelegateSheetState extends State<DelegateSheet> {
isFav: true,
);
},
icon: Icon(Icons.star, size: 16, color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor),
),
icon: Icon(
Icons.star,
size: 16,
color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor,
),
)
],
),
);
@ -469,18 +459,25 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
Navigator.pop(context);
showMyBottomSheet(
context,
callBackFunc: widget.callBackFunc,
child: SelectedItgItemSheet(
"Comment",
apiMode: widget.apiMode,
wfHistory: wfHistory,
// notificationID: widget.notificationID,
),
);
showMyBottomSheet(context,
callBackFunc: widget.callBackFunc,
child: SelectedItgItemSheet(
"Comment",
apiMode: widget.apiMode,
wfHistory: wfHistory,
// notificationID: widget.notificationID,
));
},
child: Row(children: <Widget>[CircularAvatar(height: 30, width: 30), 9.width, (wfHistory.name ?? "").toText12().expanded]),
child: Row(
children: [
CircularAvatar(
height: 30,
width: 30,
),
9.width,
(wfHistory.name ?? "").toText12().expanded,
],
),
);
}
@ -488,31 +485,47 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
Navigator.pop(context);
showMyBottomSheet(
context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
favoriteReplacements: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
),
);
showMyBottomSheet(context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
favoriteReplacements: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
));
},
child: Row(
children: <Widget>[
actionHistory.employeeImage != "" && actionHistory.employeeImage != null
? CircularAvatar(url: actionHistory.employeeImage, height: 40, width: 40, isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : false)
children: [
actionHistory.employeeImage != ""
? CircularAvatar(
url: actionHistory.employeeImage,
height: 40,
width: 40,
isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : false,
)
: isImageLoaded
? CircularAvatar(height: 40, width: 40, isImageBase64: false)
: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(50)),
child: Image.network("https://play-lh.googleusercontent.com/NPo88ojmhah4HDiposucJmfQIop4z4xc8kqJK9ITO9o-yCab2zxIp7PPB_XPj2iUojo", fit: BoxFit.cover, height: 40, width: 40).toShimmer(),
),
? CircularAvatar(
height: 40,
width: 40,
isImageBase64: false,
)
: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(50),
),
child: Image.network(
"https://play-lh.googleusercontent.com/NPo88ojmhah4HDiposucJmfQIop4z4xc8kqJK9ITO9o-yCab2zxIp7PPB_XPj2iUojo",
fit: BoxFit.cover,
height: 40,
width: 40,
).toShimmer(),
),
16.width,
Expanded(child: (actionHistory.employeeDisplayName ?? "").toText12()),
Expanded(
child: (actionHistory.employeeDisplayName ?? "").toText12(),
),
IconButton(
onPressed: () {
fetchChangeFav(
@ -524,8 +537,12 @@ class _DelegateSheetState extends State<DelegateSheet> {
isNeedToRefresh: true,
);
},
icon: const Icon(Icons.star, size: 16, color: MyColors.yellowColor),
),
icon: Icon(
Icons.star,
size: 16,
color: MyColors.yellowColor,
),
)
],
),
);
@ -535,24 +552,29 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
Navigator.pop(context);
showMyBottomSheet(
context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
LocaleKeys.comments.tr(),
apiMode: widget.apiMode,
replacementList: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
),
);
showMyBottomSheet(context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
LocaleKeys.comments.tr(),
apiMode: widget.apiMode,
replacementList: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
));
},
child: Row(
children: <Widget>[
CircularAvatar(url: actionHistory.employeeImage, height: 30, width: 30, isImageBase64: actionHistory.employeeImage != null ? true : false),
children: [
CircularAvatar(
url: actionHistory.employeeImage,
height: 30,
width: 30,
isImageBase64: actionHistory.employeeImage != null ? true : false,
),
16.width,
Expanded(child: (actionHistory.employeeDisplayName ?? "").toText12()),
Expanded(
child: (actionHistory.employeeDisplayName ?? "").toText12(),
),
IconButton(
onPressed: () {
actionHistory.isFavorite = !(actionHistory.isFavorite ?? false);
@ -565,8 +587,12 @@ class _DelegateSheetState extends State<DelegateSheet> {
isNeedToRefresh: false,
);
},
icon: Icon(Icons.star, size: 16, color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor),
),
icon: Icon(
Icons.star,
size: 16,
color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor,
),
)
],
),
);

@ -175,7 +175,7 @@ class SelectedItemSheet extends StatelessWidget {
if (favoriteReplacements != null) empID = favoriteReplacements!.userName;
if (replacementList != null) empID = replacementList!.userName;
try {
memberInformationListModel = await WorkListApiClient().getNotificationUserInformation(-999, empID!, notificationID!);
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, empID!);
if (actionHistoryList != null) empID = actionHistoryList!.eMPLOYEEIMAGE = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp;
if (favoriteReplacements != null) empID = favoriteReplacements!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp;
if (replacementList != null) empID = replacementList!.employeeImage = memberInformationListModel!.eMPLOYEEIMAGE ?? AppState().getBase64ImageEmp;

@ -813,7 +813,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
memberInformationListModel = null;
memberInformationListModel = await WorkListApiClient().getNotificationUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!, workListData!.nOTIFICATIONID!);
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);

@ -35,10 +35,14 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
print("Page finished loading: $url");
},
onHttpError: (HttpResponseError error) {
print("HTTP error: ${error.toString()} for URL: ${error.response!.statusCode}");
print(
"HTTP error: ${error.toString()} for URL: ${error.response!.statusCode}",
);
},
onWebResourceError: (WebResourceError error) {
print("Web resource error: ${error.description} for URL: ${error.errorType}");
print(
"Web resource error: ${error.description} for URL: ${error.errorType}",
);
},
),
)
@ -56,6 +60,9 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
@override
Widget build(BuildContext context) {
return Scaffold(appBar: AppBar(title: Text('Logging in...')), body: WebViewWidget(controller: _controller));
return Scaffold(
appBar: AppBar(title: Text('')),
body: SafeArea(child: WebViewWidget(controller: _controller)),
);
}
}

@ -17,8 +17,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 3.6.8+300078
#version: 3.9.1+1
version: 3.6.7+300077
#version: 3.9.0+1
environment:
sdk: ^3.7.0
@ -58,7 +58,7 @@ dependencies:
platform_device_id_plus: ^1.0.7
device_info_plus: ^11.5.0
image_picker: ^1.1.2
image_picker: ^0.8.5+3
file_picker: ^8.3.1
geolocator: ^9.0.2
month_year_picker: ^0.5.0+1
@ -92,8 +92,7 @@ dependencies:
logging: ^1.0.1
swipe_to: ^1.0.2
flutter_webrtc: ^0.12.11
# camera: ^0.10.3
camera: ^0.11.2
camera: ^0.10.3
flutter_local_notifications: ^18.0.1
#firebase_analytics: any

Loading…
Cancel
Save