feat: add shimmer header to conversations screen and update navigation transitions

This commit is contained in:
pradeepkumar
2026-03-31 06:18:33 +05:30
parent 597b97414d
commit 457ea8a082
2 changed files with 45 additions and 9 deletions

View File

@@ -51,9 +51,11 @@ class _ConversationsScreenState extends ConsumerState<ConversationsScreen> {
final state = ref.watch(messagingProvider);
final filtered = _filteredConversations(state.conversations);
final isLoading = state.isLoadingConversations && state.conversations.isEmpty;
return Column(
children: [
_buildHeader(),
isLoading ? _buildShimmerHeader() : _buildHeader(),
Expanded(child: _buildConversationList(state, filtered)),
],
);
@@ -248,6 +250,42 @@ class _ConversationsScreenState extends ConsumerState<ConversationsScreen> {
);
}
// -- Shimmer header placeholder --
Widget _buildShimmerHeader() {
return Shimmer.fromColors(
baseColor: const Color(0xFFE8E8E8),
highlightColor: const Color(0xFFF5F5F5),
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 12),
child: Row(
children: [
Container(
width: 16, height: 16,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
),
),
const SizedBox(width: 10),
Expanded(
child: Container(
height: 44,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(22),
),
),
),
const SizedBox(width: 8),
Container(width: 22, height: 22, color: Colors.white),
const SizedBox(width: 8),
Container(width: 22, height: 22, color: Colors.white),
],
),
),
);
}
// -- Shimmer Loading State --
Widget _buildShimmerLoading() {
return Shimmer.fromColors(