commit | c27c5d5106e08c8a1189cb2fb45cb077199af53d | [log] [tgz] |
---|---|---|
author | Alexander Biggs <akbiggs@google.com> | Thu Jul 28 22:21:53 2022 +0000 |
committer | Alexander Biggs <akbiggs@google.com> | Mon Aug 01 23:23:02 2022 +0000 |
tree | f0653aacae2c86c6ca5e8f7ac14e946c6d7b8086 | |
parent | ff9e87cf5cd2635b15aa22a0c5323122466896e5 [diff] |
[embedder] Replace spinning_cube with flutter anim sample. spinning_cube does not render properly on the web platform which makes it difficult to debug what the expected behavior is. Replacing it with another animation sample from https://github.com/flutter/website/blob/main/examples/animation/animate5. To test, `scripts/build_and_run_example.sh animation_example`. Demo at tiny resolution: https://photos.app.goo.gl/iBTjfUFkrcePZEYi7 Bug: 46971 Change-Id: Idd1ec8a5b25f070caa0d341cf4db194766ca8ae2
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.
Set $FUCHSIA_EMBEDDER_DIR
to your flutter-embedder.git checkout location, for example ~/flutter-embedder
.
Make sure this repository has the required submodules:
git submodule update --recursive --init
Run $FUCHSIA_EMBEDDER_DIR/scripts/bootstrap.sh
.
Ensure that there are Fuchsia SSH keys in your host machine. You will need them for running the Fuchsia emulator.
[[ -f "${HOME}/.ssh/fuchsia_ed25519" ]] || ssh-keygen -P "" -t ed25519 -f "${HOME}/.ssh/fuchsia_ed25519" -C "${USER}@$(hostname -f) Shared SSH Key for Fuchsia" [[ -f "${HOME}/.ssh/fuchsia_authorized_keys" ]] || ssh-keygen -y -f "${HOME}/.ssh/fuchsia_ed25519" > "${HOME}/.ssh/fuchsia_authorized_keys"
Now the repository is ready to build the sample.
Fetch an emulator image:
$FUCHSIA_EMBEDDER_DIR/tools/ffx product-bundle get workstation_eng.qemu-x64
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
(optional) Watch the device log in a separate window:
$FUCHSIA_EMBEDDER_DIR/tools/ffx log
Run an example app:
$FUCHSIA_EMBEDDER_DIR/scripts/build_and_run_example.sh hello_flutter
TODO(akbiggs): The app occasionally gets stuck on a loading screen instead of rendering. Re-running the app usually fixes it. We need to fix this.
Occasionally you will need to update the Flutter Engine artifacts (embedder.h and libengine_flutter.so) that are used by the embedder to run Flutter apps. A script is provided for this workflow.
$ENGINE_DIR
to the src
folder of your Flutter Engine checkout location, for example ~/engine/src
.$FUCHSIA_EMBEDDER_DIR
should be set to your flutter-embedder.git checkout location, for example ~/flutter-embedder
.$DEPOT_TOOLS
should be set to your depot_tools
location, for example ~/depot_tools
.git stash
or git commit
any local changes to the Flutter Engine or the script will fail.You can run the script with a flutter/engine
Git commit to sync the Engine artifacts to that revision.
$FUCHSIA_EMBEDDER_DIR/scripts/sync_engine_artifacts_to_revision.sh <ENGINE_COMMIT_SHA>
A common workflow is to sync your Engine commit to the Flutter tool in this repository, for example when updating the Flutter tool to a new version. To do this:
$FUCHSIA_EMBEDDER_DIR/scripts/sync_engine_artifacts_to_revision.sh $(cat $FUCHSIA_EMBEDDER_DIR/third_party/dart-pkg/internal/flutter/flutter/bin/internal/engine.version)