direction property
Arranges the toolbar items in either horizontal or vertical direction.
Defaults to Axis.horizontal.
late MapZoomPanBehavior _zoomPanBehavior;
late MapShapeSource _mapSource;
@override
void initState() {
_mapSource = MapShapeSource.asset(
'assets/world_map.json',
shapeDataField: 'continent',
);
_zoomPanBehavior = MapZoomPanBehavior()
..zoomLevel = 4
..focalLatLng = MapLatLng(19.0759837, 72.8776559)
..toolbarSettings = MapToolbarSettings(
direction: Axis.vertical);
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Zoom pan'),
),
body: SfMaps(
layers: [
MapShapeLayer(
source: _mapSource,
zoomPanBehavior: _zoomPanBehavior,
),
],
),
);
}
Implementation
final Axis direction;