MapEvent<T> class

Generic Event coming from the native side of Maps.

All MapEvents contain the mapId that originated the event. This should never be null.

The <T> on this event represents the type of the value that is contained within the event.

This class is used as a base class for all the events that might be triggered from a Map, but it is never used directly as an event type.

Do NOT instantiate new events like MapEvent<ValueType>(mapId, val) directly, use a specific class instead:

Do class NewEvent extend MapEvent<ValueType> when creating your own events. See below for examples: CameraMoveStartedEvent, MarkerDragEndEvent... These events are more semantic and pleasant to use than raw generics. They can be (and in fact, are) filtered by the instanceof-operator.

(See MethodChannelGoogleMapsFlutter.onCameraMoveStarted, for example)

If your event needs a position, alongside the value, do extends _PositionedMapEvent<ValueType> instead. This adds a LatLng position attribute.

If your event only needs a position, do extend _PositionedMapEvent<void> do NOT extend MapEvent<LatLng>. The former lets consumers of these events to access the .position property, rather than the more generic .value yielded from the latter.

Implementers

Constructors

MapEvent(int mapId, T value)
Build a Map Event, that relates a mapId with a given value.

Properties

hashCode int
The hash code for this object.
no setterinherited
mapId int
The ID of the Map this event is associated to.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The value wrapped by this event
final

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