|
|
|
|
@ -12,25 +12,19 @@ import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class ChatFavoriteUsersScreen extends StatelessWidget {
|
|
|
|
|
const ChatFavoriteUsersScreen({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
// TODO: implement build
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: MyColors.white,
|
|
|
|
|
body: Consumer<ChatProviderModel>(builder: (BuildContext context, ChatProviderModel m, Widget? child) {
|
|
|
|
|
return m.isLoading
|
|
|
|
|
? ChatHomeShimmer()
|
|
|
|
|
: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const AlwaysScrollableScrollPhysics(),
|
|
|
|
|
padding: const EdgeInsets.only(top: 20),
|
|
|
|
|
children: [
|
|
|
|
|
if (m.favUsersList != null && m.favUsersList.isNotEmpty)
|
|
|
|
|
ListView.separated(
|
|
|
|
|
body: Consumer<ChatProviderModel>(
|
|
|
|
|
builder: (BuildContext context, ChatProviderModel m, Widget? child) {
|
|
|
|
|
if (m.isLoading) {
|
|
|
|
|
return ChatHomeShimmer();
|
|
|
|
|
} else {
|
|
|
|
|
return m.favUsersList != null && m.favUsersList.isNotEmpty
|
|
|
|
|
? ListView.separated(
|
|
|
|
|
itemCount: m.favUsersList!.length,
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
padding: const EdgeInsets.only(top: 20),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
@ -61,7 +55,6 @@ class ChatFavoriteUsersScreen extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
title: (m.favUsersList![index].userName ?? "").toText14(color: MyColors.darkTextColor),
|
|
|
|
|
// subtitle: (m.searchedChats![index].isTyping == true ? "Typing ..." : "").toText11(color: MyColors.normalTextColor),
|
|
|
|
|
trailing: IconButton(
|
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
@ -77,26 +70,32 @@ class ChatFavoriteUsersScreen extends StatelessWidget {
|
|
|
|
|
context,
|
|
|
|
|
AppRoutes.chatDetailed,
|
|
|
|
|
arguments: {"targetUser": m.favUsersList![index]},
|
|
|
|
|
).then((value) {
|
|
|
|
|
).then(
|
|
|
|
|
(Object? value) {
|
|
|
|
|
m.clearSelections();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onLongPress: () {},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) => const Padding(
|
|
|
|
|
padding: EdgeInsets.only(right: 10, left: 70),
|
|
|
|
|
child: Divider(
|
|
|
|
|
color: Color(0xFFE5E5E5),
|
|
|
|
|
color: Color(
|
|
|
|
|
0xFFE5E5E5,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
Utils.getNoDataWidget(context).expanded
|
|
|
|
|
: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Utils.getNoDataWidget(context).expanded,
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|