Flutter / Dart SDK Demo
CLI app demonstrating the nimiq_faucet Dart SDK. Runs as a compiled binary in Docker.
What this demonstrates
FaucetClientinstantiationconfig()to fetch faucet configurationclaim()submission withHostContextwaitForConfirmation()polling- Error handling via
FaucetException
Run locally
bash
cd examples/flutter-mobile-app
dart pub get
FAUCET_URL=http://localhost:8080 dart run bin/main.dart "NQ00 0000 0000 0000 0000 0000 0000 0000 0000"Run with Docker
bash
# From repo root — starts faucet + runs this demo
docker compose -f deploy/compose/docker-compose.yml -f examples/docker-compose.yml up --build example-flutter
# The container runs the claim and exits. Check logs:
docker compose -f deploy/compose/docker-compose.yml -f examples/docker-compose.yml logs example-flutterFor a real Flutter mobile app
This example is a Dart CLI to prove the SDK works in Docker. For a real Flutter mobile app:
flutter create my_app && cd my_app- Add
nimiq_faucettopubspec.yaml - Use
FaucetClientin your widgets (seepackages/sdk-flutter/example/main.dart)