flutter_example_template 0.1.0
flutter_example_template: ^0.1.0 copied to clipboard
An example-app shell for Flutter packages: a preview stage at three widths, a device wall, a code pane and a settings panel, all driven through ports so it names no subject.
0.1.0 #
First release. The shell was built inside the example app of a Flutter table package over roughly a dozen tickets, extracted once it had been proven portable, and rebuilt here around three ports.
What a consumer gets
ShellPage— a category menu, a preview stage and a knob region, holding one destination at a time.PreviewStage,PreviewFrameandViewportSpec— a subtree rendered as if it were running at desktop, tablet or phone size: constrained, told that is the whole screen, and given its ownOverlayso tooltips and drags stay inside the frame.DeviceWall— all three viewports at once, live, over one shared state. The single-viewport modes answer what something looks like at a width; the wall answers what changed between them.CodePane— a recipe's own source, read out of the asset bundle so what is on screen and what executes cannot disagree.flutter_syntax_highlighttokenizes it into a partition, so concatenating every token reproduces the file byte for byte, and this package decides only what a kind looks like.PresetBar,FeatureListPane,FeatureDetailPane— a settings panel drawn from a description of groups, features, options and the interactions between them, with search over control labels.MetricsPanelandMetricsChip— named readings the consumer formats and assigns a severity, since the thresholds belong to whoever knows what is being measured.exampleTheme— chrome that carries no hue, so the only colour on screen is the one your package is wearing. The font family is a parameter; this package ships no typeface and names none. The palette is not a parameter, and ADR-0013 says what that buys.
The three ports
ShellDestinations carries what the menu points at and its lifetime.
SettingsHost is five members, each read off a real call site. PresetSummary
carries a preset's name and what to watch for, and deliberately not what it turns
on. Writes across the seam are commands — setSwitch(id, on), applyPreset(id)
— never a settings object, because constructing one means knowing its type.
The property, and what enforces it
Nothing in lib/ names what it demonstrates. Three rules hold what the
compiler will not, all of them legal Dart when violated: nothing under lib/
imports outside dart:, package:flutter/ and flutter_syntax_highlight;
nothing outside lib/src/ reaches into it; and the barrel and the tree name the
same files, both ways. A fourth lives in example/ — a file the Code pane shows
imports no shell.
Also in this release
example/demonstrates an adaptive action bar, deliberately not a table.docs/adr/records thirteen decisions, including the ones most likely to be re-proposed: no demo framework, the font as a parameter but not the palette, no line numbers in the Code pane, why this package is depended on rather than copied, why the SDK floor is 3.27.0 and not the 3.22 the code alone would reach, and why the import allow-list grew to three.- The Dart tokenizer is
flutter_syntax_highlightrather than 485 lines undersrc/. Measured before it was decided: the two disagree on 1,821 characters of 38,492, every one of them the package being finer — string interpolation most of all, which the copy painted as one flat literal. .github/workflows/ci.ymlruns both suites on four legs — the declared floor and the current stable, on Linux and on Windows. The platform axis is there because a property inportable_seam_test.darthad been red on Windows since the day it was written, and nothing was looking..github/workflows/screenshots.ymlrunstool/screenshots.shwhenlib/,example/ortool/moves, and weekly besides. It gates on the script's own exit code — a shot it could not reach — and uploads what it captured rather than committing it, because a bot that commits screenshots is a bot that can quietly replace the front page.tool/screenshots.shregenerates the README images by driving the example in headless Chrome, pressing controls by their semantics label and checking the state it reached before capturing. The Code pane's shot also checks the picture, because its content is painted to a canvas that no label can see.
Runs on Flutter 3.27.0 and up, and that floor was measured rather than
inherited from whatever built it: both suites — 23 tests here, 11 in the
example — pass and analyse clean on 3.27.0 and on 3.41.9, and 3.24.5 fails
with exactly one error, CardThemeData in example_theme.dart. pubspec.yaml
names that line, and says why it is not swapped for the older spelling that
would reach lower still. The upper end is held by CI rather than by memory: the
latest stable legs resolve 3.47.2 and run the same suites on every push.