From d9d6264a6d4e4e448e4c1975d411ba4aeb50a102 Mon Sep 17 00:00:00 2001 From: Daniel Leiszen Date: Fri, 26 Feb 2021 15:44:15 +0100 Subject: [PATCH] UPGRD: icon size customizable via widget property --- example/ios/Flutter/flutter_export_environment.sh | 9 ++++++--- lib/src/icon_toggle.dart | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh index e5b6c73..49ace54 100644 --- a/example/ios/Flutter/flutter_export_environment.sh +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -1,10 +1,13 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=D:\develop\flutter" -export "FLUTTER_APPLICATION_PATH=D:\Code\flutter-icons\example" +export "FLUTTER_ROOT=C:\flutter" +export "FLUTTER_APPLICATION_PATH=C:\Projects\Externals\flutter-icons\example" export "FLUTTER_TARGET=lib\main.dart" export "FLUTTER_BUILD_DIR=build" export "SYMROOT=${SOURCE_ROOT}/../build\ios" -export "FLUTTER_FRAMEWORK_DIR=D:\develop\flutter\bin\cache\artifacts\engine\ios" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=false" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.packages" diff --git a/lib/src/icon_toggle.dart b/lib/src/icon_toggle.dart index f051102..592cd1c 100644 --- a/lib/src/icon_toggle.dart +++ b/lib/src/icon_toggle.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'dart:math' as math; @@ -16,6 +15,7 @@ class IconToggle extends StatefulWidget { this.inactiveColor = Colors.grey, this.value = false, this.onChanged, + this.size = 22, this.transitionBuilder = _defaultTransitionBuilder, this.duration = const Duration(milliseconds: 100), this.reverseDuration, @@ -25,6 +25,7 @@ class IconToggle extends StatefulWidget { final Color activeColor; final Color inactiveColor; final bool value; + final double size; final ValueChanged onChanged; final AnimatedSwitcherTransitionBuilder transitionBuilder; final Duration duration; @@ -88,9 +89,11 @@ class _IconToggleState extends State reverseDuration: widget.reverseDuration, transitionBuilder: widget.transitionBuilder, child: Icon( - widget.value ? widget.selectedIconData : widget.unselectedIconData, + widget.value + ? widget.selectedIconData + : widget.unselectedIconData, color: widget.value ? widget.activeColor : widget.inactiveColor, - size: 22, + size: widget.size, key: ValueKey(widget.value), ), ),