Skip to content

A demonstrable integration of Flutter Views into an existing native codebase.

Notifications You must be signed in to change notification settings

joshuadeguzman/flutter-addtoapp-basic-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Add-to-App Basic Demo

by Joshua M. de Guzman

A demonstrable flutter integration into an existing codebase, with the help of platform channels.

DISCLAIMER: Since Flutter's "Add-to-App" functionality is in preview, the associated APIs and tooling are not stable and are subject to change.

About

This repo demonstrate 2 possible use cases on how you can add your Flutter views in your existing codebase:

  • View Embedding
  • Entire Screen

Resources

Some docs and blog that you will need to continue your journey in maximizing Flutter Add-to-App feature.

Another project I wrote where I introduced Google Protobuf for serializing the platform channels data.

Project

1. Setup

a. Setup Flutter

$ flutter channel master
$ flutter upgrade
$ flutter packages get

b. Setup Android

$ cd flutter
$ flutter build apk
$ cd .. && cd android
$ ./gradlew installDebug

c. Setup iOS

$ cd flutter
$ flutter build ios
$ cd .. && cd ios
$ pod install
$ open flutter_addtoapp_basic_ios.xcworkspace

2. Run

Attach (Running alongside native platform)

$ flutter attach

Debug

$ flutter run --verbose

Release

$ flutter run --verbose --release

Profile

$ flutter run --verbose --profile

3. Tests

$ flutter run test/<TEST_FILE.dart>

4. Technical Specs

Available channels

Name Type
channel-username MethodChannel
channel-embedded-messages BasicMessageChannel<String>

Available routes

Name Widget Description
/flutter-screen FlutterScreen Shows a full screen Flutter view. Presented as an Activity or ViewController in Android and iOS respectively.
/flutter-embedded-view FlutterEmbeddedView Shows a particular section of the app in Flutter.

Support

I would highly appreciate if we connect on Twitter or Github, and discuss Fluttery things over a cup of coffee ☕.

Contact

License

flutter-addtoapp-basic-demo is released under the BSD-3 Clause License. See LICENSE for details.

About

A demonstrable integration of Flutter Views into an existing native codebase.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published