Skip to content

Commit 9424c23

Browse files
committed
add ability to size IconToggle widget
flutter-studio/flutter-icons#43
1 parent 9d7d20c commit 9424c23

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/src/icon_toggle.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class IconToggle extends StatefulWidget {
1515
this.inactiveColor = Colors.grey,
1616
this.value = false,
1717
this.onChanged,
18+
this.size = 22,
1819
this.transitionBuilder = _defaultTransitionBuilder,
1920
this.duration = const Duration(milliseconds: 100),
2021
this.reverseDuration,
@@ -24,6 +25,7 @@ class IconToggle extends StatefulWidget {
2425
final Color activeColor;
2526
final Color inactiveColor;
2627
final bool value;
28+
final double size;
2729
final ValueChanged<bool>? onChanged;
2830
final AnimatedSwitcherTransitionBuilder transitionBuilder;
2931
final Duration duration;
@@ -87,7 +89,7 @@ class _IconToggleState extends State<IconToggle> with SingleTickerProviderStateM
8789
child: Icon(
8890
widget.value ? widget.selectedIconData : widget.unselectedIconData,
8991
color: widget.value ? widget.activeColor : widget.inactiveColor,
90-
size: 22,
92+
size: widget.size,
9193
key: ValueKey<bool>(widget.value),
9294
),
9395
),

0 commit comments

Comments
 (0)