Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Linting warnings on Flutter User Management Starter Tutorial #24877

Closed
PLyn opened this issue May 5, 2024 · 1 comment
Closed

Fix Linting warnings on Flutter User Management Starter Tutorial #24877

PLyn opened this issue May 5, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation pr-opened A PR has been opened to resolve the issue

Comments

@PLyn
Copy link
Contributor

PLyn commented May 5, 2024

Improve documentation

Link

https://supabase.com/docs/guides/getting-started/tutorials/with-flutter

Describe the problem

The placeholder main.dart is incomplete and might be a little misleading before finishing the tutorial.

There are a couple lint warnings when going through the tutorial which are not an issue to compile and run but seeing those warnings might confuse and mislead people going through it.

Lint warning 1 - Invalid use of a private type in a public API. Try making the private type public, or making the API that uses the private type also be private.

Lint warning 2 - Don't use 'BuildContext's across async gaps. Try rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check.

Describe the improvement

For the main.dart, Add a stub for MyApp Class and add the imports just to fill out the placeholder class to now throw any errors while going through the tutorial.

For warning 1, this change was made for all the pages with similar initializations:

_SplashPageState createState() => _SplashPageState();

Change to

State<SplashPage> createState() => _SplashPageState();

For warning 2, adding a if (mounted) {} check on the exception handling

Additional context

This shouldn't change the tutorial fundamentally in anyway. Just wanted to remove the linting warnings and fill out the the initial main function to not throw any erorrs while going through the tutorial.

@PLyn PLyn added the documentation Improvements or additions to documentation label May 5, 2024
@PLyn PLyn self-assigned this May 5, 2024
@encima encima added the pr-opened A PR has been opened to resolve the issue label May 7, 2024
@Hallidayo
Copy link
Contributor

HI @PLyn, I'm going to close this one due to the pull request being merged. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation pr-opened A PR has been opened to resolve the issue
Projects
None yet
Development

No branches or pull requests

3 participants