Install Flutter. See the official setup guide.
You also need an editor. See the Flutter docs for setup.
Clone this repository and install packages:
git clone https://github.com/nisrulz/flutter-examples.git
cd flutter-examples
make packagesOpen any example folder in your editor, then run the app on a device or emulator:
cd <example-folder>
flutter runFor example:
cd simple_material_app
flutter runEvery example app is split into two files:
lib/main.dart: the app wrapper. It only sets up theMaterialApp(title, theme, routes).lib/example.dart: the focused example code. This file teaches the concept the app demonstrates. Open it to see how the feature works.
The repository is large. If you only want one example, use git sparse-checkout:
git clone --no-checkout https://github.com/nisrulz/flutter-examples.git
cd flutter-examples
git sparse-checkout init --cone
git sparse-checkout set <example_folder>
git checkoutExample:
git clone --no-checkout https://github.com/nisrulz/flutter-examples.git
cd flutter-examples
git sparse-checkout init --cone
git sparse-checkout set simple_material_app
git checkoutYou now have the single example checked out.