Skip to content

Snackbar enhancement#158

Open
pr4nshul wants to merge 2 commits intodevclub-iitd:masterfrom
pr4nshul:snackbar-enhancement
Open

Snackbar enhancement#158
pr4nshul wants to merge 2 commits intodevclub-iitd:masterfrom
pr4nshul:snackbar-enhancement

Conversation

@pr4nshul
Copy link
Copy Markdown

I set the hard wrap to 900, and I have compared the code there are only additions no deletions. Hence, I guess now the code is formatted as per the guidelines.

Copy link
Copy Markdown
Member

@Deepanshu-Rohilla Deepanshu-Rohilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine now.

Copy link
Copy Markdown
Member

@tmibvishal tmibvishal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print(e.toString()) is okay if you just want to debug the code. But when adding scaffold, you should add a custom string about what error means. Or if you want to keep things simple, you can do something like this.

String errStr = error.message == null ? error.toString() : error.message;

Then show errStr in snackbar

Scaffold.of(context).showSnackBar(SnackBar(
backgroundColor: Theme.of(context).primaryColor,
content: Text(
e.toString(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use e.message here or custom string according to error. e.toString() gives were a complicated string of error object hard to understand for a normal user.

@@ -121,6 +128,15 @@ class _VerificationCheckState extends State<VerificationCheck> {
setState(() {
error = e.toString();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show e.message as message or custom string according to error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants