RichAttributionWidget class

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 :

  1. Not hovered, not opened: faded button, invisible box
  2. Hovered, not opened: full opacity button, invisible box
  3. 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.

See also:

Inheritance
Annotations

Constructors

RichAttributionWidget({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
const

Properties

alignment AttributionAlignment
The position in which to anchor this widget
final
animationConfig RichAttributionWidgetAnimation
Animation configuration, through the properties and handler/builder defined by a RichAttributionWidgetAnimation implementation
final
attributions List<SourceAttribution>
List of attributions to display
final
closeButton → (Widget Function(BuildContext context, VoidCallback close)?)
The widget (usually an IconButton) to display when the popup box is open, that closes the popup box via the close callback
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
openButton → (Widget Function(BuildContext context, VoidCallback open)?)
The widget (usually an IconButton) to display when the popup box is closed, that opens the popup box via the open callback
final
permanentHeight double
The height of the permanent row in which is found the popup menu toggle button
final
popupBackgroundColor Color?
The color to use as the popup box's background color, defaulting to the Themes background color
final
popupBorderRadius BorderRadius?
The radius of the edges of the popup box
final
popupInitialDisplayDuration Duration
If not Duration.zero (default), the popup box will be open by default and hidden this long after the map is initialised
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showFlutterMapAttribution bool
Whether to add an additional attribution logo and text for 'flutter_map'
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<RichAttributionWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited