ModelAvailability class sealed

Whether the on-device model can be used, and if not, why.

switch (await AppleFoundationModels.availability()) {
  case ModelAvailable():
    // go ahead
  case ModelUnavailable(:final reason) when reason.isTransient:
    showBanner(reason.explanation, action: reason.remedy);
  case ModelUnavailable():
    hideTheAiFeatureEntirely();
}
Implementers
Annotations

Properties

hashCode int
The hash code for this object.
no setterinherited
isAvailable bool
Whether generation can be attempted.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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