string static method
- String data, {
- required MarkerProperties markerProperties,
- MapController? mapController,
- Key? key,
- PowerMarkerClusterOptions? powerClusterOptions,
- Widget builder(
- BuildContext context,
- MarkerProperties markerProperties,
- Map<
String, dynamic> ? properties
Creates a widget that displays a marker on a map using data provided as a String.
The data parameter specifies the data as a String that will be used as the
marker icon.
The markerProperties parameter is required and contains properties for the marker,
such as position and rotation.
The mapController parameter allows you to specify a custom MapController to control
the map view. If not provided, the default MapController will be used.
The builder parameter is an optional callback function that allows you to customize
the marker widget's appearance. It takes a BuildContext, MarkerProperties, and a
map of extra data as arguments and should return a widget. If not provided, a default
marker widget will be used.
The key parameter is an optional key that can be used to uniquely identify this widget.
Example usage:
string(
'https://example.com/marker.png',
markerProperties: MarkerProperties(
position: LatLng(37.7749, -122.4194),
rotation: 45.0,
),
mapController: myMapController,
builder: (context, markerProperties, extraData) {
return Icon(Icons.location_on, color: Colors.orange);
},
)
In this example, the string widget will display a marker on the map using the
provided data as the marker icon, with custom properties, a custom builder
function, and a specified map controller.
Returns a widget that displays the marker on the map.
Implementation
static Widget string(
String data, {
required MarkerProperties markerProperties,
MapController? mapController,
Key? key,
PowerMarkerClusterOptions? powerClusterOptions,
Widget Function(
BuildContext context,
MarkerProperties markerProperties,
Map<String, dynamic>? properties,
)?
builder,
}) {
return _string(
data,
powerClusterOptions: powerClusterOptions,
markerProperties: markerProperties,
key: key,
builder: builder,
mapController: mapController,
);
}