Conversation
wal33d006
left a comment
There was a problem hiding this comment.
Looks good to me, can we make it support CosmosTheme? Currently the background color and text colors are all fixed.
| brightness: themeStore.isDarkTheme ? Brightness.dark : Brightness.light, | ||
| child: Builder( | ||
| builder: (context) { | ||
| setErrorBuilder(context); |
There was a problem hiding this comment.
not really sure why we're setting a variable as part of the build method, and why this variable is static? Looks like flutter team at google was a bit drunk when implemented this O.o. :D Wouldn't it make more sense to have specialized widget that is responsible of building the Error UI ? I think ErrorWidget is more meant for general build errors and altering it's builder field you're updating the way all build errors are being displayed across the whole app.
There was a problem hiding this comment.
https://docs.flutter.dev/testing/errors, yes they were drunk, I figured it would be great if we had our own custom error screen app-wide, gets rid of the red screen of death and allows us to still copy error messages with one click of a button
| return result.fold( | ||
| (fail) { | ||
| logError(fail); | ||
| errorDetails = fail.toString(); |
There was a problem hiding this comment.
we're loosing a lot of info here by calling toString(), couldn't we simply make errorDetails a, lets say ErrorDetails type that consists of the dynamic error and optional StackTrace? stackTrace.
There was a problem hiding this comment.
Will update this to use ErrorDetails
There was a problem hiding this comment.
created CosmosErrorDetails
I have created a default error screen using flutter's inbuilt error widget and i have also passed the error from account creation to it.
Global Error UI: