commit | 120de224b3d615f2e2a58b170d593910ccb0ff70 | [log] [tgz] |
---|---|---|
author | naudzghebre <naudzghebre@google.com> | Fri Dec 16 18:50:56 2022 +0000 |
committer | Naud Ghebre <naudzghebre@google.com> | Fri Dec 16 18:50:56 2022 +0000 |
tree | 7a2a64ee3c25b7f26548e917672bdd33751b5cab | |
parent | fd9021edeb6380d18a8873521e56d9eb3bdf6ca6 [diff] |
[flutter/keyevent, flutter/textinput] Add additional wiring to handle flutter/keyevent and flutter/textinput channels. - This should be at the same state for keyboard input as flutter runner impl in the engine repo. - May need more investigating in the future, currently cursor doesn't move to end of text in TextField, but text is inputted and displays. Change-Id: I90f324286acc7dee82f8dd67cbb16fe69ec06649 Reviewed-on: https://fuchsia-review.googlesource.com/c/flutter-embedder/+/761164 Reviewed-by: Ben Bergkamp <benbergkamp@google.com> Reviewed-by: Alexander Biggs <akbiggs@google.com>
The Flutter Embedder for Fuchsia is a new in-progress runtime for Flutter apps on Fuchsia. This runtime is built on top of Flutter's embedder platform.
This repository is a work in progress and should be considered experimental.
This embedder can currently only be built on Linux, not Mac or Windows (native).
If you're using WSL2 (Windows Subsystem for Linux), see SETUP_WINDOWS.md first.
Clone this repository.
git clone https://fuchsia.googlesource.com/flutter-embedder
Set $FUCHSIA_EMBEDDER_DIR
to your flutter-embedder.git checkout location, for example ~/flutter-embedder
.
export FUCHSIA_EMBEDDER_DIR=$HOME/flutter-embedder
Bootstrap the repository's dependencies:
$FUCHSIA_EMBEDDER_DIR/scripts/bootstrap.sh
This script initializes tools (including bazel
and ffx
), installs some Git hooks and downloads the workstation_eng.qemu-x64
product bundle, which you can use to run the examples below.
Start the emulator.
If running in a graphical environment:
$FUCHSIA_EMBEDDER_DIR/tools/ffx emu start workstation_eng.qemu-x64
If running in a terminal environment:
$FUCHSIA_EMBEDDER_DIR/tools/ffx emu start --headless workstation_eng.qemu-x64
If you want to use your own build of Fuchsia instead of a prebuilt image, see testing_fuchsia_sdk_changes.md
.
Set the default target in ffx to be fuchsia-emulator
:
$FUCHSIA_EMBEDDER_DIR/tools/ffx target default set fuchsia-emulator
Run an example component:
$FUCHSIA_EMBEDDER_DIR/scripts/build_and_run_example.sh hello_flutter
This can also be done from VSCode by following this guide.
For an arm64 device, run:
$FUCHSIA_EMBEDDER_DIR/scripts/build_and_run_example.sh hello_flutter --cpu arm64
To watch logs for the example component, run:
$FUCHSIA_EMBEDDER_DIR/scripts/build_and_run_example.sh hello_flutter --log
If you want to watch all logs, run $FUCHSIA_EMBEDDER_DIR/tools/ffx log
in a separate terminal.
To watch FIDL calls for the example component, run:
$FUCHSIA_EMBEDDER_DIR/scripts/build_and_run_example.sh hello_flutter --fidl
Caveats:
--fidl
currently requires using a local Fuchsia SDK instead of the prebuilt Fuchsia SDK. See this guide for setup instructions.
--fidl
attaches after the component has been run, so it does not pick up FIDL calls made when the component starts.
TODO(akbiggs): Work with Bazel SDK team to get proper support for --fidl
.
To attach a debugger to the example component, see debugging.md
See git_workflow.md
.
Running the Flutter app is handled by the Flutter Engine's embedder platform code. This code is compiled into a shared library called libflutter_engine.so
, which we can interact with using the embedder.h
header.
If you need to make changes to this Flutter Engine code (for example for testing a new API in embedder.h
with this embedder) see making_engine_changes.md
for instructions.
This isn‘t required for changes to only flutter-embedder.git’s source code.
You may want to test changes to the Fuchsia platform (fuchsia.git
) against the flutter-embedder repository locally (for example, to validate a WIP API using a Flutter component). To do so, see testing_fuchsia_sdk_changes.md
for instructions.
This isn‘t required for changes to only flutter-embedder.git’s source code (in which case you can follow “Run an example app”) or changes to only fuchsia.git's non-SDK code (in which case you can run the example component on an emulator from fuchsia.git). It is only necessary if you have an unsubmitted API in the Fuchsia SDK that you want to test in flutter-embedder.