OudsFlag class
A UI element that displays a country or region flag identified by its ISO 3166-1 alpha-2 countryCode.
Purpose
The flag is purely decorative — it identifies a country or region visually and must never serve as a functional indicator (e.g. it must not represent a language choice).
Size
A flag always renders at 67 × 50 dp (base dimensions). These values are not fixed during user zoom: they are multiplied by the system text scale factor so the flag grows proportionally with the user's zoom level — in compliance with OUDS accessibility guidelines.
Assets
SVG flag assets are bundled inside ouds_core under
assets/flags/<code>.svg (e.g. assets/flags/fr.svg).
The countryCode is case-insensitive — 'FR' and 'fr' both resolve
to the French flag. An unknown code renders an empty space of the
correct scaled size.
Semantics
Flags are always excluded from the accessibility tree (decorative). The country name must be provided through a sibling text label in the UI (e.g. the OudsListItem.label next to the flag).
Example:
OudsFlag('fr')
OudsFlag('US') // case-insensitive
Example — inside a list item:
OudsListItem(
label: 'France', // country name in the label
leading: OudsListItemLeadingFlag(OudsFlag('fr')),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- OudsFlag
Constructors
Properties
- countryCode → String
-
ISO 3166-1 alpha-2 country code (case-insensitive).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited