Skip to main content

Lain — Flutter Practicals CLI

Lain is a small Python command-line tool that generates Dart source files for the 11 highlighted Flutter practicals.

Included practicals

  1. Hello World & Flutter setup
  2. StatefulWidget lifecycle
  3. Navigator.push() and Navigator.pop()
  4. Parent-child state management
  5. Login form and validation
  6. Popup menu
  7. DropdownButton with dynamic data
  8. GridView
  9. ListView with custom widgets
  10. Expanded and Flexible
  11. Audio playback
  12. GestureDetector and button callbacks

Install locally

From this project directory:

python -m pip install .

Or install in editable/development mode:

python -m pip install -e .

Run

lain

Choose a practical number. Lain writes a Dart file into the current working directory, for example practical_16.dart.

Other commands

lain --list
lain --show 16
lain --output ./generated

To write the selected practical directly into an existing Flutter project's lib/main.dart, run lain --flutter from the Flutter project root. Lain checks for pubspec.yaml and asks before overwriting lib/main.dart.

Practical 20 setup

The audio practical uses the audioplayers Flutter plugin and an audio asset. Add this to the Flutter project's pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  audioplayers: ^6.0.0

flutter:
  assets:
    - assets/audio/music.mp3

Place an audio file at assets/audio/music.mp3, then run:

flutter pub get

The generated Dart file is named practical_20.dart. For plugin-based practicals, additional Flutter dependencies and assets may be required; see comments in the generated file.

Development

python -m pip install -e .
lain --list

License

MIT

Metadata

Release files for lain-the-slayer 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lain-the-slayer 0.2.0
File Size Uploaded Provenance Actions
lain_the_slayer-0.2.0.tar.gz 9.4 kB Without provenance Details for lain_the_slayer-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lain-the-slayer 0.2.0
File Interpreter ABI Platform Actions
lain_the_slayer-0.2.0-py3-none-any.whl Python 3 none any Details for lain_the_slayer-0.2.0-py3-none-any.whl

Total release size: 23.9 kB

Release files / lain_the_slayer-0.2.0.tar.gz

Download URL lain_the_slayer-0.2.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
732baec81a91a320893570256d019c409e5d74322335aecc6aaca742d60b091f
BLAKE2b-256 checksum
How to use checksums
3dfa084dad5777a31438c7da121f2d2c0e810500b42efd45200413df06d7474a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / lain_the_slayer-0.2.0-py3-none-any.whl

Download URL lain_the_slayer-0.2.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0982ae60be373b2e355d634d572a31fd68ff6b85a01a1b03a80be6964dcfce39
BLAKE2b-256 checksum
How to use checksums
4e29ec576d868e729e1b0096d5a2549a6f992cb0654bf2638358db1eb81b6d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for lain-the-slayer 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page