Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/src/widgets/static_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ class StaticMap extends StatelessWidget {
/// pixel ratio
final bool scaleToDevicePixelRatio;

/// The loadingBuilder is used to show a loading widget while the image is being loaded.
/// It is called with the context, the image widget, and the ImageChunkEvent.
/// The image widget is passed to the loadingBuilder so that you can customize
final Widget Function(BuildContext, Widget, ImageChunkEvent?)? loadingBuilder;

const StaticMap({
Key? key,
required this.googleApiKey,
Expand All @@ -101,6 +106,7 @@ class StaticMap extends StatelessWidget {
this.signature,
this.styles,
this.scaleToDevicePixelRatio = true,
this.loadingBuilder,
}) : super(key: key);

@override
Expand Down Expand Up @@ -143,6 +149,7 @@ class StaticMap extends StatelessWidget {
width: width,
height: height,
fit: BoxFit.contain,
loadingBuilder: loadingBuilder,
);
},
),
Expand Down