GameOrError<G extends Game<Event> > class
Represents the union type of a game or an error, along with some helper getters to work with them
Constructors
- GameOrError.error(String message, PlayerID person)
-
Represets an error
constfactory
-
GameOrError.fromJson(Map<
String, dynamic> json) -
factory
-
GameOrError.game(@GameConverter<
Game< () G game)Event> > -
Represents a game
constfactory
Properties
-
error
→ GameError<
Game< ?Event> > -
Returns the error or null
no setter
- errorString → String
-
Returns the error message or 'No Error'
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isError → bool
-
Returns whether this instance is an error
no setter
- isGame → bool
-
Returns whether this instance is a game
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → G?
-
Returns the game value or null
no setter
Methods
-
map<
TResult extends Object?> ({required TResult game(GameValue< Game< value), required TResult error(GameError<Event> >Game< value)}) → TResultEvent> > -
inherited
-
mapOrNull<
TResult extends Object?> ({TResult game(GameValue< Game< value)?, TResult error(GameError<Event> >Game< value)?}) → TResult?Event> > -
inherited
-
maybeMap<
TResult extends Object?> ({TResult game(GameValue< Game< value)?, TResult error(GameError<Event> >Game< value)?, required TResult orElse()}) → TResultEvent> > -
inherited
-
maybeWhen<
TResult extends Object?> ({TResult game(Game< Event> game)?, TResult error(String message, String person)?, required TResult orElse()}) → TResult -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> ({required TResult game(Game< Event> game), required TResult error(String message, String person)}) → TResult -
inherited
-
whenOrNull<
TResult extends Object?> ({TResult game(Game< Event> game)?, TResult error(String message, String person)?}) → TResult? -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited