riverpod icon indicating copy to clipboard operation
riverpod copied to clipboard

Android Studio don't shows option to convert StatelessWidget into ConsumerWidget

Open tananga opened this issue 1 year ago • 10 comments

https://raw.githubusercontent.com/rrousselGit/riverpod/master/packages/riverpod_lint/resources/convert_to_consumer_widget.gif Im using Android Studio Ladybug | 2024.2.1

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.24.1, on macOS 14.5 23F79 darwin-arm64, locale en-PL) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.2) [✓] IntelliJ IDEA Community Edition (version 2024.2.3) [✓] VS Code (version 1.94.0) [✓] Connected device (6 available) [✓] Network resources

• No issues found!

Before I was able to convert Flutter widgets into Riverpod widgets but now I cant. If anyone know how to fix this issue please put a comment below.

tananga avatar Oct 08 '24 17:10 tananga

Could you make a git project to reproduce the issue?

rrousselGit avatar Oct 08 '24 17:10 rrousselGit

@rrousselGit Please take a look on this video https://youtu.be/bLttZ6tOYLQ?si=UMP034zifqkXl946

tananga avatar Oct 08 '24 19:10 tananga

@rrousselGit There is an option to create ConsumerWidget from snippet. There is just no option to create Consumer widget from StatlessWidget. Very little problem and I dont think that its worth your time. Let me know If I can close this issue

Screenshot 2024-10-08 at 21 58 25

tananga avatar Oct 08 '24 19:10 tananga

I don't want a video. I want a github repository. I can't run a video :)

rrousselGit avatar Oct 08 '24 22:10 rrousselGit

I always manually do this, but this is a great idea and would be very useful for those new to riverpod.

mark8044 avatar Oct 22 '24 14:10 mark8044

I have created a plugin to complete this operation, search flutterx image

Kapture 2024-10-23 at 10 32 44

mdddj avatar Oct 23 '24 02:10 mdddj

  • @rrousselGit this is a public repo, if you may check.
  • I have the issue with android studio that assits not shown.

my device info:

  1. Android Studio (version 2024.2)
  2. Flutter version 3.24.3
  3. Dart version 3.5.3
  4. DevTools version 2.37.3

MohammadNezarAldalati avatar Oct 23 '24 13:10 MohammadNezarAldalati

I have created a plugin to complete this operation, search flutterx image

Kapture 2024-10-23 at 10 32 44 Kapture 2024-10-23 at 10 32 44

How to activate that? I've installed the plugin, but I don't see any options to convert StatelessWidget to ConsumerWidget. Riverpod class tool is activated in Android Studio settings. I use the last stable version of Android Studio and FlutterX plugin

mtrfnvwork avatar Oct 28 '24 16:10 mtrfnvwork

The development process has become much slower without the ability to convert widgets

mtrfnvwork avatar Oct 28 '24 16:10 mtrfnvwork

How to activate that? I've installed the plugin, but I don't see any options to convert StatelessWidget to ConsumerWidget. Riverpod class tool is activated in Android Studio settings. I use the last stable version of Android Studio and FlutterX plugin

Try again after adding hooks_riverpod: ^2.6.1 to your pubspec.yaml. You may need to restart your Android Studio.

mdddj avatar Oct 28 '24 16:10 mdddj