OudsSkeletonProvider class

Controls the skeleton state of supported OUDS components in a subtree.

The nearest provider determines the shared state. An individual component with skeleton: true remains in its skeleton state even when the provider is disabled. Because skeleton defaults to false, setting it to false does not override an enabled provider. A nested disabled provider can exclude a subtree.

import 'package:ouds_core/components/skeleton/ouds_skeleton_provider.dart';

OudsSkeletonProvider(
  enabled: isLoading,
  semanticsLabel: localizedLoadingMessage,
  child: Column(
    children: [
      OudsButton(
        label: 'Continue',
        appearance: OudsButtonAppearance.defaultAppearance,
        onPressed: () {},
      ),
      OudsTag.text(label: 'Status'),
    ],
  ),
)

An enabled provider exposes one loading live region and suppresses the individual announcements of skeletons in its scope. Other descendants remain accessible. Supply a localized semanticsLabel; no default label is provided. Consecutive enabled providers share the outer announcement; a disabled provider starts an independent scope.

Inheritance

Constructors

OudsSkeletonProvider({Key? key, required bool enabled, String? semanticsLabel, required Widget child})
Creates a scope for a shared skeleton state.
const

Properties

child → Widget
Descendants controlled by this provider.
final
enabled → bool
Whether supported descendant components display their skeletons.
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
semanticsLabel → String?
Optional localized loading announcement for this group.
final

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

Static Methods

isEnabledOf(BuildContext context) → bool
Returns the nearest shared skeleton state, or false without a provider.