Skip to content

Commit

Permalink
fix: Marvel example doesn't handle DioError in the UI (#3265)
Browse files Browse the repository at this point in the history
fixes #167
  • Loading branch information
msarkrish authored Jan 26, 2024
1 parent 49ec188 commit 94cf01e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion examples/marvel/lib/src/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ class Home extends HookConsumerWidget {
return Scaffold(
appBar: AppBar(title: const Text('Error')),
body: Center(
child: Text('$err'),
child: Text(
switch (err) {
DioException() => err.message ?? '$err',
Object() => '$err',
},
),
),
);
},
Expand Down
2 changes: 1 addition & 1 deletion examples/marvel/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter project.
publish_to: "none"

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=1.17.0"

dependencies:
Expand Down

0 comments on commit 94cf01e

Please sign in to comment.