network<T extends Object> static method
- String url, {
- Client? client,
- Map<
String, String> ? headers, - required Widget builder(
- FeatureCollectionProperties<
T> featureCollectionProperties, - Map<
String, dynamic> ? map
- FeatureCollectionProperties<
- required FeatureCollectionProperties<
T> featureCollectionProperties, - bool polygonCulling = false,
- MapController? mapController,
- Future<
String> networkLoadBuilder()?, - Key? key,
- PowerMarkerClusterOptions? powerClusterOptions,
Fetches GeoJSON feature collections from a network source and returns a Widget to display them.
url: The URL of the network resource containing the GeoJSON data.client: An optional HTTP client to use for the network request.headers: Optional HTTP headers to include in the request.builder: A function that takes thefeatureCollectionPropertiesand a map of feature properties and returns a Widget to render the features.featureCollectionProperties: Properties to customize the appearance of the feature collections.polylineCulling: A boolean indicating whether polyline culling is enabled (default is false).polygonCulling: A boolean indicating whether polygon culling is enabled (default is false).mapController: An optional MapController for controlling the map view.networkLoadBuilder: A function that loads data from the network resource and returns it as a string.key: An optional Key for identifying the returned Widget.
Returns a Widget displaying the fetched GeoJSON feature collections.
Implementation
static Widget network<T extends Object>(
String url, {
Client? client,
Map<String, String>? headers,
required Widget Function(
FeatureCollectionProperties<T> featureCollectionProperties,
Map<String, dynamic>? map,
)
builder,
required FeatureCollectionProperties<T> featureCollectionProperties,
bool polygonCulling = false,
MapController? mapController,
Future<String> Function(Client? client, Uri uri, Map<String, String>? map)?
networkLoadBuilder,
Key? key,
PowerMarkerClusterOptions? powerClusterOptions,
}) {
Uri uri = url.toUri();
return EnhancedFutureBuilder<Widget>(
future: _networkFeatureCollections(
uri,
powerClusterOptions: powerClusterOptions,
headers: headers,
client: client,
featureCollectionProperties: featureCollectionProperties,
networkLoadBuilder: networkLoadBuilder ?? _defaultNetworkLoader,
builder: builder,
polygonCulling: polygonCulling,
mapController: mapController,
key: key,
),
rememberFutureResult: true,
whenDone: (Widget child) => child,
whenNotDone: const Center(child: CupertinoActivityIndicator()),
);
}