Skip to content

Commit

Permalink
fix(home): eliminate jumping scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-the-shark committed Aug 3, 2024
1 parent c0f2d9a commit cfbd40c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/features/home_view/widgets/news_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ class _NewsList extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final state = ref.watch(newsRepositoryProvider);

return switch (state) {
AsyncLoading() => const Padding(
padding: EdgeInsets.only(
left: HomeViewConfig.paddingMedium,
top: HomeViewConfig.paddingMedium,
top: HomeViewConfig.paddingMedium *
2, // twice the padding of normal state, just to look cool
),
child: SizedBox(
height:
BigPreviewCardConfig.cardHeight - HomeViewConfig.paddingMedium,
child: BigScrollableSectionLoading(),
),
child: BigScrollableSectionLoading(),
),
AsyncError(:final error) => MyErrorWidget(error),
AsyncValue(:final value) => Column(
Expand Down

0 comments on commit cfbd40c

Please sign in to comment.