loadingBuilder property Null safety

MapLoadingBuilder? loadingBuilder
final

A builder that specifies the widget to display to the user while the map is still loading.

late MapShapeSource _mapSource;

@override
void initState() {
  _mapSource = MapShapeSource.asset(
    "assets/world_map.json",
    shapeDataField: "continent",
  );

  super.initState();
}

@override
Widget build(BuildContext context) {
  return Scaffold(
     body: Padding(
       padding: EdgeInsets.all(15),
       child: SfMaps(
         layers: <MapLayer>[
           MapShapeLayer(
             source: _mapSource,
             loadingBuilder: (BuildContext context) {
               return Container(
                 height: 25,
                 width: 25,
                 child: const CircularProgressIndicator(
                   strokeWidth: 3,
                 ),
               );
             },
           ),
         ],
       ),
     ),
  );
}

Implementation

final MapLoadingBuilder? loadingBuilder;