Updates & fixes

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

@ -481,6 +481,16 @@ class WorkListApiClient {
}, url, postParams); }, 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 { 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"; String url = "${ApiConsts.erpRest}Mohemm_ChangeFavoriteReplacements";
Map<String, dynamic> postParamsObj = { Map<String, dynamic> postParamsObj = {

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

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

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

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

Loading…
Cancel
Save