merge-requests/126/head
Aamir Muhammad 3 years ago
parent 3871d3f1e3
commit d096559a2f

@ -92,8 +92,7 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
}
void fetchChatUser({bool isNeedLoading = true}) async {
if (pageNo == 1)
chatUsersList = [];
if (pageNo == 1) chatUsersList!.clear();
try {
Utils.showLoading(context);
await ChatApiClient().getChatMemberFromSearch(searchText, AppState().chatDetails!.response!.id!, pageNo).then((ChatUserModel value) {
@ -130,11 +129,11 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
}
void scrollListener() async {
if (sc.position.pixels ==
sc.position.maxScrollExtent) {
if (sc.position.pixels == sc.position.maxScrollExtent) {
pageNo++;
setState(() {});
}
}
@override
void initState() {
@ -146,10 +145,7 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
height: MediaQuery
.of(context)
.size
.height - 100,
height: MediaQuery.of(context).size.height - 100,
child: Column(
children: [
Column(
@ -191,9 +187,7 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
),
if (replacementList != null)
replacementList!.isEmpty
? Utils
.getNoDataWidget(context)
.expanded
? Utils.getNoDataWidget(context).expanded
: ListView(
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.only(top: 21, bottom: 8),
@ -205,8 +199,7 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (cxt, index) => employeeItemView(favouriteUserList![index]),
separatorBuilder: (cxt, index) =>
Container(
separatorBuilder: (cxt, index) => Container(
height: 1,
color: MyColors.borderE3Color,
),
@ -220,8 +213,7 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (cxt, index) => employeeItemView(nonFavouriteUserList![index]),
separatorBuilder: (cxt, index) =>
Container(
separatorBuilder: (cxt, index) => Container(
height: 1,
color: MyColors.borderE3Color,
),
@ -238,8 +230,7 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
Utils.getNoDataWidget(context),
],
)
: ListView
.separated(
: ListView.separated(
physics: const AlwaysScrollableScrollPhysics(),
controller: sc,
shrinkWrap: true,
@ -283,20 +274,16 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
),
);
},
separatorBuilder: (BuildContext context, int index) =>
const Padding(
separatorBuilder: (BuildContext context, int index) => const Padding(
padding: EdgeInsets.only(right: 10, left: 70, bottom: 0, top: 0),
child: Divider(
color: Color(0xFFE5E5E5),
),
),
itemCount: chatUsersList?.length ?? 0,
)
.expanded,
).expanded,
],
)
.paddingOnly(left: 21, right: 21, bottom: 0, top: 21)
.expanded,
).paddingOnly(left: 21, right: 21, bottom: 0, top: 21).expanded,
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
DefaultButton(
LocaleKeys.cancel.tr(),
@ -374,4 +361,4 @@ class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
setState(() {});
}).expanded;
}
}
}

Loading…
Cancel
Save