Skip to content

Commit

Permalink
Improve Loading and Error Screens
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobkoerber committed Oct 31, 2024
1 parent 18e2b9c commit f9b63d3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
20 changes: 11 additions & 9 deletions lib/campusComponent/view/movie/movies_widget_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,20 @@ class _MoviesHomeWidgetState extends ConsumerState<MovieWidgetView> {
withinScrollView: true,
);
} else if (snapshot.hasError) {
return SizedBox(
height: MediaQuery.of(context).size.height * 0.34,
child: ErrorHandlingRouter(
error: snapshot.error!,
errorHandlingViewType: ErrorHandlingViewType.textOnly,
retry: (() => ref.read(movieViewModel).fetch(true)),
return AspectRatio(
aspectRatio: 2,
child: Card(
child: ErrorHandlingRouter(
error: Error(),
errorHandlingViewType: ErrorHandlingViewType.textOnly,
retry: (() => ref.read(movieViewModel).fetch(true)),
),
),
);
} else {
return Card(
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.34,
return AspectRatio(
aspectRatio: 2,
child: Card(
child: DelayedLoadingIndicator(name: context.tr("movies")),
),
);
Expand Down
20 changes: 13 additions & 7 deletions lib/campusComponent/view/studentClub/student_club_widget_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,22 @@ class _StudentClubWidgetViewState extends ConsumerState<StudentClubWidgetView> {
withinScrollView: true,
);
} else if (snapshot.hasError) {
return Card(
child: ErrorHandlingRouter(
error: Error(),
errorHandlingViewType: ErrorHandlingViewType.textOnly,
return AspectRatio(
aspectRatio: 2,
child: Card(
child: ErrorHandlingRouter(
error: Error(),
errorHandlingViewType: ErrorHandlingViewType.textOnly,
),
),
);
} else {
return const Card(
child: DelayedLoadingIndicator(
name: "Student Clubs",
return const AspectRatio(
aspectRatio: 2,
child: Card(
child: DelayedLoadingIndicator(
name: "Student Clubs",
),
),
);
}
Expand Down

0 comments on commit f9b63d3

Please sign in to comment.