|
| 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. |
0 commit comments