Skip to content

Commit c97b76e

Browse files
stuartmorganfranciscojma86
authored andcommitted
Address the 'How do I just use it' FAQ (#246)
Adds documentation targetted at someone who has found the project hoping to be able to run a command or two and have desktop support in their existing Flutter application. Attempts to set expectations, but also provide some more information about how someone could potentially get started even without experience in desktop development.
1 parent 255592d commit c97b76e

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

Flutter-Requirements.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,13 @@ on all platforms.
6262

6363
Symptoms of missing fonts can include text failing to display, console logging
6464
about failure to load fonts, or in some cases crashes.
65+
66+
## Plugins
67+
68+
If your project uses any plugins with platform components, they won't
69+
work, as the native side will be missing. Depending on how the Dart side of the
70+
plugin is written, they may fail gracefully, or may throw errors.
71+
72+
You may need to make the calls to those plugins conditional based on the host
73+
platform. Alternately, if you have the expertise, you could implement the native
74+
side of the plugin in your desktop project(s).

Quick-Start.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Quick Start
2+
3+
A common question for people discovering this project is: How do I easily add
4+
desktop support to my existing Flutter application?
5+
6+
The answer is that at this point, you don't. The project is still in early
7+
stages, and a lot of things are still in flux; if you don't already have
8+
experience doing desktop development on the platform(s) you want to add,
9+
this project is probably not ready for you to use it yet. The focus is currently
10+
on improving core functionality, not on ease of use. Neither the API surface nor
11+
the project structure are stable, and no attempt will be made to provide
12+
supported migration paths as things change.
13+
14+
However, if you want to try out an existing Flutter application running on the
15+
desktop even with those caveats, and don't have experience with desktop
16+
development, here are two approaches that might work for you.
17+
18+
With either approach, be sure to follow the [main README](README.md) and
19+
[library README](library/README.md) instructions on setting up prerequisites
20+
and adjusting your Flutter application.
21+
22+
## Replace the 'example' Flutter Code
23+
24+
Since `example/` is already configured to run on all the platforms this project
25+
supports, you can swap in your project's Dart code, `pubspec.yaml`, resources,
26+
etc., then follow the [normal directions](example/README.md) for building the
27+
example application on your platform.
28+
29+
This will be the easiest approach to keep working as the project changes, but
30+
requires that you essentially wrap your whole application in a
31+
flutter-desktop-embedding checkout.
32+
33+
## Copy the '\*\_fde' Directories
34+
35+
Starting from the example projects means you don't have to create projects from
36+
scratch, and since they are self-contained they can be added to an existing
37+
project without needing to move it. However, because the projects build
38+
the flutter-desktop-embedding libraries from source, they contain relative paths
39+
to the flutter-desktop-embedding projects and tools they depend on. You will
40+
need to update those paths in order for the projects to work. On Linux, the
41+
variables you will need to change are documented in the Makefile. On macOS and
42+
Windows, you will need some familiarity with Xcode and Visual Studio
43+
respectively to make the changes.
44+
45+
With this approach, you should expect breakage when you update the
46+
flutter-desktop-embedding reposity; when that happens you will need to look at
47+
what has changed in the exmaple projects and update your copies accordingly, or
48+
start over with fresh copies and adjust the paths again.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ optional plugins to access other native platform functionality.
1111

1212
## How to Use This Code
1313

14+
_If you have an existing Flutter app and just want to get it running, see
15+
the [quick start](Quick-Start.md) page before continuing._
16+
1417
### Setting Up
1518

1619
The tooling and build infrastructure for this project requires that you have

0 commit comments

Comments
 (0)