flutter_bench_contract 0.4.1
flutter_bench_contract: ^0.4.1 copied to clipboard
Device performance scenarios and a regression golden gate for Flutter overlay and widget solutions — as a reusable package.
Example: demo consumer #
demo_solution is a minimal consumer of flutter_bench_contract: a fake
toast/popover-like solution (a bottom card, no scroll anchor) driven by a
hand-written driver. It shows the only library-specific code a consumer
writes — the driver — and how the generated scenario bridges wire it into
the contract. No external package is involved.
Layout:
bench/drivers/demo_solution_driver.dart— the driver (show/update/hide/isStable/currentContent/buildScene). A toast has no anchor, so S4 scroll coupling is declaredunsupported.bench/contract/— generated scenario bridges (S1–S4), byte-identical to whatcontract initproduces.bench_contract.yaml— the consumer manifest.test_driver/integration_test.dart— the device entrypoint thatcontract run --devicecompiles.
Run on the host (no device needed):
dart run flutter_bench_contract:contract verify
flutter test bench/contract/s1_idle_zero_test.dart
Run on a device (records goldens under a ref):
dart run flutter_bench_contract:contract run --mode record --ref android
Write your own consumer by copying this layout and replacing the driver.