A handbook for newcomers - flutter-tizen/flutter-tizen GitHub Wiki
Note: This page is for developers who want to contribute to the flutter-tizen project but not general app developers.
Where's the source code?
- flutter/flutter (Flutter SDK)
- flutter (the Flutter framework)
- flutter_tools (the Flutter CLI tools)
- flutter/engine (the Flutter engine)
- dart:ui (a low level interface of the engine to the Flutter framework)
- embedder.h (the embedder API)
- cpp_client_wrapper (a C++ abstraction of the engine for use by plugins and apps)
//shell/platform/android
(the Android embedder)//shell/platform/windows
(the Windows embedder)
- flutter-tizen/flutter-tizen (the flutter-tizen tool)
//lib
(the main source code that depends on and extends flutter_tools)//embedding
(Tizen embeddings for C++ and C# apps)
- flutter-tizen/engine (a fork of the Flutter engine with minimal modifications)
- flutter-tizen/embedder (the Tizen embedder)
//flutter/shell/platform/tizen
(the main source code)
- flutter-tizen/plugins (Flutter plugins written for Tizen)
- flutter-tizen/tizen_interop (Dart bindings for Tizen C APIs)
Tip: Apply these settings before you browse any source code in VS Code.
Learning resources
Must read
What's a custom embedder?
- Flutter architectural overview: Platform embedding
- Custom Flutter Engine Embedders
- flutter_from_scratch (a minimal custom embedder for Raspberry Pi)
Getting started with plugin development
- Writing custom platform-specific code (how platform channels work)
- Developing packages & plugins (Dart packages and federated plugins)
- Writing a flutter-tizen plugin
Flutter sample apps
Others
- Dart language
- C interop using dart:ffi
- The Engine architecture
- The GN build system (the build system used for building the engine and embedder)
- dart compile (Dart's precompiled snapshot types: kernel and AOT)
Glossary
- Flutter framework. See the Flutter wiki.
- Flutter engine. See the Flutter wiki.
- Embedder. See the Flutter wiki.
- Embedding. See the Flutter wiki.
- flutter_tools. The
flutter
command line program. Theflutter-tizen
tool can be used as an alternative if you're developing for Tizen devices. - Platform channel. A messaging system around the engine, framework, apps, and plugins. A message codec is used to serialize Dart or C++ values as binary messages before they are sent over platform channels. Some common codecs and channel types (such as
BasicMessageChannel
,MethodChannel
,EventChannel
) are already implemented by the Flutter framework (for Dart) and cpp_client_wrapper (for C++). - Dart FFI. Dart's mechanism of calling C native functions from Dart code. Somewhat similar to .NET's P/Invoke. For details, see Flutter architectural overview: Foreign Function Interface.
TPK structure
A typical Flutter app package consists of the following files.
tpkroot
├── bin
│ ├── Runner.dll # The main executable (compiled App.cs)
│ └── Tizen.Flutter.Embedding.dll # The embedding assembly (referenced by Runner.dll)
├── lib
│ ├── libapp.so # AOT compiled Dart code (app + framework)
│ ├── libflutter_engine.so # The Flutter engine
│ ├── libflutter_tizen.so # The Tizen embedder
│ └── libflutter_plugins.so # Compiled native plugins (if any)
├── res
│ ├── flutter_assets
│ │ └── ... # Asset files (fonts, images, and etc.)
│ └── icudtl.dat # The ICU data file
├── shared
│ └── res
│ └── ic_launcher.png # The icon file
└── tizen-manifest.xml # The manifest file
The above tree represents a release TPK structure. In case of a debug TPK, the AOT snapshot libapp.so
is replaced with the following three kernel snapshots (intermediate representation of Dart code which is to be JIT compiled by the Dart VM at runtime).
tpkroot
└── res
└── flutter_assets
├── vm_snapshot_data
├── isolate_snapshot_data
└── kernel_blob.bin