Flutter Run No Supported Devices Connected

Posted on  by

Flutter supports a number of Material Design animated icons that are built-in and can be used with minimal effort. The AnimatedIcon class works almost like the Icon class but requires an AnimationController.

I’m going to show you how to animate an icon using a button and reset the same animation to its beginning state using another button. Just keep in mind that you can, of course, trigger the animation any other way you want. This will be our end result:

Select the Chrome device from the pull down and launch it from your IDE or, from the command line, use flutter run -d chrome, Get the web socket info for DevTools. At the command line, or in the IDE, you should see a message stating something like the following. So, if I run flutter doctor here, it will now do that analysis, and it sees that Flutter was installed, but it sees that Android tools are missing that Android Studio is missing, and that we got no connected device on which we could test our Flutter app. No connected devices found; please connect a device, or see flutter.io/setup for getting started instructions. When I run flutter devices, the device is listed as connected: PS C:usersvsysm03 flutter devices 1 connected device: Android SDK built for x86. emulator-5554. android-x86. Android 9 (API 28) (emulator) PS C:usersvsysm03. The command flutter run -release compiles to release mode. Your IDE supports this mode. Android Studio, for example, provides a Run Run menu option, as well as a triangular green run button icon on the project page. You can compile to release mode for a specific target with flutter build. 久しぶりにflutterで個人開発を進めようとして、シミュレータ上でアプリを動かそうとしたらNo supported devices connected. が発生。 今まではとりあえずiPhoneシミュレータ立ち上げていれば勝手に認識して、シミュレータ上でアプリ起動していたが、うんともすんとも。 コンソールでflutter docterを実行.

First of all we need a Stateful widget that uses SingleTickerProviderStateMixin and create an instance of AnimationController:

And we should override initState with the following code:

And we dispose of our animation like so:

Wherever we want to have our animated icon (one of these), we just call this:

There are a lot of possibilities with AnimationController, but today I just want to keep it simple and stick to the possible uses within the AnimatedIcon context. To start our animation we can call:

After calling forward the animation stops in its last state. If we would want to run the animation from the end to beginning again, we can call:

No Supported Devices Connected

Or we can just reset it to the beginning state:

Flutter Run No Supported Devices Connected Devices

So, after all the steps this is the code that we have:

There are a lot more custom and advanced uses of animation of Flutter, but if you just want to do a common animation that is already part of Material Design, then AnimatedIcon is a great widget to use.

Available

Flutter Run No Supported Devices Connected

In my future posts, I will show more things that we can do with animation in Flutter.