RichAttributionWidget constructor
- Key? key,
- required List<
SourceAttribution> attributions, - AttributionAlignment alignment = AttributionAlignment.bottomRight,
- Widget openButton(
- BuildContext context,
- VoidCallback open
- Widget closeButton(
- BuildContext context,
- VoidCallback close
- Color? popupBackgroundColor,
- BorderRadius? popupBorderRadius,
- double permanentHeight = 24,
- bool showFlutterMapAttribution = true,
- RichAttributionWidgetAnimation animationConfig = const FadeRAWA(),
- Duration popupInitialDisplayDuration = Duration.zero,
A prebuilt dynamic attribution layer that supports both logos and text through SourceAttributions
TextSourceAttributions are shown in a popup box that can be visible or
invisible. Its state is toggled by a tri-state openButton
/closeButton
:
- Not hovered, not opened: faded button, invisible box
- Hovered, not opened: full opacity button, invisible box
- Opened: full opacity button, visible box
The hover state on mobile devices is unspecified, but the behaviour is usually inconsequential on mobile devices anyway, due to the fingertip covering the entire button.
LogoSourceAttributions are shown adjacent to the open/close button, to comply with some stricter tile server requirements (such as Mapbox). These are usually supplemented with a TextSourceAttribution.
The popup box also closes automatically on any interaction with the map.
Animations are built in by default, and configured/handled through
RichAttributionWidgetAnimation - see that class and the animationConfig
property for more information. By default, a simple fade/opacity animation
is provided by FadeRAWA. ScaleRAWA is also available.
Read the documentation on the individual properties for more information and customizability.
Implementation
const RichAttributionWidget({
super.key,
required this.attributions,
this.alignment = AttributionAlignment.bottomRight,
this.openButton,
this.closeButton,
this.popupBackgroundColor,
this.popupBorderRadius,
this.permanentHeight = 24,
this.showFlutterMapAttribution = true,
this.animationConfig = const FadeRAWA(),
this.popupInitialDisplayDuration = Duration.zero,
});