Flutter Notes (Dec 2019)


% Flutter can be used to build 'Android apps', 'iOS apps', 'Linux apps' (published on "Snap Store"), 'macOS Desktop apps'. Tip 1: "Book Club" release in Dec 2019 uses the following permission: Files changed: android/app/src/debug/AndroidManifest.xml [uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" /] Tip 2: Changing versionName and versionCode :: "versionName is before the + and versionCode is after the +" In your "pubspec.yaml" change the version like this: version: 1.0.2+2 Tip 3: Setting version number and version code for Flutter app: file location: android/app/build.gradle def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '3' } flutterVersionCode = '4' def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '3.0' } flutterVersionName = '4.0' Tip 4: Hot reload vs. hot restart Hot reload works by injecting updated source code files into the running Dart VM (Virtual Machine). This includes not only adding new classes, but also adding methods and fields to existing classes, and changing existing functions. A few types of code changes cannot be hot reloaded though: % Global variable initializers % Static field initializers % The main() method of the app For these changes you can fully restart your application, without having to end your debugging session. To perform a hot restart, don’t click the Stop button, simply re-click the Run button (if in a run session) or Debug button (if in a debug session), or shift-click the ‘hot reload’ button. Ref: https://flutter.dev/docs/development/tools/android-studio#hot-reload-vs-hot-restart Tip 5: High-level benefits of 'Flutter' plugin and 'Dart' plugin in Android Studio: Flutter is supported by two plugins: % The Flutter plugin powers Flutter developer workflows (running, debugging, hot reload, etc.). % The Dart plugin offers code analysis (code validation as you type, code completions, etc.).

No comments:

Post a Comment