Updates & fixes

merge-requests/50/head
haroon amjad 3 years ago
parent b834c52b5f
commit 26ddc00048

@ -481,6 +481,16 @@ class WorkListApiClient {
}, url, postParams);
}
Future<List<GetFavoriteReplacements>?> getFavoriteReplacementWithImageNew(String selectedFavLetter) async {
String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacements_Images";
Map<String, dynamic> postParams = {"ItgFilter": selectedFavLetter};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.mohemmGetFavoriteReplacementsList;
}, url, postParams);
}
Future<GenericResponseModel> changeFavoriteReplacements({required String email, required String employeName, required String image, required String userName, bool isFav = false}) async {
String url = "${ApiConsts.erpRest}Mohemm_ChangeFavoriteReplacements";
Map<String, dynamic> postParamsObj = {

@ -91,6 +91,15 @@ class _DelegateSheetState extends State<DelegateSheet> {
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);
favUsersList = await WorkListApiClient().getFavoriteReplacementWithImageNew(selectedFavLetter ?? "");
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
return null;
}
@ -195,7 +204,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
).onPress(() {
showMyBottomSheet(
context,
callBackFunc: (){},
callBackFunc: () {},
child: SearchOptionsSheet(
selectedType,
onSelection: (String value) {
@ -478,12 +487,24 @@ class _DelegateSheetState extends State<DelegateSheet> {
},
child: Row(
children: [
CircularAvatar(
url: actionHistory.employeeImage,
height: 30,
width: 30,
isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : false,
),
actionHistory.employeeImage != ""
? CircularAvatar(
url: actionHistory.employeeImage,
height: 40,
width: 40,
isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : 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(),

@ -133,26 +133,33 @@ class SelectedItemSheet extends StatelessWidget {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Color(0xffF7F7F7),
color: const Color(0xffF7F7F7),
border: Border.all(
color: Color(0xffefefef),
color: const Color(0xffefefef),
width: 1,
),
),
padding: EdgeInsets.only(top: 16, bottom: 16, left: 21, right: 21),
padding: const EdgeInsets.only(top: 16, bottom: 16, left: 21, right: 21),
child: Row(
children: [
(actionHistoryList != null && actionHistoryList!.eMPLOYEEIMAGE != null)
(isFav != null && isFav)
? CircularAvatar(
height: 30,
width: 30,
url: actionHistoryList!.eMPLOYEEIMAGE,
height: 40,
width: 40,
url: favoriteReplacements != null ? favoriteReplacements!.employeeImage : actionHistoryList!.eMPLOYEEIMAGE,
isImageBase64: true,
)
: CircularAvatar(
height: 30,
width: 30,
),
: (actionHistoryList != null && actionHistoryList!.eMPLOYEEIMAGE != null)
? CircularAvatar(
height: 40,
width: 40,
url: actionHistoryList!.eMPLOYEEIMAGE,
isImageBase64: true,
)
: CircularAvatar(
height: 40,
width: 40,
),
16.width,
Expanded(
child: (name ?? "").toText12(),

@ -520,6 +520,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
}
void performAction(String actionMode, {String? title}) {
print(actionMode);
showDialog(
context: context,
builder: (cxt) => AcceptRejectInputDialog(

@ -91,7 +91,7 @@ class AcceptRejectInputDialog extends StatelessWidget {
(actionMode == "REJECTED" || actionMode == "REJECT") ? LocaleKeys.reject.tr() : LocaleKeys.ok.tr(),
() {
if (note.isEmpty) {
if (actionMode == "APPROVED" || actionMode == "APPROVE") {
if (actionMode != "REJECTED" || actionMode != "REJECT") {
Navigator.pop(context);
onTap(note);
} else {

Loading…
Cancel
Save