flutter_example_template library
A shell that demonstrates a package without knowing which one.
A menu of destinations, a viewport-aware preview stage with a device wall, a
Code pane that reads the running file, a settings panel, and the app chrome
around them. Nothing here names a subject, and
test/portable_seam_test.dart holds it to that by walking the tree rather
than trusting the intention.
Three ports carry everything a consumer has to supply: ShellDestinations for what the menu points at and how long it lives, SettingsHost for a settings panel over a settings object this package must not name, and PresetSummary for named combinations. Every member on them was read off a call site rather than designed.
This barrel is the entry point, and that is a rule rather than a
convenience. Nothing outside lib/src/ may import into it. Dart makes
src/ private by naming agreement and by nothing else — a consumer's
package:…/src/x.dart resolves fine and compiles, right up until the day
somebody enforces the convention. A symbol is exported here or it is not
public.
Classes
- CodePane
- Renders the bytes of assetPath, not a copy of them.
- DeviceWall
- The Device Wall — desktop, tablet and mobile rendered together.
- ExampleThemeController
- Which theme the app is showing, and the ability to change it.
- ExampleThemeScope
- Publishes the ExampleThemeController to the pages beneath it.
- FeatureDetailPane
- One feature, opened.
- FeatureListPane
- Every feature the spec names, in a column of its own.
- FeatureMatch
- A feature the search kept, and why it kept it.
- Interaction
- One feature changing another, and the evidence that it does.
- Metrics
- A set of readings taken at one moment.
- MetricsChip
- The same readings as one line, for where there is no room for the panel.
- MetricsPanel
- The readings in a titled box.
- PresetBar
- The named combinations, above the subject.
- PresetSummary
- A named combination of features, as far as the bar that draws it is concerned.
- PreviewFrame
- Shows a whole viewport at once, shrinking it when it does not fit.
- PreviewStage
- Lays child out at spec's size, and tells it that is the whole screen.
- Reading
- One named measurement, already formatted.
- RouteDestination
- A destination that opens on its own route.
- SettingFeature
- A capability of the subject, and the settings that only mean something once it is on.
- SettingGroup
- One thing a reader might be trying to do.
- SettingsControl
- One labelled control in the settings panel.
- SettingsHost
- The port between the panes and a settings object they must not name.
- ShellDestination
- One entry in the menu.
- ShellDestinations
- The set of destinations one shell draws, together with their lifetime.
- ShellMenu
- Lists every destination under its category, and says which one is open.
- ShellPage
- A category menu, and — while a destination is open in it — a preview stage and a knob region.
- StageDestination
- A destination the shell draws itself, in its stage and its knob region.
- ThemeModeButton
- Cycles the app between following the system, light, and dark.
- ViewportBar
- Chooses what the stage is showing — one named viewport, or all of them.
- ViewportSpec
- One named viewport, and whether the shell around it keeps its furniture at that width.
Enums
- ReadingSeverity
- How much attention one reading is asking for.
- ShellCategory
- The groups the menu shows, in the order it shows them.
Functions
-
buildDropdownRow<
T> ({required String id, required String label, required T value, required List< T> items, required String itemLabel(T), required ValueChanged<T> onChanged, bool indent = false}) → SettingsControl -
buildLogSlider(
{required String id, required String label, required double value, required double min, required double max, required ValueChanged< double> onChanged}) → SettingsControl -
buildSliderSetting(
{required String id, required String label, required double value, required double min, required double max, required String unit, required ValueChanged< double> onChanged, int decimalPlaces = 0, bool indent = false}) → SettingsControl - The controls the settings panes are built from. Each is pure: it renders what it is handed and reports back through its callback, knowing nothing of the subject's settings object or of which feature it belongs to.
-
buildSwitchTile(
{required String id, required String label, required bool value, required ValueChanged< bool> onChanged, bool indent = false}) → SettingsControl -
exampleTheme(
Brightness brightness, {String? chromeFont}) → ThemeData -
The application theme for
brightness. -
featureIn(
List< SettingGroup> spec, String id) → SettingFeature - The feature with this id, in this spec. Throws when nothing has it — an id that names nothing is a typo, not a null.
-
formatNumber(
int number) → String -
searchFeatures(
String query, SettingsHost host) → List< FeatureMatch> -
The features a search for
querykeeps. -
settingMatches(
String label, String query) → bool -
Whether a control named
labelshould survive a search forquery.