BackgroundEntrypoint class

A custom Dart entry point for the headless background engine. Needed for anything that must be plugged into the background isolate (a RoadSnapper): objects cannot cross isolates, so your own entry point builds them there.

@pragma('vm:entry-point')
Future<void> myBackgroundMain() => runFlutterGetBackgroundLoc(roadSnapper: MySnapper());

LocationConfig(backgroundEntrypoint: BackgroundEntrypoint(
    library: 'package:my_app/main.dart', function: 'myBackgroundMain'));

Constructors

BackgroundEntrypoint({required String library, required String function})
Creates a BackgroundEntrypoint.
const

Properties

function → String
Name of the top-level function annotated with @pragma('vm:entry-point').
final
hashCode → int
The hash code for this object.
no setterinherited
library → String
Library URI, e.g. package:my_app/main.dart.
final
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
toMap() → Map<String, dynamic>
Serializes this BackgroundEntrypoint to a JSON-friendly map (the format sent to the native side and stored).
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromMap(Object? m) → BackgroundEntrypoint?
Builds an entry point from a map; null for null or malformed input.