diff --git a/add_to_app/README.md b/add_to_app/README.md index 17ec43384..ade7f1250 100644 --- a/add_to_app/README.md +++ b/add_to_app/README.md @@ -1,51 +1,33 @@ # Add-to-App Samples -This directory contains a bunch of Android and iOS projects (beginning -`android_` and `ios_`, respectively) that import and use one of several Flutter -modules (which have names beginning with `flutter_`). They're designed to show -recommended approaches for adding Flutter to existing Android and iOS apps. +This directory contains Android and iOS projects that import and use a Flutter +module. They're designed to show recommended approaches for adding Flutter to +existing Android and iOS apps. + +## Samples Listing + +* [`fullscreen`](./fullscreen) — Embeds a full screen instance of + Flutter into an existing iOS or Android app. +* [`prebuild_module`](./prebuilt_module) — Embeds a full screen + instance of Flutter as a prebuilt library that can be loaded into an existing + iOS or Android app. +* [`plugin`](./plugin) — Embeds a full screen Flutter instance that + is using plugins into an existing iOS or Android app. +* [`books`](./books) — Mimics a real world use-case of embedding Flutter into an + existing Android app and demonstrates using + [Pigeon](https://pub.dev/packages/pigeon) to communicate between Fluter and + the host application. ## Goals for these samples * Show developers how to add Flutter to their existing applications. * Show the following options: - - Whether to build the Flutter module from source each time the app builds or + * Whether to build the Flutter module from source each time the app builds or rely on a separately pre-built module. - - Whether plugins are needed by the Flutter module used in the app. + * Whether plugins are needed by the Flutter module used in the app. * Show Flutter being integrated ergonomically with applications with existing middleware and business logic data classes. -## tl;dr - -If you're just looking to get up and running quickly, these bash commands will -fetch packages and set up dependencies (note that the above commands assume -you're building for both iOS and Android, with both toolchains installed): - -```bash - #!/bin/bash - set -e - - cd flutter_module_using_plugin - flutter pub get - cd ../flutter_module_books - flutter pub get - cd ../flutter_module - flutter pub get - - # For Android builds: - flutter build aar - - # For iOS builds: - flutter build ios-framework --xcframework --output=../ios_using_prebuilt_module/Flutter - cd ../ios_fullscreen - pod install - cd ../ios_using_plugin - pod install -``` - -Once those commands have run, you can go into any of the app directories (the -ones beginning `android_` or `ios_`), and build the apps as you normally would. - ## Installing Cocoapods The iOS samples in this repo require the latest version of Cocoapods. To make @@ -57,191 +39,6 @@ sudo gem install cocoapods See https://guides.cocoapods.org/using/getting-started.html for more details. -## The important bits - -### Flutter modules - -There are three Flutter modules included in the codebase: - -* `flutter_module` displays the dimensions of the screen, a button that - increments a simple counter, and an optional exit button. -* `flutter_module_using_plugin` contains 2 programs. The main entrypoint does - everything `flutter_module` does and adds another button that will open the - Flutter documentation in a browser using the [`url_launcher`](https://pub.dev/packages/url_launcher) - Flutter plugin. A second `showCell` entrypoint displays a card meant to be - shown as a cell in a list. -* `flutter_module_books` simulates an integration scenario with existing - platform business logic and middleware. It uses the [`pigeon`](https://pub.dev/packages/pigeon) - plugin to make integration easier by generating the platform channel - interop inside wrapper API and data classes that are shared between the - platform and Flutter. - -Before using them, you need to resolve the Flutter modules' dependencies. Do so -by running this command from within the `flutter_module`, -`flutter_module_using_plugin`, and `flutter_module_books` directories: - -```bash -flutter pub get -``` - -### Android and iOS applications - -In addition to the Flutter modules, this repo also includes a number of -Android and iOS applications that demonstrate different ways of importing -them. - -With the exception of `android_using_prebuilt_module`, the Android apps are -ready to run once you've completed the `flutter pub get` commands listed -above. Two of the iOS apps (`ios_fullscreen` and `ios_using_plugin`) use -Cocoapods, though, so you need to run this command within their project -directories to install their dependencies: - -```bash -pod install -``` - -Once that command is complete, you'll find an `xcworkspace` file in the project -directories with the correct Flutter module (and any other dependencies) -included. Open that workspace file, and the app is ready to build and run. - -### `android_fullscreen` and `ios_fullscreen` - -These apps showcase a relatively straightforward integration of -`flutter_module`: - -* The Flutter module is built along with the app when the app is built. -* The Flutter engine is warmed up at app launch. -* The Flutter view is presented with a full-screen Activity or - UIViewController. -* The Flutter view is a navigational leaf node; it does not launch any new, - native Activities or UIViewControllers in response to user actions. - -If you are new to Flutter's add-to-app APIs, these projects are a great place -to begin learning how to use them. - -### `android_using_plugin` and `ios_plugin` - -These apps are similar to `android_fullscreen` and `ios_fullscreen`, with the -following differences: - -* Rather than importing `flutter_module`, they import - `flutter_module_using_plugin`. -* They include the native code (Kotlin or Swift) required to initialize plugins - at Flutter engine creation time. -* Their Flutter view includes an additional button that opens the Flutter docs - in the mobile device's browser. - -If you're interested in learning what additional steps an app needs to take in -order to use a Flutter module that relies on plugins, these projects can help. - -### `android_view` - -Rather than integrating Flutter as a fullscreen page, the `android_view` demo -integrates a partial screen `FlutterView` into an Android `RecyclerView`. - -* Demonstrates the additional application specific plumbing needed to hook a - `FlutterView` to both a separate, application owned `FlutterEngine` and to its - host activity which has its own lifecycle. This is different than a relatively - more self-contained `FlutterActivity`. -* Show how a single `FlutterView` can be used in multiple places in the Android - activity in a performant way. -* Demonstrates a `FlutterView`-based UI interwoven seamlessly into a native - Android UI. -* The Flutter cells use the [`sensors`](https://pub.dev/packages/sensors) - plugin and displays a Flutter logo, rotate based on the phone's current - orientation. - -### `android_using_prebuilt_module` and `ios_using_prebuilt_module` - -These apps are essentially identical to `android_fullscreen` and -`ios_fullscreen`, respectively, with one key difference. Rather than being set -up to compile the `flutter_module` from source each time the app is built, they -import a the module as a prebuilt `aar` (Android) or framework (iOS). This can -be useful for teams that don't want to require every developer working on the -app to have the Flutter toolchain installed on their local machines. - -Prior to building either project for the first time, the `flutter_module` needs -to be built. - -**Building for `android_using_prebuilt_module`** - -To build `flutter_module` as an aar, run this command from the `flutter_module` -directory: - -```bash -flutter build aar -``` - -It will produce `aar` files for debug, profile, and release mode. The Android -app is configured to import the appropriate `aar` based on its own build -configuration, so if you build a debug version of the app, it will look -for the debug `aar`, and so on. - -If the `flutter_module` project is updated, the `aar` files must be rebuilt via -one of the commands above in order for those changes to appear in the app. - -**Building for `ios_using_prebuilt_module`** - -To build `flutter_module` as a set of frameworks, run this command from the -`flutter_module` directory: - -```bash -flutter build ios-framework --xcframework --output=../ios_using_prebuilt_module/Flutter -``` - -This will output frameworks for debug, profile, and release modes into -`ios_using_prebuilt_module/Flutter`. The project file for -`ios_using_prebuilt_module` has been configured to find the frameworks there. - -For more information on how to modify an existing iOS app to reference prebuilt -Flutter frameworks, see this article in the Flutter GitHub wiki: - -https://flutter.dev/docs/development/add-to-app/ios/project-setup - -### `android_books` and `ios_books (TODO)` - -These apps integrate the `flutter_books` module using the simpler build-together -project setup. They simulate a mock scenario where an existing book catalog -list app already exists. Flutter is used to implement an additional book details -page. - -* Similar to `android_fullscreen` and `ios_fullscreen`. -* An existing books catalog app is already implemented in Kotlin and Swift. -* The platform-side app has existing middleware constraints that should also - be the middleware foundation for the additional Flutter screen. - * On Android, the Kotlin app already uses GSON and OkHttp for networking and - references the Google Books API as a data source. These same libraries - also underpin the data fetched and shown in the Flutter screen. - * iOS TODO. -* The platform application interfaces with the Flutter book details page using - idiomatic platform API conventions rather than Flutter conventions. - * On Android, the Flutter activity receives the book to show via activity - intent and returns the edited book by setting the result intent on the - activity. No Flutter concepts are leaked into the consumer activity. - * iOS TODO. -* The [pigeon](https://pub.dev/packages/pigeon) plugin is used to generate - interop APIs and data classes. The same `Book` model class is used within the - Kotlin/Swift program, the Dart program and in the interop between Kotlin/Swift - and Dart. No manual platform channel plumbing needed for interop. - * The `api.dart/java/mm` files generated from the - `flutter_module_books/pigeon/schema.dart` file are checked into source - control. Therefore `pigeon` is only a dev dependency with no runtime - requirements. - * If the `schema.dart` is modified, the generated classes can be updated with - - ```bash - flutter pub run pigeon \ - --input pigeon/schema.dart \ - --java_out ../android_books/app/src/main/java/dev/flutter/example/books/Api.java \ - --java_package "dev.flutter.example.books" - ``` - - in the `flutter_module_books` directory. - -Once you've understood the basics of add-to-app with `android_fullscreen` and -`ios_fullscreen`, this is a good sample to demonstrate how to integrate Flutter -in a slightly more realistic setting with existing business logic. - ## Questions/issues If you have a general question about incorporating Flutter into an existing diff --git a/add_to_app/books/README.md b/add_to_app/books/README.md new file mode 100644 index 000000000..135de88d1 --- /dev/null +++ b/add_to_app/books/README.md @@ -0,0 +1,79 @@ +# books + +Mimics a real world use-case of embedding Flutter into an existing Android app +and demonstrates using [Pigeon](https://pub.dev/packages/pigeon) to communicate +between Fluter and the host application. + +## Description + +These apps integrate the `flutter_books` module using the simpler build-together +project setup. They simulate a mock scenario where an existing book catalog +list app already exists. Flutter is used to implement an additional book details +page. + +* Similar to [`fullscreen`](../fullscreen). +* An existing books catalog app is already implemented in Kotlin and Swift. +* The platform-side app has existing middleware constraints that should also + be the middleware foundation for the additional Flutter screen. + * On Android, the Kotlin app already uses GSON and OkHttp for networking and + references the Google Books API as a data source. These same libraries also + underpin the data fetched and shown in the Flutter screen. + * iOS TODO. +* The platform application interfaces with the Flutter book details page using + idiomatic platform API conventions rather than Flutter conventions. + * On Android, the Flutter activity receives the book to show via activity + intent and returns the edited book by setting the result intent on the + activity. No Flutter concepts are leaked into the consumer activity. + * iOS TODO. +* The [pigeon](https://pub.dev/packages/pigeon) plugin is used to generate + interop APIs and data classes. The same `Book` model class is used within the + Kotlin/Swift program, the Dart program and in the interop between Kotlin/Swift + and Dart. No manual platform channel plumbing needed for interop. + * The `api.dart/java/mm` files generated from the + `flutter_module_books/pigeon/schema.dart` file are checked into source + control. Therefore `pigeon` is only a dev dependency with no runtime + requirements. + * If the `schema.dart` is modified, the generated classes can be updated with + + ```bash + flutter pub run pigeon \ + --input pigeon/schema.dart \ + --java_out ../android_books/app/src/main/java/dev/flutter/example/books/Api.java \ + --java_package "dev.flutter.example.books" + ``` + + in the `flutter_module_books` directory. + +Once you've understood the basics of add-to-app with `android_fullscreen` and +`ios_fullscreen`, this is a good sample to demonstrate how to integrate Flutter +in a slightly more realistic setting with existing business logic. + +## tl;dr + +If you're just looking to get up and running quickly, these bash commands will +fetch packages and set up dependencies (note that the above commands assume +you're building for both iOS and Android, with both toolchains installed): + +```bash + #!/bin/bash + set -e + + cd flutter_module_books/ + flutter pub get + + # For Android builds: + open -a "Android Studio" ../android_books # macOS only + # Or open the ../android_books folder in Android Studio for other platforms. + + # For iOS builds: + # TODO iOS sample +``` + +## Requirements + +* Flutter +* Android Studio + +## Questions/issues + +See [add_to_app/README.md](../README.md) for further help. diff --git a/add_to_app/android_books/.gitignore b/add_to_app/books/android_books/.gitignore similarity index 100% rename from add_to_app/android_books/.gitignore rename to add_to_app/books/android_books/.gitignore diff --git a/add_to_app/android_books/README.md b/add_to_app/books/android_books/README.md similarity index 100% rename from add_to_app/android_books/README.md rename to add_to_app/books/android_books/README.md diff --git a/add_to_app/android_books/app/.gitignore b/add_to_app/books/android_books/app/.gitignore similarity index 100% rename from add_to_app/android_books/app/.gitignore rename to add_to_app/books/android_books/app/.gitignore diff --git a/add_to_app/android_books/app/build.gradle b/add_to_app/books/android_books/app/build.gradle similarity index 100% rename from add_to_app/android_books/app/build.gradle rename to add_to_app/books/android_books/app/build.gradle diff --git a/add_to_app/android_books/app/proguard-rules.pro b/add_to_app/books/android_books/app/proguard-rules.pro similarity index 100% rename from add_to_app/android_books/app/proguard-rules.pro rename to add_to_app/books/android_books/app/proguard-rules.pro diff --git a/add_to_app/android_books/app/src/androidTest/java/dev/flutter/example/books/ExampleInstrumentedTest.kt b/add_to_app/books/android_books/app/src/androidTest/java/dev/flutter/example/books/ExampleInstrumentedTest.kt similarity index 100% rename from add_to_app/android_books/app/src/androidTest/java/dev/flutter/example/books/ExampleInstrumentedTest.kt rename to add_to_app/books/android_books/app/src/androidTest/java/dev/flutter/example/books/ExampleInstrumentedTest.kt diff --git a/add_to_app/android_books/app/src/main/AndroidManifest.xml b/add_to_app/books/android_books/app/src/main/AndroidManifest.xml similarity index 100% rename from add_to_app/android_books/app/src/main/AndroidManifest.xml rename to add_to_app/books/android_books/app/src/main/AndroidManifest.xml diff --git a/add_to_app/android_books/app/src/main/java/dev/flutter/example/books/Api.java b/add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/Api.java similarity index 100% rename from add_to_app/android_books/app/src/main/java/dev/flutter/example/books/Api.java rename to add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/Api.java diff --git a/add_to_app/android_books/app/src/main/java/dev/flutter/example/books/BookApplication.kt b/add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/BookApplication.kt similarity index 100% rename from add_to_app/android_books/app/src/main/java/dev/flutter/example/books/BookApplication.kt rename to add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/BookApplication.kt diff --git a/add_to_app/android_books/app/src/main/java/dev/flutter/example/books/FlutterBookActivity.kt b/add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/FlutterBookActivity.kt similarity index 100% rename from add_to_app/android_books/app/src/main/java/dev/flutter/example/books/FlutterBookActivity.kt rename to add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/FlutterBookActivity.kt diff --git a/add_to_app/android_books/app/src/main/java/dev/flutter/example/books/MainActivity.kt b/add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/MainActivity.kt similarity index 100% rename from add_to_app/android_books/app/src/main/java/dev/flutter/example/books/MainActivity.kt rename to add_to_app/books/android_books/app/src/main/java/dev/flutter/example/books/MainActivity.kt diff --git a/add_to_app/android_books/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/add_to_app/books/android_books/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from add_to_app/android_books/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to add_to_app/books/android_books/app/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/add_to_app/android_books/app/src/main/res/drawable/ic_launcher_background.xml b/add_to_app/books/android_books/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from add_to_app/android_books/app/src/main/res/drawable/ic_launcher_background.xml rename to add_to_app/books/android_books/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/add_to_app/android_books/app/src/main/res/layout/activity_main.xml b/add_to_app/books/android_books/app/src/main/res/layout/activity_main.xml similarity index 100% rename from add_to_app/android_books/app/src/main/res/layout/activity_main.xml rename to add_to_app/books/android_books/app/src/main/res/layout/activity_main.xml diff --git a/add_to_app/android_books/app/src/main/res/layout/book_card.xml b/add_to_app/books/android_books/app/src/main/res/layout/book_card.xml similarity index 100% rename from add_to_app/android_books/app/src/main/res/layout/book_card.xml rename to add_to_app/books/android_books/app/src/main/res/layout/book_card.xml diff --git a/add_to_app/android_books/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/add_to_app/books/android_books/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to add_to_app/books/android_books/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/add_to_app/android_books/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/add_to_app/books/android_books/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to add_to_app/books/android_books/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/add_to_app/android_books/app/src/main/res/mipmap-hdpi/ic_launcher.png b/add_to_app/books/android_books/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/add_to_app/android_books/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/add_to_app/books/android_books/app/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/add_to_app/android_books/app/src/main/res/mipmap-mdpi/ic_launcher.png b/add_to_app/books/android_books/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/add_to_app/android_books/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/add_to_app/books/android_books/app/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/add_to_app/android_books/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/add_to_app/books/android_books/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/add_to_app/android_books/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/add_to_app/books/android_books/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/add_to_app/android_books/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/add_to_app/books/android_books/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/add_to_app/android_books/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/add_to_app/books/android_books/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/add_to_app/android_books/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/add_to_app/books/android_books/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/add_to_app/android_books/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/add_to_app/books/android_books/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_books/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to add_to_app/books/android_books/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/add_to_app/android_books/app/src/main/res/values/colors.xml b/add_to_app/books/android_books/app/src/main/res/values/colors.xml similarity index 100% rename from add_to_app/android_books/app/src/main/res/values/colors.xml rename to add_to_app/books/android_books/app/src/main/res/values/colors.xml diff --git a/add_to_app/android_books/app/src/main/res/values/strings.xml b/add_to_app/books/android_books/app/src/main/res/values/strings.xml similarity index 100% rename from add_to_app/android_books/app/src/main/res/values/strings.xml rename to add_to_app/books/android_books/app/src/main/res/values/strings.xml diff --git a/add_to_app/android_books/app/src/main/res/values/styles.xml b/add_to_app/books/android_books/app/src/main/res/values/styles.xml similarity index 100% rename from add_to_app/android_books/app/src/main/res/values/styles.xml rename to add_to_app/books/android_books/app/src/main/res/values/styles.xml diff --git a/add_to_app/android_books/build.gradle b/add_to_app/books/android_books/build.gradle similarity index 100% rename from add_to_app/android_books/build.gradle rename to add_to_app/books/android_books/build.gradle diff --git a/add_to_app/android_books/gradle.properties b/add_to_app/books/android_books/gradle.properties similarity index 100% rename from add_to_app/android_books/gradle.properties rename to add_to_app/books/android_books/gradle.properties diff --git a/add_to_app/android_books/gradle/wrapper/gradle-wrapper.jar b/add_to_app/books/android_books/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from add_to_app/android_books/gradle/wrapper/gradle-wrapper.jar rename to add_to_app/books/android_books/gradle/wrapper/gradle-wrapper.jar diff --git a/add_to_app/android_books/gradle/wrapper/gradle-wrapper.properties b/add_to_app/books/android_books/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from add_to_app/android_books/gradle/wrapper/gradle-wrapper.properties rename to add_to_app/books/android_books/gradle/wrapper/gradle-wrapper.properties diff --git a/add_to_app/android_books/gradlew b/add_to_app/books/android_books/gradlew similarity index 100% rename from add_to_app/android_books/gradlew rename to add_to_app/books/android_books/gradlew diff --git a/add_to_app/android_books/gradlew.bat b/add_to_app/books/android_books/gradlew.bat similarity index 100% rename from add_to_app/android_books/gradlew.bat rename to add_to_app/books/android_books/gradlew.bat diff --git a/add_to_app/android_books/settings.gradle b/add_to_app/books/android_books/settings.gradle similarity index 100% rename from add_to_app/android_books/settings.gradle rename to add_to_app/books/android_books/settings.gradle diff --git a/add_to_app/flutter_module_books/.gitignore b/add_to_app/books/flutter_module_books/.gitignore similarity index 100% rename from add_to_app/flutter_module_books/.gitignore rename to add_to_app/books/flutter_module_books/.gitignore diff --git a/add_to_app/flutter_module_books/.metadata b/add_to_app/books/flutter_module_books/.metadata similarity index 100% rename from add_to_app/flutter_module_books/.metadata rename to add_to_app/books/flutter_module_books/.metadata diff --git a/add_to_app/flutter_module_books/README.md b/add_to_app/books/flutter_module_books/README.md similarity index 93% rename from add_to_app/flutter_module_books/README.md rename to add_to_app/books/flutter_module_books/README.md index 2aaedcbed..e5a83edef 100644 --- a/add_to_app/flutter_module_books/README.md +++ b/add_to_app/books/flutter_module_books/README.md @@ -3,9 +3,7 @@ This application simulates a mock scenario in which an existing app with business logic and middleware already exists. It demonstrates how to add Flutter to an app that has established patterns for these domains. For more information -this and the other add-to-app samples available in this repo, see the -[README](../README.md) file located in the [/add_to_app](/add_to_app) directory -of this repo. +on how to use it, see the [README.md](../README.md) parent directory. This application also utilizes the [Pigeon](https://pub.dev/packages/pigeon) plugin to avoid manual platform channel wiring. Pigeon autogenerates the diff --git a/add_to_app/flutter_module_books/lib/api.dart b/add_to_app/books/flutter_module_books/lib/api.dart similarity index 100% rename from add_to_app/flutter_module_books/lib/api.dart rename to add_to_app/books/flutter_module_books/lib/api.dart diff --git a/add_to_app/flutter_module_books/lib/main.dart b/add_to_app/books/flutter_module_books/lib/main.dart similarity index 100% rename from add_to_app/flutter_module_books/lib/main.dart rename to add_to_app/books/flutter_module_books/lib/main.dart diff --git a/add_to_app/flutter_module_books/pigeon/schema.dart b/add_to_app/books/flutter_module_books/pigeon/schema.dart similarity index 100% rename from add_to_app/flutter_module_books/pigeon/schema.dart rename to add_to_app/books/flutter_module_books/pigeon/schema.dart diff --git a/add_to_app/flutter_module_books/pubspec.lock b/add_to_app/books/flutter_module_books/pubspec.lock similarity index 100% rename from add_to_app/flutter_module_books/pubspec.lock rename to add_to_app/books/flutter_module_books/pubspec.lock diff --git a/add_to_app/flutter_module_books/pubspec.yaml b/add_to_app/books/flutter_module_books/pubspec.yaml similarity index 100% rename from add_to_app/flutter_module_books/pubspec.yaml rename to add_to_app/books/flutter_module_books/pubspec.yaml diff --git a/add_to_app/flutter_module_books/test/widget_test.dart b/add_to_app/books/flutter_module_books/test/widget_test.dart similarity index 100% rename from add_to_app/flutter_module_books/test/widget_test.dart rename to add_to_app/books/flutter_module_books/test/widget_test.dart diff --git a/add_to_app/fullscreen/README.md b/add_to_app/fullscreen/README.md new file mode 100644 index 000000000..89b040916 --- /dev/null +++ b/add_to_app/fullscreen/README.md @@ -0,0 +1,54 @@ +# fullscreen + +Embeds a full screen instance of Flutter into an existing iOS or Android app. + +## Description + +These apps showcase a relatively straightforward integration of +`flutter_module`: + +* The Flutter module is built along with the app when the app is built. +* The Flutter engine is warmed up at app launch. +* The Flutter view is presented with a full-screen Activity or + UIViewController. +* The Flutter view is a navigational leaf node; it does not launch any new, + native Activities or UIViewControllers in response to user actions. + +If you are new to Flutter's add-to-app APIs, these projects are a great place +to begin learning how to use them. + +## tl;dr + +If you're just looking to get up and running quickly, these bash commands will +fetch packages and set up dependencies (note that the above commands assume +you're building for both iOS and Android, with both toolchains installed): + +```bash + #!/bin/bash + set -e + + cd flutter_module/ + flutter pub get + + # For Android builds: + open -a "Android Studio" ../android_fullscreen # macOS only + # Or open the ../android_fullscreen folder in Android Studio for other platforms. + + # For iOS builds: + cd ../ios_fullscreen + pod install + open IOSFullScreen.xcworkspace +``` + +## Requirements + +* Flutter +* Android + * Android Studio +* iOS + * Xcode + * Cocoapods + +## Questions/issues + +See [add_to_app/README.md](../README.md) for further help. diff --git a/add_to_app/android_fullscreen/.gitignore b/add_to_app/fullscreen/android_fullscreen/.gitignore similarity index 100% rename from add_to_app/android_fullscreen/.gitignore rename to add_to_app/fullscreen/android_fullscreen/.gitignore diff --git a/add_to_app/android_fullscreen/README.md b/add_to_app/fullscreen/android_fullscreen/README.md similarity index 100% rename from add_to_app/android_fullscreen/README.md rename to add_to_app/fullscreen/android_fullscreen/README.md diff --git a/add_to_app/android_fullscreen/app/.gitignore b/add_to_app/fullscreen/android_fullscreen/app/.gitignore similarity index 100% rename from add_to_app/android_fullscreen/app/.gitignore rename to add_to_app/fullscreen/android_fullscreen/app/.gitignore diff --git a/add_to_app/android_fullscreen/app/build.gradle b/add_to_app/fullscreen/android_fullscreen/app/build.gradle similarity index 100% rename from add_to_app/android_fullscreen/app/build.gradle rename to add_to_app/fullscreen/android_fullscreen/app/build.gradle diff --git a/add_to_app/android_fullscreen/app/src/androidTest/java/dev/flutter/example/androidfullscreen/ExampleInstrumentedTest.kt b/add_to_app/fullscreen/android_fullscreen/app/src/androidTest/java/dev/flutter/example/androidfullscreen/ExampleInstrumentedTest.kt similarity index 100% rename from add_to_app/android_fullscreen/app/src/androidTest/java/dev/flutter/example/androidfullscreen/ExampleInstrumentedTest.kt rename to add_to_app/fullscreen/android_fullscreen/app/src/androidTest/java/dev/flutter/example/androidfullscreen/ExampleInstrumentedTest.kt diff --git a/add_to_app/android_fullscreen/app/src/debug/AndroidManifest.xml b/add_to_app/fullscreen/android_fullscreen/app/src/debug/AndroidManifest.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/debug/AndroidManifest.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/debug/AndroidManifest.xml diff --git a/add_to_app/android_fullscreen/app/src/main/AndroidManifest.xml b/add_to_app/fullscreen/android_fullscreen/app/src/main/AndroidManifest.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/AndroidManifest.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/main/AndroidManifest.xml diff --git a/add_to_app/android_fullscreen/app/src/main/java/dev/flutter/example/androidfullscreen/MainActivity.kt b/add_to_app/fullscreen/android_fullscreen/app/src/main/java/dev/flutter/example/androidfullscreen/MainActivity.kt similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/java/dev/flutter/example/androidfullscreen/MainActivity.kt rename to add_to_app/fullscreen/android_fullscreen/app/src/main/java/dev/flutter/example/androidfullscreen/MainActivity.kt diff --git a/add_to_app/android_fullscreen/app/src/main/java/dev/flutter/example/androidfullscreen/MyApplication.kt b/add_to_app/fullscreen/android_fullscreen/app/src/main/java/dev/flutter/example/androidfullscreen/MyApplication.kt similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/java/dev/flutter/example/androidfullscreen/MyApplication.kt rename to add_to_app/fullscreen/android_fullscreen/app/src/main/java/dev/flutter/example/androidfullscreen/MyApplication.kt diff --git a/add_to_app/android_fullscreen/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/add_to_app/android_fullscreen/app/src/main/res/drawable/ic_launcher_background.xml b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/drawable/ic_launcher_background.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/add_to_app/android_fullscreen/app/src/main/res/layout/activity_main.xml b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/layout/activity_main.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/layout/activity_main.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/layout/activity_main.xml diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-hdpi/ic_launcher.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-mdpi/ic_launcher.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/add_to_app/android_fullscreen/app/src/main/res/values/colors.xml b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/values/colors.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/values/colors.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/values/colors.xml diff --git a/add_to_app/android_fullscreen/app/src/main/res/values/strings.xml b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/values/strings.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/values/strings.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/values/strings.xml diff --git a/add_to_app/android_fullscreen/app/src/main/res/values/styles.xml b/add_to_app/fullscreen/android_fullscreen/app/src/main/res/values/styles.xml similarity index 100% rename from add_to_app/android_fullscreen/app/src/main/res/values/styles.xml rename to add_to_app/fullscreen/android_fullscreen/app/src/main/res/values/styles.xml diff --git a/add_to_app/android_fullscreen/app/src/test/java/dev/flutter/example/androidfullscreen/ExampleUnitTest.kt b/add_to_app/fullscreen/android_fullscreen/app/src/test/java/dev/flutter/example/androidfullscreen/ExampleUnitTest.kt similarity index 100% rename from add_to_app/android_fullscreen/app/src/test/java/dev/flutter/example/androidfullscreen/ExampleUnitTest.kt rename to add_to_app/fullscreen/android_fullscreen/app/src/test/java/dev/flutter/example/androidfullscreen/ExampleUnitTest.kt diff --git a/add_to_app/android_fullscreen/build.gradle b/add_to_app/fullscreen/android_fullscreen/build.gradle similarity index 100% rename from add_to_app/android_fullscreen/build.gradle rename to add_to_app/fullscreen/android_fullscreen/build.gradle diff --git a/add_to_app/android_fullscreen/gradle.properties b/add_to_app/fullscreen/android_fullscreen/gradle.properties similarity index 100% rename from add_to_app/android_fullscreen/gradle.properties rename to add_to_app/fullscreen/android_fullscreen/gradle.properties diff --git a/add_to_app/android_fullscreen/gradle/wrapper/gradle-wrapper.jar b/add_to_app/fullscreen/android_fullscreen/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from add_to_app/android_fullscreen/gradle/wrapper/gradle-wrapper.jar rename to add_to_app/fullscreen/android_fullscreen/gradle/wrapper/gradle-wrapper.jar diff --git a/add_to_app/android_fullscreen/gradle/wrapper/gradle-wrapper.properties b/add_to_app/fullscreen/android_fullscreen/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from add_to_app/android_fullscreen/gradle/wrapper/gradle-wrapper.properties rename to add_to_app/fullscreen/android_fullscreen/gradle/wrapper/gradle-wrapper.properties diff --git a/add_to_app/android_fullscreen/gradlew b/add_to_app/fullscreen/android_fullscreen/gradlew similarity index 100% rename from add_to_app/android_fullscreen/gradlew rename to add_to_app/fullscreen/android_fullscreen/gradlew diff --git a/add_to_app/android_fullscreen/gradlew.bat b/add_to_app/fullscreen/android_fullscreen/gradlew.bat similarity index 100% rename from add_to_app/android_fullscreen/gradlew.bat rename to add_to_app/fullscreen/android_fullscreen/gradlew.bat diff --git a/add_to_app/android_fullscreen/settings.gradle b/add_to_app/fullscreen/android_fullscreen/settings.gradle similarity index 100% rename from add_to_app/android_fullscreen/settings.gradle rename to add_to_app/fullscreen/android_fullscreen/settings.gradle diff --git a/add_to_app/flutter_module/.gitignore b/add_to_app/fullscreen/flutter_module/.gitignore similarity index 100% rename from add_to_app/flutter_module/.gitignore rename to add_to_app/fullscreen/flutter_module/.gitignore diff --git a/add_to_app/flutter_module/.metadata b/add_to_app/fullscreen/flutter_module/.metadata similarity index 100% rename from add_to_app/flutter_module/.metadata rename to add_to_app/fullscreen/flutter_module/.metadata diff --git a/add_to_app/flutter_module/README.md b/add_to_app/fullscreen/flutter_module/README.md similarity index 73% rename from add_to_app/flutter_module/README.md rename to add_to_app/fullscreen/flutter_module/README.md index f46611690..092c7d11a 100644 --- a/add_to_app/flutter_module/README.md +++ b/add_to_app/fullscreen/flutter_module/README.md @@ -1,8 +1,8 @@ # flutter_module An example Flutter module used in the Flutter add-to-app samples. For more -information on how to use it, see the [README](../README.md) file located in the -[/add_to_app](/add_to_app) directory of this repo. +information on how to use it, see the [README.md](../README.md) parent +directory. ## Getting Started diff --git a/add_to_app/flutter_module/lib/main.dart b/add_to_app/fullscreen/flutter_module/lib/main.dart similarity index 100% rename from add_to_app/flutter_module/lib/main.dart rename to add_to_app/fullscreen/flutter_module/lib/main.dart diff --git a/add_to_app/flutter_module/pubspec.lock b/add_to_app/fullscreen/flutter_module/pubspec.lock similarity index 100% rename from add_to_app/flutter_module/pubspec.lock rename to add_to_app/fullscreen/flutter_module/pubspec.lock diff --git a/add_to_app/flutter_module/pubspec.yaml b/add_to_app/fullscreen/flutter_module/pubspec.yaml similarity index 100% rename from add_to_app/flutter_module/pubspec.yaml rename to add_to_app/fullscreen/flutter_module/pubspec.yaml diff --git a/add_to_app/flutter_module/test/widget_test.dart b/add_to_app/fullscreen/flutter_module/test/widget_test.dart similarity index 100% rename from add_to_app/flutter_module/test/widget_test.dart rename to add_to_app/fullscreen/flutter_module/test/widget_test.dart diff --git a/add_to_app/flutter_module/test_driver/example.dart b/add_to_app/fullscreen/flutter_module/test_driver/example.dart similarity index 100% rename from add_to_app/flutter_module/test_driver/example.dart rename to add_to_app/fullscreen/flutter_module/test_driver/example.dart diff --git a/add_to_app/ios_fullscreen/.gitignore b/add_to_app/fullscreen/ios_fullscreen/.gitignore similarity index 100% rename from add_to_app/ios_fullscreen/.gitignore rename to add_to_app/fullscreen/ios_fullscreen/.gitignore diff --git a/add_to_app/ios_fullscreen/IOSFullScreen.xcodeproj/project.pbxproj b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcodeproj/project.pbxproj similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen.xcodeproj/project.pbxproj rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcodeproj/project.pbxproj diff --git a/add_to_app/ios_fullscreen/IOSFullScreen.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/add_to_app/ios_fullscreen/IOSFullScreen.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/add_to_app/ios_fullscreen/IOSFullScreen.xcodeproj/xcshareddata/xcschemes/IOSFullScreen.xcscheme b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcodeproj/xcshareddata/xcschemes/IOSFullScreen.xcscheme similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen.xcodeproj/xcshareddata/xcschemes/IOSFullScreen.xcscheme rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcodeproj/xcshareddata/xcschemes/IOSFullScreen.xcscheme diff --git a/add_to_app/ios_fullscreen/IOSFullScreen.xcworkspace/contents.xcworkspacedata b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcworkspace/contents.xcworkspacedata similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen.xcworkspace/contents.xcworkspacedata rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcworkspace/contents.xcworkspacedata diff --git a/add_to_app/ios_fullscreen/IOSFullScreen.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/add_to_app/ios_fullscreen/IOSFullScreen/AppDelegate.swift b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/AppDelegate.swift similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen/AppDelegate.swift rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/AppDelegate.swift diff --git a/add_to_app/ios_fullscreen/IOSFullScreen/Assets.xcassets/AppIcon.appiconset/Contents.json b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen/Assets.xcassets/AppIcon.appiconset/Contents.json rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/add_to_app/ios_fullscreen/IOSFullScreen/Assets.xcassets/Contents.json b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Assets.xcassets/Contents.json similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen/Assets.xcassets/Contents.json rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Assets.xcassets/Contents.json diff --git a/add_to_app/ios_fullscreen/IOSFullScreen/Base.lproj/LaunchScreen.storyboard b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen/Base.lproj/LaunchScreen.storyboard rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Base.lproj/LaunchScreen.storyboard diff --git a/add_to_app/ios_fullscreen/IOSFullScreen/Base.lproj/Main.storyboard b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Base.lproj/Main.storyboard similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen/Base.lproj/Main.storyboard rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Base.lproj/Main.storyboard diff --git a/add_to_app/ios_fullscreen/IOSFullScreen/Info-Debug.plist b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Info-Debug.plist similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen/Info-Debug.plist rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Info-Debug.plist diff --git a/add_to_app/ios_fullscreen/IOSFullScreen/Info-Release.plist b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Info-Release.plist similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen/Info-Release.plist rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/Info-Release.plist diff --git a/add_to_app/ios_fullscreen/IOSFullScreen/ViewController.swift b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/ViewController.swift similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreen/ViewController.swift rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreen/ViewController.swift diff --git a/add_to_app/ios_fullscreen/IOSFullScreenTests/IOSFullScreenTests.swift b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreenTests/IOSFullScreenTests.swift similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreenTests/IOSFullScreenTests.swift rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreenTests/IOSFullScreenTests.swift diff --git a/add_to_app/ios_fullscreen/IOSFullScreenTests/Info.plist b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreenTests/Info.plist similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreenTests/Info.plist rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreenTests/Info.plist diff --git a/add_to_app/ios_fullscreen/IOSFullScreenUITests/IOSFullScreenUITests.swift b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreenUITests/IOSFullScreenUITests.swift similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreenUITests/IOSFullScreenUITests.swift rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreenUITests/IOSFullScreenUITests.swift diff --git a/add_to_app/ios_fullscreen/IOSFullScreenUITests/Info.plist b/add_to_app/fullscreen/ios_fullscreen/IOSFullScreenUITests/Info.plist similarity index 100% rename from add_to_app/ios_fullscreen/IOSFullScreenUITests/Info.plist rename to add_to_app/fullscreen/ios_fullscreen/IOSFullScreenUITests/Info.plist diff --git a/add_to_app/ios_fullscreen/Podfile b/add_to_app/fullscreen/ios_fullscreen/Podfile similarity index 100% rename from add_to_app/ios_fullscreen/Podfile rename to add_to_app/fullscreen/ios_fullscreen/Podfile diff --git a/add_to_app/ios_fullscreen/Podfile.lock b/add_to_app/fullscreen/ios_fullscreen/Podfile.lock similarity index 100% rename from add_to_app/ios_fullscreen/Podfile.lock rename to add_to_app/fullscreen/ios_fullscreen/Podfile.lock diff --git a/add_to_app/ios_fullscreen/README.md b/add_to_app/fullscreen/ios_fullscreen/README.md similarity index 100% rename from add_to_app/ios_fullscreen/README.md rename to add_to_app/fullscreen/ios_fullscreen/README.md diff --git a/add_to_app/plugin/README.md b/add_to_app/plugin/README.md new file mode 100644 index 000000000..a483e75e4 --- /dev/null +++ b/add_to_app/plugin/README.md @@ -0,0 +1,53 @@ +# plugin + +Embeds a full screen Flutter instance that is using plugins into an existing iOS +or Android app. + +## Description + +These apps are similar to the samples in [`fullscreen`](../fullscreen), with the +following differences: + +* They include the native code (Kotlin or Swift) required to initialize plugins + at Flutter engine creation time. +* Their Flutter view includes an additional button that opens the Flutter docs + in the mobile device's browser. + +If you're interested in learning what additional steps an app needs to take in +order to use a Flutter module that relies on plugins, these projects can help. + +## tl;dr + +If you're just looking to get up and running quickly, these bash commands will +fetch packages and set up dependencies (note that the above commands assume +you're building for both iOS and Android, with both toolchains installed): + +```bash + #!/bin/bash + set -e + + cd flutter_module_using_plugin + flutter pub get + + # For Android builds: + open -a "Android Studio" ../android_using_plugin # macOS only + # Or open the ../android_using_plugin folder in Android Studio for other platforms. + + # For iOS builds: + cd ../ios_using_plugin + pod install + open IOSUsingPlugin.xcworkspace +``` + +## Requirements + +* Flutter +* Android + * Android Studio +* iOS + * Xcode + * Cocoapods + +## Questions/issues + +See [add_to_app/README.md](../README.md) for further help. diff --git a/add_to_app/android_using_plugin/.gitignore b/add_to_app/plugin/android_using_plugin/.gitignore similarity index 100% rename from add_to_app/android_using_plugin/.gitignore rename to add_to_app/plugin/android_using_plugin/.gitignore diff --git a/add_to_app/android_using_plugin/README.md b/add_to_app/plugin/android_using_plugin/README.md similarity index 100% rename from add_to_app/android_using_plugin/README.md rename to add_to_app/plugin/android_using_plugin/README.md diff --git a/add_to_app/android_using_plugin/app/.gitignore b/add_to_app/plugin/android_using_plugin/app/.gitignore similarity index 100% rename from add_to_app/android_using_plugin/app/.gitignore rename to add_to_app/plugin/android_using_plugin/app/.gitignore diff --git a/add_to_app/android_using_plugin/app/build.gradle b/add_to_app/plugin/android_using_plugin/app/build.gradle similarity index 100% rename from add_to_app/android_using_plugin/app/build.gradle rename to add_to_app/plugin/android_using_plugin/app/build.gradle diff --git a/add_to_app/android_using_plugin/app/src/androidTest/java/dev/flutter/example/androidusingplugin/ExampleInstrumentedTest.kt b/add_to_app/plugin/android_using_plugin/app/src/androidTest/java/dev/flutter/example/androidusingplugin/ExampleInstrumentedTest.kt similarity index 100% rename from add_to_app/android_using_plugin/app/src/androidTest/java/dev/flutter/example/androidusingplugin/ExampleInstrumentedTest.kt rename to add_to_app/plugin/android_using_plugin/app/src/androidTest/java/dev/flutter/example/androidusingplugin/ExampleInstrumentedTest.kt diff --git a/add_to_app/android_using_plugin/app/src/main/AndroidManifest.xml b/add_to_app/plugin/android_using_plugin/app/src/main/AndroidManifest.xml similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/AndroidManifest.xml rename to add_to_app/plugin/android_using_plugin/app/src/main/AndroidManifest.xml diff --git a/add_to_app/android_using_plugin/app/src/main/java/dev/flutter/example/androidusingplugin/MainActivity.kt b/add_to_app/plugin/android_using_plugin/app/src/main/java/dev/flutter/example/androidusingplugin/MainActivity.kt similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/java/dev/flutter/example/androidusingplugin/MainActivity.kt rename to add_to_app/plugin/android_using_plugin/app/src/main/java/dev/flutter/example/androidusingplugin/MainActivity.kt diff --git a/add_to_app/android_using_plugin/app/src/main/java/dev/flutter/example/androidusingplugin/MyApplication.kt b/add_to_app/plugin/android_using_plugin/app/src/main/java/dev/flutter/example/androidusingplugin/MyApplication.kt similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/java/dev/flutter/example/androidusingplugin/MyApplication.kt rename to add_to_app/plugin/android_using_plugin/app/src/main/java/dev/flutter/example/androidusingplugin/MyApplication.kt diff --git a/add_to_app/android_using_plugin/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/add_to_app/plugin/android_using_plugin/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to add_to_app/plugin/android_using_plugin/app/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/add_to_app/android_using_plugin/app/src/main/res/drawable/ic_launcher_background.xml b/add_to_app/plugin/android_using_plugin/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/drawable/ic_launcher_background.xml rename to add_to_app/plugin/android_using_plugin/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/add_to_app/android_using_plugin/app/src/main/res/layout/activity_main.xml b/add_to_app/plugin/android_using_plugin/app/src/main/res/layout/activity_main.xml similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/layout/activity_main.xml rename to add_to_app/plugin/android_using_plugin/app/src/main/res/layout/activity_main.xml diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-hdpi/ic_launcher.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-mdpi/ic_launcher.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to add_to_app/plugin/android_using_plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_plugin/app/src/main/res/values/colors.xml b/add_to_app/plugin/android_using_plugin/app/src/main/res/values/colors.xml similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/values/colors.xml rename to add_to_app/plugin/android_using_plugin/app/src/main/res/values/colors.xml diff --git a/add_to_app/android_using_plugin/app/src/main/res/values/strings.xml b/add_to_app/plugin/android_using_plugin/app/src/main/res/values/strings.xml similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/values/strings.xml rename to add_to_app/plugin/android_using_plugin/app/src/main/res/values/strings.xml diff --git a/add_to_app/android_using_plugin/app/src/main/res/values/styles.xml b/add_to_app/plugin/android_using_plugin/app/src/main/res/values/styles.xml similarity index 100% rename from add_to_app/android_using_plugin/app/src/main/res/values/styles.xml rename to add_to_app/plugin/android_using_plugin/app/src/main/res/values/styles.xml diff --git a/add_to_app/android_using_plugin/app/src/test/java/dev/flutter/example/androidusingplugin/ExampleUnitTest.kt b/add_to_app/plugin/android_using_plugin/app/src/test/java/dev/flutter/example/androidusingplugin/ExampleUnitTest.kt similarity index 100% rename from add_to_app/android_using_plugin/app/src/test/java/dev/flutter/example/androidusingplugin/ExampleUnitTest.kt rename to add_to_app/plugin/android_using_plugin/app/src/test/java/dev/flutter/example/androidusingplugin/ExampleUnitTest.kt diff --git a/add_to_app/android_using_plugin/build.gradle b/add_to_app/plugin/android_using_plugin/build.gradle similarity index 100% rename from add_to_app/android_using_plugin/build.gradle rename to add_to_app/plugin/android_using_plugin/build.gradle diff --git a/add_to_app/android_using_plugin/gradle.properties b/add_to_app/plugin/android_using_plugin/gradle.properties similarity index 100% rename from add_to_app/android_using_plugin/gradle.properties rename to add_to_app/plugin/android_using_plugin/gradle.properties diff --git a/add_to_app/android_using_plugin/gradle/wrapper/gradle-wrapper.jar b/add_to_app/plugin/android_using_plugin/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from add_to_app/android_using_plugin/gradle/wrapper/gradle-wrapper.jar rename to add_to_app/plugin/android_using_plugin/gradle/wrapper/gradle-wrapper.jar diff --git a/add_to_app/android_using_plugin/gradle/wrapper/gradle-wrapper.properties b/add_to_app/plugin/android_using_plugin/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from add_to_app/android_using_plugin/gradle/wrapper/gradle-wrapper.properties rename to add_to_app/plugin/android_using_plugin/gradle/wrapper/gradle-wrapper.properties diff --git a/add_to_app/android_using_plugin/gradlew b/add_to_app/plugin/android_using_plugin/gradlew similarity index 100% rename from add_to_app/android_using_plugin/gradlew rename to add_to_app/plugin/android_using_plugin/gradlew diff --git a/add_to_app/android_using_plugin/gradlew.bat b/add_to_app/plugin/android_using_plugin/gradlew.bat similarity index 100% rename from add_to_app/android_using_plugin/gradlew.bat rename to add_to_app/plugin/android_using_plugin/gradlew.bat diff --git a/add_to_app/android_using_plugin/settings.gradle b/add_to_app/plugin/android_using_plugin/settings.gradle similarity index 100% rename from add_to_app/android_using_plugin/settings.gradle rename to add_to_app/plugin/android_using_plugin/settings.gradle diff --git a/add_to_app/flutter_module_using_plugin/.gitignore b/add_to_app/plugin/flutter_module_using_plugin/.gitignore similarity index 100% rename from add_to_app/flutter_module_using_plugin/.gitignore rename to add_to_app/plugin/flutter_module_using_plugin/.gitignore diff --git a/add_to_app/flutter_module_using_plugin/.metadata b/add_to_app/plugin/flutter_module_using_plugin/.metadata similarity index 100% rename from add_to_app/flutter_module_using_plugin/.metadata rename to add_to_app/plugin/flutter_module_using_plugin/.metadata diff --git a/add_to_app/flutter_module_using_plugin/README.md b/add_to_app/plugin/flutter_module_using_plugin/README.md similarity index 83% rename from add_to_app/flutter_module_using_plugin/README.md rename to add_to_app/plugin/flutter_module_using_plugin/README.md index 70fc2c983..01c484f82 100644 --- a/add_to_app/flutter_module_using_plugin/README.md +++ b/add_to_app/plugin/flutter_module_using_plugin/README.md @@ -2,8 +2,7 @@ An example Flutter module that uses a native plugin, intended for use in the Flutter add-to-app samples. For more information on how to use it, see the -[README](../README.md) file located in the [/add_to_app](/add_to_app) directory -of this repo. +[README.md](../README.md) parent directory. ## Getting Started diff --git a/add_to_app/flutter_module_using_plugin/lib/cell.dart b/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart similarity index 100% rename from add_to_app/flutter_module_using_plugin/lib/cell.dart rename to add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart diff --git a/add_to_app/flutter_module_using_plugin/lib/main.dart b/add_to_app/plugin/flutter_module_using_plugin/lib/main.dart similarity index 100% rename from add_to_app/flutter_module_using_plugin/lib/main.dart rename to add_to_app/plugin/flutter_module_using_plugin/lib/main.dart diff --git a/add_to_app/flutter_module_using_plugin/pubspec.lock b/add_to_app/plugin/flutter_module_using_plugin/pubspec.lock similarity index 100% rename from add_to_app/flutter_module_using_plugin/pubspec.lock rename to add_to_app/plugin/flutter_module_using_plugin/pubspec.lock diff --git a/add_to_app/flutter_module_using_plugin/pubspec.yaml b/add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml similarity index 100% rename from add_to_app/flutter_module_using_plugin/pubspec.yaml rename to add_to_app/plugin/flutter_module_using_plugin/pubspec.yaml diff --git a/add_to_app/flutter_module_using_plugin/test/widget_test.dart b/add_to_app/plugin/flutter_module_using_plugin/test/widget_test.dart similarity index 100% rename from add_to_app/flutter_module_using_plugin/test/widget_test.dart rename to add_to_app/plugin/flutter_module_using_plugin/test/widget_test.dart diff --git a/add_to_app/ios_using_plugin/.gitignore b/add_to_app/plugin/ios_using_plugin/.gitignore similarity index 100% rename from add_to_app/ios_using_plugin/.gitignore rename to add_to_app/plugin/ios_using_plugin/.gitignore diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.pbxproj b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.pbxproj similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.pbxproj rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.pbxproj diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin.xcworkspace/contents.xcworkspacedata b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcworkspace/contents.xcworkspacedata similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin.xcworkspace/contents.xcworkspacedata rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcworkspace/contents.xcworkspacedata diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin/AppDelegate.swift b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/AppDelegate.swift similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin/AppDelegate.swift rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/AppDelegate.swift diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin/Assets.xcassets/AppIcon.appiconset/Contents.json b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin/Assets.xcassets/AppIcon.appiconset/Contents.json rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin/Assets.xcassets/Contents.json b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Assets.xcassets/Contents.json similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin/Assets.xcassets/Contents.json rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Assets.xcassets/Contents.json diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin/Base.lproj/LaunchScreen.storyboard b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin/Base.lproj/LaunchScreen.storyboard rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Base.lproj/LaunchScreen.storyboard diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin/Base.lproj/Main.storyboard b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Base.lproj/Main.storyboard similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin/Base.lproj/Main.storyboard rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Base.lproj/Main.storyboard diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin/Info-Debug.plist b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Info-Debug.plist similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin/Info-Debug.plist rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Info-Debug.plist diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin/Info-Release.plist b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Info-Release.plist similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin/Info-Release.plist rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/Info-Release.plist diff --git a/add_to_app/ios_using_plugin/IOSUsingPlugin/ViewController.swift b/add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/ViewController.swift similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPlugin/ViewController.swift rename to add_to_app/plugin/ios_using_plugin/IOSUsingPlugin/ViewController.swift diff --git a/add_to_app/ios_using_plugin/IOSUsingPluginTests/IOSUsingPluginTests.swift b/add_to_app/plugin/ios_using_plugin/IOSUsingPluginTests/IOSUsingPluginTests.swift similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPluginTests/IOSUsingPluginTests.swift rename to add_to_app/plugin/ios_using_plugin/IOSUsingPluginTests/IOSUsingPluginTests.swift diff --git a/add_to_app/ios_using_plugin/IOSUsingPluginTests/Info.plist b/add_to_app/plugin/ios_using_plugin/IOSUsingPluginTests/Info.plist similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPluginTests/Info.plist rename to add_to_app/plugin/ios_using_plugin/IOSUsingPluginTests/Info.plist diff --git a/add_to_app/ios_using_plugin/IOSUsingPluginUITests/IOSUsingPluginUITests.swift b/add_to_app/plugin/ios_using_plugin/IOSUsingPluginUITests/IOSUsingPluginUITests.swift similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPluginUITests/IOSUsingPluginUITests.swift rename to add_to_app/plugin/ios_using_plugin/IOSUsingPluginUITests/IOSUsingPluginUITests.swift diff --git a/add_to_app/ios_using_plugin/IOSUsingPluginUITests/Info.plist b/add_to_app/plugin/ios_using_plugin/IOSUsingPluginUITests/Info.plist similarity index 100% rename from add_to_app/ios_using_plugin/IOSUsingPluginUITests/Info.plist rename to add_to_app/plugin/ios_using_plugin/IOSUsingPluginUITests/Info.plist diff --git a/add_to_app/ios_using_plugin/Podfile b/add_to_app/plugin/ios_using_plugin/Podfile similarity index 100% rename from add_to_app/ios_using_plugin/Podfile rename to add_to_app/plugin/ios_using_plugin/Podfile diff --git a/add_to_app/ios_using_plugin/Podfile.lock b/add_to_app/plugin/ios_using_plugin/Podfile.lock similarity index 100% rename from add_to_app/ios_using_plugin/Podfile.lock rename to add_to_app/plugin/ios_using_plugin/Podfile.lock diff --git a/add_to_app/ios_using_plugin/README.md b/add_to_app/plugin/ios_using_plugin/README.md similarity index 100% rename from add_to_app/ios_using_plugin/README.md rename to add_to_app/plugin/ios_using_plugin/README.md diff --git a/add_to_app/prebuilt_module/README.md b/add_to_app/prebuilt_module/README.md new file mode 100644 index 000000000..4e5a24434 --- /dev/null +++ b/add_to_app/prebuilt_module/README.md @@ -0,0 +1,88 @@ +# prebuild_module + +Embeds a full screen instance of Flutter as a prebuilt library that can be +loaded into an existing iOS or Android app. + +## Description + +These apps are essentially identical to `android_fullscreen` and +`ios_fullscreen`, respectively, with one key difference. Rather than being set +up to compile the `flutter_module` from source each time the app is built, they +import a the module as a prebuilt `aar` (Android) or framework (iOS). This can +be useful for teams that don't want to require every developer working on the +app to have the Flutter toolchain installed on their local machines. + +Prior to building either project for the first time, the `flutter_module` needs +to be built. + +**Building for `android_using_prebuilt_module`** + +To build `flutter_module` as an aar, run this command from the `flutter_module` +directory: + +```bash +flutter build aar +``` + +It will produce `aar` files for debug, profile, and release mode. The Android +app is configured to import the appropriate `aar` based on its own build +configuration, so if you build a debug version of the app, it will look +for the debug `aar`, and so on. + +If the `flutter_module` project is updated, the `aar` files must be rebuilt via +one of the commands above in order for those changes to appear in the app. + +**Building for `ios_using_prebuilt_module`** + +To build `flutter_module` as a set of frameworks, run this command from the +`flutter_module` directory: + +```bash +flutter build ios-framework --xcframework --output=../ios_using_prebuilt_module/Flutter +``` + +This will output frameworks for debug, profile, and release modes into +`ios_using_prebuilt_module/Flutter`. The project file for +`ios_using_prebuilt_module` has been configured to find the frameworks there. + +For more information on how to modify an existing iOS app to reference prebuilt +Flutter frameworks, see this article in the Flutter GitHub wiki: + +https://flutter.dev/docs/development/add-to-app/ios/project-setup + +## tl;dr + +If you're just looking to get up and running quickly, these bash commands will +fetch packages and set up dependencies (note that the above commands assume +you're building for both iOS and Android, with both toolchains installed): + +```bash + #!/bin/bash + set -e + + cd flutter_module/ + flutter pub get + + # For Android builds: + flutter build aar + open -a "Android Studio" ../android_using_prebuilt_module/ # macOS only + # Or open the ../android_using_prebuilt_module folder in Android Studio for + # other platforms. + + # For iOS builds: + flutter build ios-framework --xcframework --output=../ios_using_prebuilt_module/Flutter + open ../ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj +``` + +## Requirements + +* Flutter +* Android + * Android Studio +* iOS + * Xcode + * Cocoapods + +## Questions/issues + +See [add_to_app/README.md](../README.md) for further help. diff --git a/add_to_app/android_using_prebuilt_module/.gitignore b/add_to_app/prebuilt_module/android_using_prebuilt_module/.gitignore similarity index 100% rename from add_to_app/android_using_prebuilt_module/.gitignore rename to add_to_app/prebuilt_module/android_using_prebuilt_module/.gitignore diff --git a/add_to_app/android_using_prebuilt_module/README.md b/add_to_app/prebuilt_module/android_using_prebuilt_module/README.md similarity index 100% rename from add_to_app/android_using_prebuilt_module/README.md rename to add_to_app/prebuilt_module/android_using_prebuilt_module/README.md diff --git a/add_to_app/android_using_prebuilt_module/app/.gitignore b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/.gitignore similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/.gitignore rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/.gitignore diff --git a/add_to_app/android_using_prebuilt_module/app/build.gradle b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/build.gradle similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/build.gradle rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/build.gradle diff --git a/add_to_app/android_using_prebuilt_module/app/src/androidTest/java/dev/flutter/example/androidusingprebuiltmodule/ExampleInstrumentedTest.kt b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/androidTest/java/dev/flutter/example/androidusingprebuiltmodule/ExampleInstrumentedTest.kt similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/androidTest/java/dev/flutter/example/androidusingprebuiltmodule/ExampleInstrumentedTest.kt rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/androidTest/java/dev/flutter/example/androidusingprebuiltmodule/ExampleInstrumentedTest.kt diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/AndroidManifest.xml b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/AndroidManifest.xml similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/AndroidManifest.xml rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/AndroidManifest.xml diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/java/dev/flutter/example/androidusingprebuiltmodule/MainActivity.kt b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/java/dev/flutter/example/androidusingprebuiltmodule/MainActivity.kt similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/java/dev/flutter/example/androidusingprebuiltmodule/MainActivity.kt rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/java/dev/flutter/example/androidusingprebuiltmodule/MainActivity.kt diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/java/dev/flutter/example/androidusingprebuiltmodule/MyApplication.kt b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/java/dev/flutter/example/androidusingprebuiltmodule/MyApplication.kt similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/java/dev/flutter/example/androidusingprebuiltmodule/MyApplication.kt rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/java/dev/flutter/example/androidusingprebuiltmodule/MyApplication.kt diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/drawable/ic_launcher_background.xml b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/drawable/ic_launcher_background.xml rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/layout/activity_main.xml b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/layout/activity_main.xml similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/layout/activity_main.xml rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/layout/activity_main.xml diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-hdpi/ic_launcher.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-mdpi/ic_launcher.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/values/colors.xml b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/values/colors.xml similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/values/colors.xml rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/values/colors.xml diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/values/strings.xml b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/values/strings.xml similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/values/strings.xml rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/values/strings.xml diff --git a/add_to_app/android_using_prebuilt_module/app/src/main/res/values/styles.xml b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/values/styles.xml similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/main/res/values/styles.xml rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/main/res/values/styles.xml diff --git a/add_to_app/android_using_prebuilt_module/app/src/test/java/dev/flutter/example/androidusingprebuiltmodule/ExampleUnitTest.kt b/add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/test/java/dev/flutter/example/androidusingprebuiltmodule/ExampleUnitTest.kt similarity index 100% rename from add_to_app/android_using_prebuilt_module/app/src/test/java/dev/flutter/example/androidusingprebuiltmodule/ExampleUnitTest.kt rename to add_to_app/prebuilt_module/android_using_prebuilt_module/app/src/test/java/dev/flutter/example/androidusingprebuiltmodule/ExampleUnitTest.kt diff --git a/add_to_app/android_using_prebuilt_module/build.gradle b/add_to_app/prebuilt_module/android_using_prebuilt_module/build.gradle similarity index 100% rename from add_to_app/android_using_prebuilt_module/build.gradle rename to add_to_app/prebuilt_module/android_using_prebuilt_module/build.gradle diff --git a/add_to_app/android_using_prebuilt_module/gradle.properties b/add_to_app/prebuilt_module/android_using_prebuilt_module/gradle.properties similarity index 100% rename from add_to_app/android_using_prebuilt_module/gradle.properties rename to add_to_app/prebuilt_module/android_using_prebuilt_module/gradle.properties diff --git a/add_to_app/android_using_prebuilt_module/gradle/wrapper/gradle-wrapper.jar b/add_to_app/prebuilt_module/android_using_prebuilt_module/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from add_to_app/android_using_prebuilt_module/gradle/wrapper/gradle-wrapper.jar rename to add_to_app/prebuilt_module/android_using_prebuilt_module/gradle/wrapper/gradle-wrapper.jar diff --git a/add_to_app/android_using_prebuilt_module/gradle/wrapper/gradle-wrapper.properties b/add_to_app/prebuilt_module/android_using_prebuilt_module/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from add_to_app/android_using_prebuilt_module/gradle/wrapper/gradle-wrapper.properties rename to add_to_app/prebuilt_module/android_using_prebuilt_module/gradle/wrapper/gradle-wrapper.properties diff --git a/add_to_app/android_using_prebuilt_module/gradlew b/add_to_app/prebuilt_module/android_using_prebuilt_module/gradlew similarity index 100% rename from add_to_app/android_using_prebuilt_module/gradlew rename to add_to_app/prebuilt_module/android_using_prebuilt_module/gradlew diff --git a/add_to_app/android_using_prebuilt_module/gradlew.bat b/add_to_app/prebuilt_module/android_using_prebuilt_module/gradlew.bat similarity index 100% rename from add_to_app/android_using_prebuilt_module/gradlew.bat rename to add_to_app/prebuilt_module/android_using_prebuilt_module/gradlew.bat diff --git a/add_to_app/android_using_prebuilt_module/settings.gradle b/add_to_app/prebuilt_module/android_using_prebuilt_module/settings.gradle similarity index 100% rename from add_to_app/android_using_prebuilt_module/settings.gradle rename to add_to_app/prebuilt_module/android_using_prebuilt_module/settings.gradle diff --git a/add_to_app/prebuilt_module/flutter_module/.gitignore b/add_to_app/prebuilt_module/flutter_module/.gitignore new file mode 100644 index 000000000..cdecf14aa --- /dev/null +++ b/add_to_app/prebuilt_module/flutter_module/.gitignore @@ -0,0 +1,41 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +*.swp +profile + +DerivedData/ + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +build/ +.android/ +.ios/ +.flutter-plugins diff --git a/add_to_app/prebuilt_module/flutter_module/.metadata b/add_to_app/prebuilt_module/flutter_module/.metadata new file mode 100644 index 000000000..194fb3cc0 --- /dev/null +++ b/add_to_app/prebuilt_module/flutter_module/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 532a8fed41a4f6595965f02f3edf9666ba5ebf44 + channel: master + +project_type: module diff --git a/add_to_app/prebuilt_module/flutter_module/README.md b/add_to_app/prebuilt_module/flutter_module/README.md new file mode 100644 index 000000000..092c7d11a --- /dev/null +++ b/add_to_app/prebuilt_module/flutter_module/README.md @@ -0,0 +1,14 @@ +# flutter_module + +An example Flutter module used in the Flutter add-to-app samples. For more +information on how to use it, see the [README.md](../README.md) parent +directory. + +## Getting Started + +For more information about Flutter, check out +[flutter.dev](https://flutter.dev). + +For instructions on how to integrate Flutter modules into your existing +applications, see Flutter's +[add-to-app documentation](https://flutter.dev/docs/development/add-to-app). diff --git a/add_to_app/prebuilt_module/flutter_module/lib/main.dart b/add_to_app/prebuilt_module/flutter_module/lib/main.dart new file mode 100644 index 000000000..d422c6762 --- /dev/null +++ b/add_to_app/prebuilt_module/flutter_module/lib/main.dart @@ -0,0 +1,161 @@ +// Copyright 2019 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:provider/provider.dart'; + +/// The entrypoint for the flutter module. +void main() { + // This call ensures the Flutter binding has been set up before creating the + // MethodChannel-based model. + WidgetsFlutterBinding.ensureInitialized(); + + final model = CounterModel(); + + runApp( + ChangeNotifierProvider.value( + value: model, + child: MyApp(), + ), + ); +} + +/// A simple model that uses a [MethodChannel] as the source of truth for the +/// state of a counter. +/// +/// Rather than storing app state data within the Flutter module itself (where +/// the native portions of the app can't access it), this module passes messages +/// back to the containing app whenever it needs to increment or retrieve the +/// value of the counter. +class CounterModel extends ChangeNotifier { + CounterModel() { + _channel.setMethodCallHandler(_handleMessage); + _channel.invokeMethod('requestCounter'); + } + + final _channel = MethodChannel('dev.flutter.example/counter'); + + int _count = 0; + + int get count => _count; + + void increment() { + _channel.invokeMethod('incrementCounter'); + } + + Future _handleMessage(MethodCall call) async { + if (call.method == 'reportCounter') { + _count = call.arguments as int; + notifyListeners(); + } + } +} + +/// The "app" displayed by this module. +/// +/// It offers two routes, one suitable for displaying as a full screen and +/// another designed to be part of a larger UI.class MyApp extends StatelessWidget { +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Module Title', + routes: { + '/': (context) => FullScreenView(), + '/mini': (context) => Contents(), + }, + ); + } +} + +/// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed +/// full-screen. +class FullScreenView extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Full-screen Flutter'), + ), + body: const Contents(showExit: true), + ); + } +} + +/// The actual content displayed by the module. +/// +/// This widget displays info about the state of a counter and how much room (in +/// logical pixels) it's been given. It also offers buttons to increment the +/// counter and (optionally) close the Flutter view. +class Contents extends StatelessWidget { + final bool showExit; + + const Contents({this.showExit = false}); + + @override + Widget build(BuildContext context) { + final mediaInfo = MediaQuery.of(context); + + return SizedBox.expand( + child: Stack( + children: [ + Positioned.fill( + child: DecoratedBox( + decoration: BoxDecoration( + color: Theme.of(context).scaffoldBackgroundColor, + ), + ), + ), + Positioned.fill( + child: Opacity( + opacity: .25, + child: FittedBox( + fit: BoxFit.cover, + child: FlutterLogo(), + ), + ), + ), + Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Window is ${mediaInfo.size.width.toStringAsFixed(1)} x ' + '${mediaInfo.size.height.toStringAsFixed(1)}', + style: Theme.of(context).textTheme.headline5, + ), + SizedBox(height: 16), + Consumer( + builder: (context, model, child) { + return Text( + 'Taps: ${model.count}', + style: Theme.of(context).textTheme.headline5, + ); + }, + ), + SizedBox(height: 16), + Consumer( + builder: (context, model, child) { + return ElevatedButton( + onPressed: () => model.increment(), + child: Text('Tap me!'), + ); + }, + ), + if (showExit) ...[ + SizedBox(height: 16), + ElevatedButton( + onPressed: () => SystemNavigator.pop(animated: true), + child: Text('Exit this screen'), + ), + ], + ], + ), + ), + ], + ), + ); + } +} diff --git a/add_to_app/prebuilt_module/flutter_module/pubspec.lock b/add_to_app/prebuilt_module/flutter_module/pubspec.lock new file mode 100644 index 000000000..1454afdbe --- /dev/null +++ b/add_to_app/prebuilt_module/flutter_module/pubspec.lock @@ -0,0 +1,269 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0-nullsafety.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0-nullsafety.3" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + espresso: + dependency: "direct dev" + description: + name: espresso + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+7" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.0-nullsafety.2" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_driver: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + json_rpc_2: + dependency: transitive + description: + name: json_rpc_2 + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.2" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10-nullsafety.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.1" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0-nullsafety.2" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0-nullsafety.2" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.2+3" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.4" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0-nullsafety.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + sync_http: + dependency: transitive + description: + name: sync_http + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19-nullsafety.2" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.3" + vm_service_client: + dependency: transitive + description: + name: vm_service_client + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.6+2" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + webdriver: + dependency: transitive + description: + name: webdriver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" +sdks: + dart: ">=2.10.0-110 <2.11.0" + flutter: ">=1.16.0 <2.0.0" diff --git a/add_to_app/prebuilt_module/flutter_module/pubspec.yaml b/add_to_app/prebuilt_module/flutter_module/pubspec.yaml new file mode 100644 index 000000000..b3b327b3a --- /dev/null +++ b/add_to_app/prebuilt_module/flutter_module/pubspec.yaml @@ -0,0 +1,33 @@ +name: flutter_module +description: An example Flutter module. + +version: 1.0.0+1 + +environment: + sdk: ">=2.6.0-dev <3.0.0" + +dependencies: + flutter: + sdk: flutter + provider: ^4.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_driver: + sdk: flutter + espresso: ^0.0.1+2 + +flutter: + uses-material-design: true + + # This section identifies your Flutter project as a module meant for + # embedding in a native host app. These identifiers should _not_ ordinarily + # be changed after generation - they are used to ensure that the tooling can + # maintain consistency when adding or modifying assets and plugins. + # They also do not have any bearing on your native host application's + # identifiers, which may be completely independent or the same as these. + module: + androidX: true + androidPackage: dev.flutter.example.flutter_module + iosBundleIdentifier: dev.flutter.example.flutterModule diff --git a/add_to_app/prebuilt_module/flutter_module/test/widget_test.dart b/add_to_app/prebuilt_module/flutter_module/test/widget_test.dart new file mode 100644 index 000000000..43ba66ba4 --- /dev/null +++ b/add_to_app/prebuilt_module/flutter_module/test/widget_test.dart @@ -0,0 +1,45 @@ +// Copyright 2019 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; +import 'package:flutter_module/main.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:provider/provider.dart'; + +class MockCounterModel extends ChangeNotifier implements CounterModel { + int _count = 0; + + int get count => _count; + + void increment() { + _count++; + notifyListeners(); + } +} + +void main() { + testWidgets('MiniView smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget( + MaterialApp( + home: ChangeNotifierProvider.value( + value: MockCounterModel(), + child: Contents(), + ), + ), + ); + + // Verify that our counter starts at 0. + expect(find.text('Taps: 0'), findsOneWidget); + expect(find.text('Taps: 1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.text('Tap me!')); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('Taps: 0'), findsNothing); + expect(find.text('Taps: 1'), findsOneWidget); + }); +} diff --git a/add_to_app/prebuilt_module/flutter_module/test_driver/example.dart b/add_to_app/prebuilt_module/flutter_module/test_driver/example.dart new file mode 100644 index 000000000..5f1e45315 --- /dev/null +++ b/add_to_app/prebuilt_module/flutter_module/test_driver/example.dart @@ -0,0 +1,13 @@ +// Copyright 2020 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter_driver/driver_extension.dart'; +import 'package:flutter_module/main.dart' as app; + +// This alternate entrypoint is used for espresso testing. See +// https://pub.dev/packages/espresso for details. +void main() { + enableFlutterDriverExtension(); + app.main(); +} diff --git a/add_to_app/ios_using_prebuilt_module/.gitignore b/add_to_app/prebuilt_module/ios_using_prebuilt_module/.gitignore similarity index 100% rename from add_to_app/ios_using_prebuilt_module/.gitignore rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/.gitignore diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.pbxproj b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.pbxproj similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.pbxproj rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.pbxproj diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/AppDelegate.swift b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/AppDelegate.swift similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/AppDelegate.swift rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/AppDelegate.swift diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Assets.xcassets/AppIcon.appiconset/Contents.json b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Assets.xcassets/AppIcon.appiconset/Contents.json rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Assets.xcassets/Contents.json b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Assets.xcassets/Contents.json similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Assets.xcassets/Contents.json rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Assets.xcassets/Contents.json diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Base.lproj/LaunchScreen.storyboard b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Base.lproj/LaunchScreen.storyboard rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Base.lproj/LaunchScreen.storyboard diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Base.lproj/Main.storyboard b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Base.lproj/Main.storyboard similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Base.lproj/Main.storyboard rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Base.lproj/Main.storyboard diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Info-Debug.plist b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Info-Debug.plist similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Info-Debug.plist rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Info-Debug.plist diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Info-Release.plist b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Info-Release.plist similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Info-Release.plist rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/Info-Release.plist diff --git a/add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/ViewController.swift b/add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/ViewController.swift similarity index 100% rename from add_to_app/ios_using_prebuilt_module/IOSUsingPrebuiltModule/ViewController.swift rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/IOSUsingPrebuiltModule/ViewController.swift diff --git a/add_to_app/ios_using_prebuilt_module/README.md b/add_to_app/prebuilt_module/ios_using_prebuilt_module/README.md similarity index 85% rename from add_to_app/ios_using_prebuilt_module/README.md rename to add_to_app/prebuilt_module/ios_using_prebuilt_module/README.md index bff7a9cd0..ddd5f4145 100644 --- a/add_to_app/ios_using_prebuilt_module/README.md +++ b/add_to_app/prebuilt_module/ios_using_prebuilt_module/README.md @@ -12,3 +12,12 @@ For more information about Flutter, check out For instructions on how to integrate Flutter modules into your existing applications, see Flutter's [add-to-app documentation](https://flutter.dev/docs/development/add-to-app). + +## Requirements + +* Flutter +* Android + * Android Studio +* iOS + * Xcode + * Cocoapods diff --git a/tool/android_ci_script.sh b/tool/android_ci_script.sh index fcbb9e98a..5b809d409 100755 --- a/tool/android_ci_script.sh +++ b/tool/android_ci_script.sh @@ -2,21 +2,26 @@ set -e -echo "Fetching dependencies and building 'flutter_module'." -pushd add_to_app/flutter_module +echo "Fetching dependencies and building 'prebuilt_module/flutter_module/'." +pushd add_to_app/prebuilt_module/flutter_module/ flutter packages get flutter build aar popd -echo "Fetching dependencies for 'flutter_module_using_plugin'." -pushd add_to_app/flutter_module_using_plugin +echo "Fetching dependencies for 'plugin/flutter_module_using_plugin'." +pushd add_to_app/plugin/flutter_module_using_plugin +flutter packages get +popd + +echo "Fetching dependencies for 'fullscreen/'." +pushd add_to_app/fullscreen/flutter_module flutter packages get popd declare -ar ANDROID_PROJECT_NAMES=( - "add_to_app/android_fullscreen" \ - "add_to_app/android_using_plugin" \ - "add_to_app/android_using_prebuilt_module" \ + "add_to_app/fullscreen/android_fullscreen" \ + "add_to_app/plugin/android_using_plugin" \ + "add_to_app/prebuilt_module/android_using_prebuilt_module" \ ) for PROJECT_NAME in "${ANDROID_PROJECT_NAMES[@]}" @@ -44,7 +49,7 @@ fi # eventually be rolled out to each Android project and included in the loop # above. echo "== Espresso testing 'android_fullscreen' on Flutter's ${FLUTTER_VERSION} channel ==" -pushd "add_to_app/android_fullscreen" +pushd "add_to_app/fullscreen/android_fullscreen" ./gradlew app:assembleAndroidTest ./gradlew app:assembleDebug -Ptarget=../flutter_module/test_driver/example.dart gcloud auth activate-service-account --key-file=../../svc-keyfile.json diff --git a/tool/flutter_ci_script_beta.sh b/tool/flutter_ci_script_beta.sh index 23c91482c..b7d546ad9 100755 --- a/tool/flutter_ci_script_beta.sh +++ b/tool/flutter_ci_script_beta.sh @@ -3,9 +3,10 @@ set -e declare -ar PROJECT_NAMES=( - "add_to_app/flutter_module" \ - "add_to_app/flutter_module_using_plugin" \ - "add_to_app/flutter_module_books" \ + "add_to_app/fullscreen/flutter_module" \ + "add_to_app/prebuilt_module/flutter_module" \ + "add_to_app/plugin/flutter_module_using_plugin" \ + "add_to_app/books/flutter_module_books" \ "animations" \ # Tracking issue: https://github.com/flutter/samples/issues/652 # "flutter_maps_firestore" \ diff --git a/tool/flutter_ci_script_dev.sh b/tool/flutter_ci_script_dev.sh index bbf8abc4d..c735ed246 100755 --- a/tool/flutter_ci_script_dev.sh +++ b/tool/flutter_ci_script_dev.sh @@ -3,9 +3,10 @@ set -e declare -ar PROJECT_NAMES=( - "add_to_app/flutter_module" \ - "add_to_app/flutter_module_using_plugin" \ - "add_to_app/flutter_module_books" \ + "add_to_app/fullscreen/flutter_module" \ + "add_to_app/prebuilt_module/flutter_module" \ + "add_to_app/plugin/flutter_module_using_plugin" \ + "add_to_app/books/flutter_module_books" \ "animations" \ # Tracking issue: https://github.com/flutter/samples/issues/652 # "flutter_maps_firestore" \ diff --git a/tool/flutter_ci_script_stable.sh b/tool/flutter_ci_script_stable.sh index d9ccdb2cf..1c4830571 100755 --- a/tool/flutter_ci_script_stable.sh +++ b/tool/flutter_ci_script_stable.sh @@ -3,9 +3,10 @@ set -e declare -ar PROJECT_NAMES=( - "add_to_app/flutter_module" \ - "add_to_app/flutter_module_using_plugin" \ - "add_to_app/flutter_module_books" \ + "add_to_app/fullscreen/flutter_module" \ + "add_to_app/prebuilt_module/flutter_module" \ + "add_to_app/plugin/flutter_module_using_plugin" \ + "add_to_app/books/flutter_module_books" \ "animations" \ "flutter_maps_firestore" \ "infinite_list" \ diff --git a/tool/ios_ci_script.sh b/tool/ios_ci_script.sh index a3358be46..22683a842 100755 --- a/tool/ios_ci_script.sh +++ b/tool/ios_ci_script.sh @@ -5,20 +5,24 @@ set -e echo "Pre-caching ios artifacts, such as the Flutter.framework" flutter precache --no-web --no-linux --no-windows --no-fuchsia --no-android --no-macos -echo "Fetching dependencies and building 'flutter_module'." -pushd add_to_app/flutter_module +echo "Fetching dependencies and building 'prebuilt_module/flutter_module'." +pushd add_to_app/prebuilt_module/flutter_module flutter packages get flutter build ios-framework --xcframework --output="$(pwd)/../ios_using_prebuilt_module/Flutter" popd -echo "Fetching dependencies for 'flutter_module_using_plugin'." -pushd add_to_app/flutter_module_using_plugin +echo "Fetching dependencies for 'plugin/flutter_module_using_plugin'." +pushd add_to_app/plugin/flutter_module_using_plugin flutter packages get popd +echo "Fetching dependencies and building 'fullscreen/flutter_module'." +pushd add_to_app/fullscreen/flutter_module +flutter packages get +popd -echo "== Testing 'add_to_app/ios_fullscreen' on Flutter's $FLUTTER_VERSION channel ==" -pushd "add_to_app/ios_fullscreen" +echo "== Testing 'add_to_app/fullscreen/ios_fullscreen' on Flutter's $FLUTTER_VERSION channel ==" +pushd "add_to_app/fullscreen/ios_fullscreen" pod install @@ -35,8 +39,8 @@ COMPILER_INDEX_STORE_ENABLE=NO CONFIGURATION=Release \ popd -echo "== Testing 'add_to_app/ios_using_plugin' on Flutter's $FLUTTER_VERSION channel ==" -pushd "add_to_app/ios_using_plugin" +echo "== Testing 'add_to_app/plugin/ios_using_plugin' on Flutter's $FLUTTER_VERSION channel ==" +pushd "add_to_app/plugin/ios_using_plugin" pod install @@ -53,8 +57,8 @@ COMPILER_INDEX_STORE_ENABLE=NO CONFIGURATION=Release \ popd -echo "== Testing 'add_to_app/ios_using_prebuilt_module' on Flutter's $FLUTTER_VERSION channel ==" -pushd "add_to_app/ios_using_prebuilt_module" +echo "== Testing 'add_to_app/prebuilt_module/ios_using_prebuilt_module' on Flutter's $FLUTTER_VERSION channel ==" +pushd "add_to_app/prebuilt_module/ios_using_prebuilt_module" xcodebuild CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO \ CODE_SIGN_IDENTITY=- EXPANDED_CODE_SIGN_IDENTITY=- \