BoundsFactory class abstract

An abstract factory that computes and exposes SVG region bounds.

Implementations are expected to compute bounds for parsed SVG regions and expose:

  • hasData: whether meaningful bounds are available,
  • data: the computed mapping of selectors to region bounds,
  • state: the current computation state.

Implementations should notify listeners when the available bounds change (via ChangeNotifier). Clients can call load to (re)compute bounds and reset to clear cached results or swap parser delegates.

Important notes:

  • Bounds computation may depend on the widget size (layout). Callers that need bounds after layout should call load from a post-frame callback or when the hosting widget reports its size.
  • data should be a stable (possibly empty) BoundsList and never return null.
Inheritance

Constructors

BoundsFactory()

Properties

data → BoundsList
Returns the current computed bounds mapping.
no setter
hasData → bool
Returns true if computed bounds exist and are non-empty.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → ConnectionState
The current ConnectionState of the underlying bounds computation.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object.
inherited
load() → void
Load raw bounds from the parser and update internal state.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset([InteractiveParserDelegate? parserDelegate]) → void
Reset internal cached bounds and optionally replace the parserDelegate.
resolve(Size size, {BoxFit fit = BoxFit.contain, Alignment alignment = Alignment.topLeft}) → BoundsList
Resolve and return bounds adjusted for the given output size.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited