32.83 Flutter Style Package Example

20250414

It is good practice to include an example folder in any package to demonstrate the package and provide a quick starting point for someone using the package.

Many published packages include within their example a collection of platform sub-folders: android, ios, linux, macOS, web, and windows. Such folders do not seem to be essential and are created by the flutter create command anyhow. Sometimes specific changes are required and such folders should be included, but in general we should leave it to flutter to create them rather than cluttering repositories with files that are not specifically created for our package.

A user wanting to run the example will do one of the following.

For android, ios, web:

flutter create .

For linux, macos, windows:

flutter create --platforms=windows,macos,linux .

Lots of flutter packages seem to include the folders anyhow. It would be interesting to know why.



Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0