diff --git a/example/example_01/.gitignore b/example/example_01/.gitignore index 0fa6b67..29a3a50 100644 --- a/example/example_01/.gitignore +++ b/example/example_01/.gitignore @@ -8,6 +8,7 @@ .buildlog/ .history .svn/ +migrate_working_dir/ # IntelliJ related *.iml @@ -26,14 +27,10 @@ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies -.packages .pub-cache/ .pub/ /build/ -# Web related -lib/generated_plugin_registrant.dart - # Symbolication related app.*.symbols diff --git a/example/example_01/.metadata b/example/example_01/.metadata index ec98142..bbba528 100644 --- a/example/example_01/.metadata +++ b/example/example_01/.metadata @@ -4,7 +4,42 @@ # This file should be version controlled and should not be manually edited. version: - revision: d79295af24c3ed621c33713ecda14ad196fd9c31 - channel: stable + revision: "7f20e5d18ce4cb80c621533090a7c5113f5bdc52" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + - platform: android + create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + - platform: ios + create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + - platform: linux + create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + - platform: macos + create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + - platform: web + create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + - platform: windows + create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/example/example_01/README.md b/example/example_01/README.md index aabe258..22d1916 100644 --- a/example/example_01/README.md +++ b/example/example_01/README.md @@ -8,9 +8,9 @@ This project is a starting point for a Flutter application. A few resources to get you started if this is your first Flutter project: -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, samples, guidance on mobile development, and a full API reference. diff --git a/example/example_01/analysis_options.yaml b/example/example_01/analysis_options.yaml index 8212f8d..0d29021 100644 --- a/example/example_01/analysis_options.yaml +++ b/example/example_01/analysis_options.yaml @@ -1,24 +1,28 @@ -include: package:pedantic/analysis_options.yaml +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml -analyzer: - exclude: - - build/** - - "**/*.g.dart" - strong-mode: - implicit-casts: false - errors: - missing_required_param: error - parameter_assignments: error - avoid_relative_lib_imports: error linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. rules: - - always_declare_return_types - - camel_case_types - - empty_constructor_bodies - - annotate_overrides - - avoid_init_to_null - - constant_identifier_names - - one_member_abstracts - - slash_for_doc_comments - - sort_constructors_first - - unnecessary_brace_in_string_interps + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/example/example_01/android/.gitignore b/example/example_01/android/.gitignore index 0a741cb..6f56801 100644 --- a/example/example_01/android/.gitignore +++ b/example/example_01/android/.gitignore @@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app key.properties +**/*.keystore +**/*.jks diff --git a/example/example_01/android/app/build.gradle b/example/example_01/android/app/build.gradle index 25fcabe..785bd7a 100644 --- a/example/example_01/android/app/build.gradle +++ b/example/example_01/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,12 +22,19 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion 30 + namespace "com.example.example_01" + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -35,8 +43,10 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.example_01" - minSdkVersion 16 - targetSdkVersion 30 + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -54,6 +64,4 @@ flutter { source '../..' } -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} +dependencies {} diff --git a/example/example_01/android/app/src/debug/AndroidManifest.xml b/example/example_01/android/app/src/debug/AndroidManifest.xml index d0fa86f..399f698 100644 --- a/example/example_01/android/app/src/debug/AndroidManifest.xml +++ b/example/example_01/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/example/example_01/android/app/src/main/AndroidManifest.xml b/example/example_01/android/app/src/main/AndroidManifest.xml index eed1e9f..4fd5b1f 100644 --- a/example/example_01/android/app/src/main/AndroidManifest.xml +++ b/example/example_01/android/app/src/main/AndroidManifest.xml @@ -1,10 +1,11 @@ - - + - - diff --git a/example/example_01/android/app/src/main/res/values-night/styles.xml b/example/example_01/android/app/src/main/res/values-night/styles.xml index 449a9f9..06952be 100644 --- a/example/example_01/android/app/src/main/res/values-night/styles.xml +++ b/example/example_01/android/app/src/main/res/values-night/styles.xml @@ -3,14 +3,14 @@