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

Automatically add import when converting to ConsumerWidget or ConsumerStatefulWidget #3777

Open
minhqdao opened this issue Oct 13, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request linter
Milestone

Comments

@minhqdao
Copy link

I wish import 'package:flutter_riverpod/flutter_riverpod.dart'; would be automatically added to my Dart file when I'm converting a StatelessWidget or StatefulWidget to a ConsumerWidget or ConsumerStatefulWidget and the package import isn't already present.

Currently it's a two-step procedure: 1) Convert a StatelessWidget or a StatefulWidget to a ConsumerWidget or ConsumerStatefulWidget, followed by 2) Add the import statement. The conversion works even without the import statement. I think the process could be more seamless by automating the second step that everyone has to do anyways.

I'm using VSCode on macOS.

@rrousselGit
Copy link
Owner

Good idea.

@rrousselGit
Copy link
Owner

We should do the same for pretty much all quick-fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request linter
Projects
None yet
Development

No branches or pull requests

2 participants