|
1 | 1 | ## Local Development
|
2 | 2 |
|
| 3 | +### With Flutter tools (recommended) |
| 4 | + |
| 5 | +1. Fork and download the [Flutter repo](https://github.com/flutter/flutter). Detailed instructions can be found [here](https://github.com/flutter/flutter/wiki/Setting-up-the-Framework-development-environment). |
| 6 | +2. Add an alias to your `.bashrc`/`.zshrc` for Flutter Tools: |
| 7 | +``` |
| 8 | +alias flutter_tools='/YOUR_PATH/flutter/bin/dart --observe /YOUR_PATH/flutter/packages/flutter_tools/bin/flutter_tools.dart' |
| 9 | +``` |
| 10 | + |
| 11 | +> **Explanation:** |
| 12 | +> * `/PATH_TO_YOUR_FLUTTER_REPO/bin/dart`: This is the path to the Dart SDK that Flutter Tools uses |
| 13 | +> * `--observe`: This flag specifies we want a Dart DevTools URL for debugging |
| 14 | +> * `/PATH_TO_YOUR_FLUTTER_REPO/packages/flutter_tools/bin/flutter_tools.dart`: This is the path to Flutter Tools itself |
| 15 | +> |
| 16 | +> *More details can be found at the Flutter Tools [README](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/README.md).* |
| 17 | +3. In your Flutter Tools [`pubspec.yaml`](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/pubspec.yaml), change the DWDS dependency to point to your local DWDS: |
| 18 | +``` |
| 19 | + dwds: |
| 20 | + path: /YOUR_PATH/dwds |
| 21 | +``` |
| 22 | +4. Choose a Flutter app to run (eg, the [old](https://github.com/flutter/flutter/tree/master/dev/integration_tests/flutter_gallery) or [new](https://github.com/flutter/gallery) Flutter Gallery apps). |
| 23 | +5. From the Flutter app repo, run your local Flutter Tools with alias you defined in step #2: |
| 24 | +``` |
| 25 | +flutter_tools run -d chrome |
| 26 | +``` |
| 27 | +6. Open up the **first** Dart DevTools URL you see printed: |
| 28 | +``` |
| 29 | +... |
| 30 | +The Dart VM service is listening on http://127.0.0.1:8181/ajXIPMLq6iI=/ |
| 31 | +The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/ajXIPMLq6iI=/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FajXIPMLq6iI%3D%2Fws <== THIS ONE! |
| 32 | +Launching lib/main.dart on Chrome in debug mode... |
| 33 | +... |
| 34 | +``` |
| 35 | +7. The Dart DevTools you open is connected to your Flutter Tools, but because of the path dependency added in step #3, you can debug your local DWDS as well. |
| 36 | + |
| 37 | +### With WebDev |
| 38 | + |
3 | 39 | 1. In the `/webdev` directory, run `pub global activate --source path webdev` (this only needs to be run once)
|
4 | 40 | 2. Uncomment the dwds dependency override in `/webdev/webdev/pubspec.yaml`, then run `dart run build_runner build` from `/webdev/webdev` directory
|
5 | 41 | * *Note: You will have to comment and build, and then uncomment and build, each time you need to pick up new changes*
|
|
0 commit comments