merge-requests/91/head
Aamir Muhammad 3 years ago
parent 0f7afa911a
commit 616e35f2d3

@ -34,13 +34,6 @@ class _ChatHomeScreenState extends State<ChatHomeScreen> {
final RefreshController _rc = RefreshController(initialRefresh: false); final RefreshController _rc = RefreshController(initialRefresh: false);
void getMoreChat() async {
data.getUserRecentChats();
await Future.delayed(
const Duration(milliseconds: 1000),
);
_rc.loadComplete();
}
@override @override
void initState() { void initState() {
@ -95,18 +88,7 @@ class _ChatHomeScreenState extends State<ChatHomeScreen> {
), ),
).paddingOnly(top: 20, bottom: 14), ).paddingOnly(top: 20, bottom: 14),
if (m.searchedChats != null) if (m.searchedChats != null)
SmartRefresher( ListView.separated(
enablePullDown: true,
enablePullUp: false,
onRefresh: (){
getMoreChat();
},
header: const MaterialClassicHeader(
color: MyColors.gradiantEndColor,
),
controller: _rc,
reverse: false,
child: ListView.separated(
itemCount: m.searchedChats!.length, itemCount: m.searchedChats!.length,
shrinkWrap: true, shrinkWrap: true,
physics: const ClampingScrollPhysics(), physics: const ClampingScrollPhysics(),
@ -223,7 +205,6 @@ class _ChatHomeScreenState extends State<ChatHomeScreen> {
}); });
}, },
separatorBuilder: (BuildContext context, int index) => const Divider(color: MyColors.lightGreyE5Color).paddingOnly(left: 59), separatorBuilder: (BuildContext context, int index) => const Divider(color: MyColors.lightGreyE5Color).paddingOnly(left: 59),
),
).expanded, ).expanded,
], ],
).paddingOnly(left: 21, right: 21); ).paddingOnly(left: 21, right: 21);

Loading…
Cancel
Save