/cookbook-flutter

my cookbook for flutter and dart

Primary LanguageDart

flutter

  • flutter is open source
  • it compiles to truly native apps
  • Fuchsia's user interface and apps are written with Flutter
  • Everything Is Widgets
  • they’re the building blocks of every Flutter app
  • google mission is: To build a better way to develop for mobile
    • better create then android/kotlin, ios/swift, html/js
  • only Flutter (not React Native / Xamarin) has an option to create a web application in addition to the iOS and Android apps

flutter: linux

  • get SDK: git clone https://github.com/flutter/flutter.git flutter
  • add flutter binary to path
  • run flutter will download dart SDK: flutter/bin/cache/dart-sdk/
  • run flutter doctor and follow the instructions (install android studio, android sdk, ...)
    • hint for android studio desktop entry: configure > create desktop entry
    • if you want to use android studio for flutter developer then install plugin: flutter and dart
    • also add android sdk to path: android/sdk/platform-tools
  • run flutter devices to list your device
  • run app with flutter run - ensure device or emulator is running.

android emulator

  • check if acceleration is on:
$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
  • list / run emulators
flutter emulators
flutter emulators --launch Pixel_2_API_29

troubleshooting

  • i had the curious case that my device was list with adb devices also with flutter devices but not in android studio. Issue was solved when i set env variable ANDROID_HOME=.../android/sdk

visual studio code

  • visual studio code with flutter extension: create hello world flutter with: CTRL + SHIFT + P > flutter

links

screenshot with adb

adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png .

flutter: windows

  • get flutter SDK
  • set flutter SDK to environment variable PATH: <...>\flutter\bin
  • set android SDK / toolchain to environment variable PATH: <...>\android\sdk\platform-tools