direction property

Axis direction
final

Arranges the legend items in either horizontal or vertical direction.

Defaults to horizontal, if the position is top, bottom or null. Defaults to vertical, if the position is left or right.

 @override
 Widget build(BuildContext context) {
   return SfMaps(
     layers: [
       MapShapeLayer(
         showLegend: true,
         legendSettings: MapLegendSettings(
             direction: Axis.horizontal
         ),
         delegate: MapShapeLayerDelegate(
             shapeFile: "assets/world_map.json",
             shapeDataField: "continent",
             dataCount: bubbleData.length,
             primaryValueMapper: (index) {
               return bubbleData[index].country;
             }),
       )
     ],
   );
 }

See also:

  • position, to set the position of the legend.

Implementation

final Axis direction