game_scaffold library

Classes

AlwaysAliveRefreshable<T>
An interface for provider expressions that can be passed to ref.refresh
AsyncData<T>
Creates an AsyncValue with a data.
AsyncError<T>
Creates an AsyncValue in the error state.
AsyncLoading<T>
Creates an AsyncValue in loading state.
AsyncNotifier<State>
A Notifier implementation that is asynchronously initialized.
AsyncNotifierProviderElement<NotifierT extends AsyncNotifierBase<T>, T>
The element of AsyncNotifierProvider.
AsyncNotifierProviderElementBase<NotifierT extends AsyncNotifierBase<T>, T>
The element of AsyncNotifierProvider.
AsyncNotifierProviderFamily<NotifierT extends FamilyAsyncNotifier<T, Arg>, T, Arg>
The Family of AsyncNotifierProvider.
AsyncNotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
AsyncValue<T>
A utility for safely manipulating asynchronous data.
AutoDisposeAsyncNotifier<State>
A provider which creates and listen to an AsyncNotifier.
AutoDisposeAsyncNotifierProviderElement<NotifierT extends AsyncNotifierBase<T>, T>
The element of AutoDisposeAsyncNotifierProvider.
AutoDisposeAsyncNotifierProviderFamily<NotifierT extends AutoDisposeFamilyAsyncNotifier<T, Arg>, T, Arg>
The Family of AsyncNotifierProvider.
AutoDisposeAsyncNotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeFamilyAsyncNotifier<State, Arg>
A provider which creates and listen to an AsyncNotifier.
AutoDisposeFamilyNotifier<State, Arg>
A class which exposes a state that can change over time.
AutoDisposeFamilyStreamNotifier<State, Arg>
A variant of AsyncNotifier which has build creating a Stream.
AutoDisposeFutureProvider<T>
A provider that asynchronously creates a value.
AutoDisposeFutureProviderElement<T>
The ProviderElementBase of AutoDisposeFutureProvider
AutoDisposeFutureProviderFamily<R, Arg>
The Family of an AutoDisposeFutureProvider
AutoDisposeFutureProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeNotifier<State>
A class which exposes a state that can change over time.
AutoDisposeNotifierProviderElement<NotifierT extends NotifierBase<T>, T>
The element of AutoDisposeNotifierProvider
AutoDisposeNotifierProviderFamily<NotifierT extends AutoDisposeFamilyNotifier<T, Arg>, T, Arg>
The Family of NotifierProvider.
AutoDisposeNotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeProvider<T>
A provider that exposes a read-only value.
AutoDisposeProviderElement<T>
The element of AutoDisposeProvider
AutoDisposeProviderFamily<R, Arg>
The Family of AutoDisposeProvider
AutoDisposeProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeRef<State>
A Ref for providers that are automatically destroyed when no longer used.
AutoDisposeStateNotifierProvider<NotifierT extends StateNotifier<T>, T>
Creates a StateNotifier and exposes its current state.
AutoDisposeStateNotifierProviderElement<NotifierT extends StateNotifier<T>, T>
The element of AutoDisposeStateNotifierProvider.
AutoDisposeStateNotifierProviderFamily<NotifierT extends StateNotifier<T>, T, Arg>
The Family of AutoDisposeStateNotifierProvider.
AutoDisposeStateNotifierProviderRef<NotifierT extends StateNotifier<T>, T>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStateProvider<T>
A provider that exposes a value that can be modified from outside.
AutoDisposeStateProviderElement<T>
The element of StateProvider.
AutoDisposeStateProviderFamily<R, Arg>
The Family of StateProvider.
AutoDisposeStateProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStreamNotifier<State>
A variant of AsyncNotifier which has build creating a Stream.
AutoDisposeStreamNotifierProviderElement<NotifierT extends AsyncNotifierBase<T>, T>
The element of AutoDisposeStreamNotifierProvider.
AutoDisposeStreamNotifierProviderFamily<NotifierT extends AutoDisposeFamilyStreamNotifier<T, Arg>, T, Arg>
The Family of StreamNotifierProvider.
AutoDisposeStreamNotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStreamProvider<T>
Creates a stream and exposes its latest event.
AutoDisposeStreamProviderElement<T>
The element of AutoDisposeStreamProvider.
AutoDisposeStreamProviderFamily<R, Arg>
The Family of AutoDisposeStreamProvider.
AutoDisposeStreamProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
BackendProviders
CanBeEmpty
Your own classes can implement this so they may use CanBeEmptyExtension.
ConfigList
  • If isDeepEquals is false, the IList equals operator (==) compares by identity.
  • If isDeepEquals is true (the default), the IList equals operator (==) compares all items, ordered.
  • If cacheHashCode is true (the default), the IList will only calculate the hashCode once, when it is asked — initially, internally null. Otherwise, it will always recalculate it.
  • ConfigMap
  • If isDeepEquals is false, the IMap equals operator (==) compares by identity.
  • If isDeepEquals is true (the default), the IMap equals operator (==) compares all entries, ordered.
  • If sort is true, will sort the list output of keys. Otherwise, it will keep the insertion order (the default).
  • If cacheHashCode is true (the default), the IMap will only calculate the hashCode once, when it is asked — initially, internally null. Otherwise, it will always recalculate it.
  • ConfigMapOfSets
  • If isDeepEquals is false, the IMap equals operator (==) compares by identity.
  • If isDeepEquals is true (the default), the IMap equals operator (==) compares all entries, ordered.
  • If sortKeys is true, will sort the list output of keys. Otherwise, it will keep the insertion order (the default).
  • If cacheHashCode is true (the default), the IMapOfSets will only calculate the hashCode once, when it is asked — initially, internally null. Otherwise, it will always recalculate it.
  • ConfigSet
    The set configuration.
    DiffAndIntersectResult<T, G>
    Entry<K, V>
    Similar to a MapEntry, but correctly implements equals (== comparing key and value), hashcode and Comparable.compareTo.
    Event
    Family<@Deprecated('The generic parameter will be removed in version 3.0.0. ' 'This is to enable riverpod_generator to implement families with generic parameters') State>
    A base class for all families
    FamilyAsyncNotifier<State, Arg>
    A Notifier implementation that is asynchronously initialized.
    FamilyNotifier<State, Arg>
    A class which exposes a state that can change over time.
    FamilyStreamNotifier<State, Arg>
    A variant of AsyncNotifier which has build creating a Stream.
    FutureProvider<T>
    A provider that asynchronously creates a value.
    FutureProviderElement<T>
    The element of a FutureProvider
    FutureProviderFamily<R, Arg>
    The Family of a FutureProvider
    FutureProviderRef<State>
    An object used by providers to interact with other providers and the life-cycles of the application.
    Game
    GameClientInfo
    GameConfig
    Some general config parameters for a game of gameType
    GameError
    GameErrorNotifier
    A error notifier that lets the client clear the error
    GameFunctions<E extends Event, T extends Game>
    GameFunctionsGeneric
    GameInfo
    An object to provide info about a particular game to the client
    GameNavigator
    GameProviders
    GameRegistry
    GameService
    A Client that can contact the server to manage games
    GameState<E extends Event, T extends Game>
    GameStateNotifier
    A StateNotifier that handles events for a particular game, delegating to the game's implementation for non generic events
    GenericEvent
    A GenericEvent that is handled by the Generic server implementation rather than handling it differently in each game implementation
    GenericGame
    Represents a generic game, with common fields that can be manipulated by common GenericEvents
    IList<T>
    An immutable list. Note: The replace method is the equivalent of operator []= for the IList.
    IListConst<T>
    This is an IList which can be made constant. Note: Don't ever use it without the "const" keyword, because it will be unsafe.
    IListOf2<T>
    An immutable list of only 2 items.
    IListOf3<T>
    An immutable list of only 3 items.
    IListOf4<T>
    An immutable list of only 4 items.
    IMap<K, V>
    An immutable, unordered map.
    IMapConst<K, V>
    This is an IMap which can be made constant. Note: Don't ever use it without the "const" keyword, because it will be unsafe.
    IMapOfSets<K, V>
    An immutable, unordered, map of sets.
    IMapOfSetsConst<K, V>
    ImmutableCollection<C>
    ISet<T>
    An immutable, ordered set. It can be configured to order by insertion order, or sort.
    ISetConst<T>
    This is an ISet which can be made constant. Note: Don't ever use it without the "const" keyword, because it will be unsafe.
    A object which maintains a provider alive.
    ListMap<K, V>
    A ListMap is a mutable, fixed-sized, and ordered map.
    ListMapView<K, V>
    A ListMapView lets you view a regular map as if it was a ListMap. At the moment this class is for FIC's internal use only, since a lot of its methods will throw UnsupportedError.
    ListSet<T>
    A ListSet is, at the same time:
    ListSetView<T>
    Lobby
    LobbyNotifier
    LocalGame
    Keeps track of some metadata about a game for an OnDeviceService game
    MapEntryEquality<E>
    This works for any object, not only map entries, but MapEntry gets special treatment. We consider two map-entries equal when their respective key and values are equal.
    MaybeError<T>
    ModifiableListFromIList<T>
    The ModifiableListFromIList is a safe, modifiable List that is built from an IList. The construction of the list is fast at first, since it makes no copies of the IList items, but just uses it directly.
    ModifiableMapFromIMap<K, V>
    The ModifiableMapFromIMap is a safe, modifiable Map that is built from an IMap. The construction of the map is fast at first, since it makes no copies of the IMap items, but just uses it directly.
    ModifiableSetFromISet<T>
    The ModifiableSetFromISet is a safe, modifiable Set that is built from an ISet. The construction of the set is fast at first, since it makes no copies of the ISet items, but just uses it directly.
    MultiplayerGameClient
    MultiplayerRoundClient
    MultiPlayerWidget
    NextStateOrError<E extends Event, T extends Game>
    Notifier<State>
    A class which exposes a state that can change over time.
    NotifierProviderElement<NotifierT extends NotifierBase<T>, T>
    The element of NotifierProvider.
    NotifierProviderFamily<NotifierT extends FamilyNotifier<T, Arg>, T, Arg>
    The Family of NotifierProvider.
    NotifierProviderRef<T>
    An object used by providers to interact with other providers and the life-cycles of the application.
    OnDeviceGameService
    An on device implementation of GameService
    OnDeviceRoundService
    An implementation of a RoundService for a local game on device with no server connection
    Output<T>
    Meant to be used when you wish to save a value that's going to be tossed out of an immutable collection.
    Override
    An object used by ProviderContainer/ProviderScope to override the behavior of a provider/family for part of the application.
    Player
    Represents the basic details of a player in a game
    PlayerEvent<E extends Event>
    Provider<State>
    A provider that exposes a read-only value.
    ProviderBase<StateT>
    A base class for all providers.
    ProviderContainer
    An object that stores the state of the providers and allows overriding the behavior of a specific provider.
    ProviderElement<State>
    A provider that exposes a read-only value.
    ProviderElementBase<StateT>
    An internal class that handles the state of a provider.
    ProviderFamily<R, Arg>
    The Family of Provider
    ProviderListenableOrFamily
    A shared interface between ProviderListenable and Family.
    ProviderObserver
    An object that listens to the changes of a ProviderContainer.
    ProviderOrFamily
    A common interface shared by ProviderBase and Family
    ProviderRef<State>
    An object used by providers to interact with other providers and the life-cycles of the application.
    ProviderSubscription<State>
    Represents the subscription to a ProviderListenable
    Ref<State extends Object?>
    An object used by providers to interact with other providers and the life-cycles of the application.
    Refreshable<T>
    An interface for provider expressions that can be passed to ref.refresh
    ReversedListView<T>
    Returns a List of the objects in this list in reverse order. Very efficient since it returns a view, which means if you change the original list this one will also change, and vice-versa.
    RoundInfo
    RoundService
    A client for a particular game
    StateController<T>
    A StateNotifier that allows modifying its state from outside.
    StateNotifier<T>
    An observable class that stores a single immutable state.
    StateNotifierProvider<NotifierT extends StateNotifier<T>, T>
    Creates a StateNotifier and exposes its current state.
    StateNotifierProviderElement<NotifierT extends StateNotifier<T>, T>
    The element of StateNotifierProvider.
    StateNotifierProviderFamily<NotifierT extends StateNotifier<T>, T, Arg>
    The Family of StateNotifierProvider.
    StateNotifierProviderRef<NotifierT extends StateNotifier<T>, T>
    An object used by providers to interact with other providers and the life-cycles of the application.
    StateProvider<T>
    A provider that exposes a value that can be modified from outside.
    StateProviderElement<T>
    The element of StateProvider.
    StateProviderFamily<R, Arg>
    The Family of StateProvider.
    StateProviderRef<State>
    An object used by providers to interact with other providers and the life-cycles of the application.
    StreamNotifier<State>
    A variant of AsyncNotifier which has build creating a Stream.
    StreamNotifierProviderElement<NotifierT extends AsyncNotifierBase<T>, T>
    The element of StreamNotifierProvider.
    StreamNotifierProviderFamily<NotifierT extends FamilyStreamNotifier<T, Arg>, T, Arg>
    The Family of StreamNotifierProvider.
    StreamNotifierProviderRef<T>
    An object used by providers to interact with other providers and the life-cycles of the application.
    StreamProvider<T>
    Creates a stream and exposes its latest event.
    StreamProviderElement<T>
    The element of StreamProvider.
    StreamProviderFamily<R, Arg>
    The Family of StreamProvider.
    StreamProviderRef<State>
    An object used by providers to interact with other providers and the life-cycles of the application.
    Tuple
    Dedicated Indexation Zip
    Tuple2<T1, T2>
    Resulting composition of multiple sources like indexes or other Iterables. Adapted from Tuple package
    UnmodifiableListFromIList<T>
    The UnmodifiableListFromIList is a relatively safe, unmodifiable List view that is built from an IList or another List. The construction of the UnmodifiableListFromIList is very fast, since it makes no copies of the given list items, but just uses it directly.
    UnmodifiableMapFromIMap<K, V>
    The UnmodifiableMapFromIMap is a relatively safe, unmodifiable Map that is built from an IMap or another Map. The construction of the UnmodifiableMapFromIMap is very fast, since it makes no copies of the given map items, but just uses it directly.
    UnmodifiableSetFromISet<T>
    The UnmodifiableSetFromISet is a relatively safe, unmodifiable Set view that is built from an ISet or another Set. The construction of the UnmodifiableSetFromISet is very fast, since it makes no copies of the given set items, but just uses it directly.

    Enums

    GameStatus
    Represents the current status of the game as seen by the client
    NameSet
    Represents a set of names that can be randomly assigned to players

    Mixins

    AlwaysAliveProviderBase<State>
    A base class for providers that never dispose themselves.
    AlwaysAliveProviderListenable<State>
    A base class for all providers, used to consume a provider.
    FromIListMixin<T, I extends FromIListMixin<T, I>>
    This mixin implements all IList methods (without config (ConfigList)), plus operator [], but it does NOT implement Iterable nor IList.
    FromISetMixin<T, I extends FromISetMixin<T, I>>
    This mixin implements all ISet members (without config), but it does NOT implement Iterable nor ISet.
    FromIterableIListMixin<T>
    This mixin implements all Iterable methods, plus operator [], but it does NOT implement Iterable nor IList.
    FromIterableISetMixin<T>
    This mixin implements all Iterable methods, but it does NOT implement Iterable nor ISet.
    OverrideWithValueMixin<State>
    A mixin to add overrideWithValue capability to a provider.
    ProviderListenable<State>
    A base class for all providers, used to consume a provider.

    Constants

    defaultGamePort → const int
    The default port
    OnDeviceService → const String
    Location that corresponds to running the game on-device

    Properties

    allServiceTypes StateProvider<List<ServiceType>>
    final
    apps List<GlobalKey<State<StatefulWidget>>>
    final
    defaultAddress Uri
    The default address to determine if the address has been set
    final
    gameClientProvider Provider<MultiplayerGameClient>
    final
    gameInfoProvider Provider<GameClientInfo>
    final
    gameService Provider<GameService>
    final
    gameServiceFamily ProviderFamily<GameService, ServiceType>
    Provides the GameService for each service id
    final
    homeDir String
    Gets the home path based on the operating system, should only be used in server contexts
    no setter
    isDesktop bool
    final
    isMobile bool
    final
    multiplayerGameClientProvider StateNotifierProviderFamily<MultiplayerGameClient, GameClientInfo, PlayerID>
    final
    multiplayerOverride bool
    getter/setter pair
    multiplayerRoundClientProvider StateNotifierProviderFamily<MultiplayerRoundClient, RoundInfo, PlayerID>
    final
    multiplayerTest bool
    no setter
    nameSets Map<NameSet, List<PlayerName>>
    The sets of approved names for random assignment
    final
    final
    onDeviceGameService Provider<GameService>
    final
    onDeviceRoundService Provider<RoundService>
    final
    playerIDProvider Provider<PlayerID>
    Provides the player id for a particular section of the widget tree
    final
    remoteUriProvider StateProvider<GameAddress>
    The provider that controls which game server address to connect to
    final
    roundClientProvider Provider<MultiplayerRoundClient>
    final
    roundInfoProvider Provider<RoundInfo>
    final
    roundService Provider<RoundService>
    final
    roundServiceFamily ProviderFamily<RoundService, ServiceType>
    Provides a RoundService for the service with the specified id
    final
    serviceType StateProvider<ServiceType>
    The provider that controls the RoundService and GameService implementation to use
    final
    singleConfig StateProvider<GameConfig>
    Allows one config to write all players' configs
    final

    Functions

    areImmutableCollectionsWithEqualItems(ImmutableCollection? c1, ImmutableCollection? c2) bool
    Will return true only if the collections are of the same type, and their items are equal by calling the collection's equalItems method. This may be slow for very large collection, since it compares each item, one by one. Note this will not compare the collection configuration.
    areSameImmutableCollection(ImmutableCollection? c1, ImmutableCollection? c2) bool
    While identical(collection1, collection2) will compare the collections by identity, areSameImmutableCollection(collection1, collection2) will compare them by type, and then by their internal state. Note this is practically as fast as identical, but will give less false negatives. So it is almost always recommended to use areSameImmutableCollection instead of identical.
    combineIterables<A, B, R>(Iterable<A> a, Iterable<B> b, R combine(A, B), {bool allowDifferentSizes = false}) Iterable<R>
    Combines iterables a and b into one, by applying the combine function. If allowDifferentSizes is true, it will stop as soon as one of the iterables has no more values. If allowDifferentSizes is false, it will throw an error if the iterables have different length.
    compareObject<T extends Object>(Object? a, Object? b, {bool nullsBefore = false}) int
    The compareObject comparator is similar to the natural comparator provided by Comparable objects in their Comparable.compareTo method, to sort objects in their "natural order". The difference here is that compareObject is also able to compare some objects which are not Comparable, such as bool, MapEntry, Enum, and nulls.
    describeIdentity(Object? object) String
    Returns a summary of the runtime type and hash code of object.
    generateGameID(List<String> avoidList) GameCode
    shortHash(Object? object) String
    Object.hashCode's 20 least-significant bits.
    sortBy<T>(Predicate<T> test, {int then(T, T)?}) int Function(T, T)
    The sortBy function can be used to create a comparator to sort collections, comparing a and b such that:
    sortLike<T, E>(Iterable<E> order, {E mapper(T)?, int then(T, T)?}) int Function(T, T)
    The sortLike function can be used to create a comparator to sort collections, comparing a and b such that:

    Typedefs

    AsyncNotifierFamilyProvider<NotifierT extends FamilyAsyncNotifier<T, Arg>, T, Arg> = FamilyAsyncNotifierProviderImpl<NotifierT, T, Arg>
    A provider which creates and listen to an AsyncNotifier.
    AsyncNotifierProvider<NotifierT extends AsyncNotifier<T>, T> = AsyncNotifierProviderImpl<NotifierT, T>
    A provider which creates and listen to an AsyncNotifier.
    AutoDisposeAsyncNotifierProvider<NotifierT extends AutoDisposeAsyncNotifier<T>, T> = AutoDisposeAsyncNotifierProviderImpl<NotifierT, T>
    A provider which creates and listen to an AsyncNotifier.
    AutoDisposeFamilyAsyncNotifierProvider<NotifierT extends AutoDisposeFamilyAsyncNotifier<T, Arg>, T, Arg> = AutoDisposeFamilyAsyncNotifierProviderImpl<NotifierT, T, Arg>
    A provider which creates and listen to an AsyncNotifier.
    AutoDisposeFamilyNotifierProvider<NotifierT extends AutoDisposeFamilyNotifier<T, Arg>, T, Arg> = AutoDisposeFamilyNotifierProviderImpl<NotifierT, T, Arg>
    A Provider which exposes a Notifier and listens to it.
    AutoDisposeFamilyStreamNotifierProvider<NotifierT extends AutoDisposeFamilyStreamNotifier<T, Arg>, T, Arg> = AutoDisposeFamilyStreamNotifierProviderImpl<NotifierT, T, Arg>
    AutoDisposeNotifierProvider<NotifierT extends AutoDisposeNotifier<T>, T> = AutoDisposeNotifierProviderImpl<NotifierT, T>
    A Provider which exposes a Notifier and listens to it.
    AutoDisposeStreamNotifierProvider<NotifierT extends AutoDisposeStreamNotifier<T>, T> = AutoDisposeStreamNotifierProviderImpl<NotifierT, T>
    EQ<T, U> = bool Function(T item, U other)
    ErrorListener = void Function(Object error, StackTrace? stackTrace)
    A callback that can be passed to StateNotifier.onError.
    GameAddress = Uri
    GameCode = String
    GameName = String
    GameType = String
    JsonMap = Map<String, Object?>
    Locator = T Function<T>()
    A function that allows obtaining other objects.
    NextState<E extends Event, T extends Game> = MaybeError<GameState<E, T>>
    NotifierFamilyProvider<NotifierT extends FamilyNotifier<T, Arg>, T, Arg> = FamilyNotifierProviderImpl<NotifierT, T, Arg>
    The provider for NotifierProviderFamily.
    NotifierProvider<NotifierT extends Notifier<T>, T> = NotifierProviderImpl<NotifierT, T>
    A Provider which exposes a Notifier and listens to it.
    Op<T> = T Function(T element)
    Operation of type that conserve the original type
    PlayerID = String
    PlayerIndex = int
    PlayerName = String
    Predicate<T> = bool Function(T element)
    RemoveListener = void Function()
    A callback that can be used to remove a listener added with StateNotifier.addListener.
    Rewards = List<double>
    ServiceType = String
    StreamNotifierFamilyProvider<NotifierT extends FamilyStreamNotifier<T, Arg>, T, Arg> = FamilyStreamNotifierProviderImpl<NotifierT, T, Arg>
    A variant of AsyncNotifier which has build creating a Stream.
    StreamNotifierProvider<NotifierT extends StreamNotifier<T>, T> = StreamNotifierProviderImpl<NotifierT, T>
    A variant of AsyncNotifier which has build creating a Stream.

    Exceptions / Errors

    CircularDependencyError
    An error thrown when a call to Ref.read/Ref.watch leads to a provider depending on itself.
    DependencyNotFoundException<T>
    Thrown when tried to call LocatorMixin.read<T>(), but the T was not found.s
    StateNotifierListenerError
    An error thrown when trying to update the state of a StateNotifier, but at least one of the listeners threw.