canonical / canonical/ubuntu-flutter-plugins

Provide better errors

Open
#286 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
66
Forks
16
Avg merge
19m
Merged PRs (30d)
1

Description

A missing route should throw a FlutterError with a clear description instead of a vague null check operator error:

![Screenshot from 2022-02-02 06-51-18](https://user-images.githubusercontent.com/140617/152100458-9c1a9b5b-9d4a-47ab-a99c-3d7ae15f2dd6.png)

Steps to reproduce:
While testing #656, I changed the initial route but forgot to restore the route itself:
```diff
diff --git a/packages/ubuntu_desktop_installer/lib/routes.dart b/packages/ubuntu_desktop_installer/lib/routes.dart
index fcab20a0..7c0a33fc 100644
--- a/packages/ubuntu_desktop_installer/lib/routes.dart
+++ b/packages/ubuntu_desktop_installer/lib/routes.dart
@@ -1,5 +1,5 @@
abstract class Routes {
- static const initial = welcome;
+ static const initial = chooseYourLook;
static const welcome = '/welcome';
static const tryOrInstall = '/tryorinstall';
static const turnOffRST = '/turnoffrst';
```
Imported from https://github.com/canonical/ubuntu-flutter-plugins/issues/29

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.