flutter/docs/unsorted_wiki/Running-examples.md
Kate Lovett ed8eaf1b84
Migrate the flutter/flutter wiki to docs/unsorted_wiki (#148562)
Part of https://github.com/flutter/flutter/issues/145009
This is part one of the wiki migration.
This moves all wiki pages wholesale into the new docs directory with no changes.
Follow up PRs will sort them, updating breadcrumbs and links.
2024-05-17 22:12:18 +00:00

12 lines
666 B
Markdown

To run an example, switch to that example's directory, and use `flutter run`.
Make sure you have an emulator running, or a device connected over USB and
debugging enabled on that device.
* `cd examples/hello_world`
* `flutter run`
You can also specify a particular Dart file to run if you want to run an example
that doesn't have a `lib/main.dart` file using the `-t` command-line option. For
example, to run the `widgets/spinning_square.dart` example in the [examples/layers](https://github.com/flutter/flutter/tree/master/examples/layers)
directory on a connected Android device, from that directory you would run:
`flutter run -t widgets/spinning_square.dart`