Skip to content

Commit

Permalink
Update zoombuttons_plugin_option.dart (#779)
Browse files Browse the repository at this point in the history
Added the color change of the icons, through the options.
  • Loading branch information
Shynjy committed Jan 29, 2021
1 parent 9d98fda commit 739f956
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions example/lib/pages/zoombuttons_plugin_option.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class ZoomButtonsPluginOption extends LayerOptions {
final double padding;
final Alignment alignment;
final Color zoomInColor;
final Color zoomInColorIcon;
final Color zoomOutColor;
final Color zoomOutColorIcon;
final IconData zoomInIcon;
final IconData zoomOutIcon;

Expand All @@ -21,8 +23,10 @@ class ZoomButtonsPluginOption extends LayerOptions {
this.padding = 2.0,
this.alignment = Alignment.topRight,
this.zoomInColor,
this.zoomInColorIcon,
this.zoomInIcon = Icons.zoom_in,
this.zoomOutColor,
this.zoomOutColorIcon,
this.zoomOutIcon = Icons.zoom_out,
rebuild,
}) : super(key: key, rebuild: rebuild);
Expand Down Expand Up @@ -81,7 +85,8 @@ class ZoomButtons extends StatelessWidget {
map.move(centerZoom.center, zoom);
}
},
child: Icon(zoomButtonsOpts.zoomInIcon),
child: Icon(zoomButtonsOpts.zoomInIcon,
color: zoomButtonsOpts.zoomInColorIcon ?? IconTheme.of(context).color),
),
),
Padding(
Expand All @@ -101,7 +106,8 @@ class ZoomButtons extends StatelessWidget {
map.move(centerZoom.center, zoom);
}
},
child: Icon(zoomButtonsOpts.zoomOutIcon),
child: Icon(zoomButtonsOpts.zoomOutIcon,
color: zoomButtonsOpts.zoomOutColorIcon ?? IconTheme.of(context).color ),
),
),
],
Expand Down

0 comments on commit 739f956

Please sign in to comment.