LocationButtonClickResult
Result of a location button click operation.
This class provides information about the result of clicking the current location button, allowing clients to display custom messages or handle the result appropriately.
@param success Whether the location was successfully obtained and the map was centered @param location The location that was used to center the map (null if operation failed) @param error Error message if the operation failed (null if operation succeeded)
Example:
await LazarilloMapsPlatform.instance.setOnLocationButtonClickListener(
mapId,
(result) {
if (result.success) {
print('Map centered on: ${result.location?.latitude}, ${result.location?.longitude}');
} else {
print('Error: ${result.error}');
}
},
);Constructors
LocationButtonClickResult.new
LocationButtonClickResult.new({required bool success, LzLocation? location, String? error})const
LocationButtonClickResult.fromJson
LocationButtonClickResult.fromJson(Map<Object?, Object?> json)factory
Properties
| Property | Type | Description |
|---|---|---|
error | String? | Error message if the operation failed (null if operation succeeded) (final) |
location | LzLocation? | The location that was used to center the map (null if operation failed) (final) |
success | bool | Whether the location was successfully obtained and the map was centered (final) |
Methods
toJson
toJson() → Map<Object?, Object?>Last updated on