Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPGRD: icon size customizable via widget property #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 6 additions & 3 deletions lib/src/icon_toggle.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:flutter/material.dart';
import 'dart:math' as math;

Expand All @@ -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,
Expand All @@ -25,6 +25,7 @@ class IconToggle extends StatefulWidget {
final Color activeColor;
final Color inactiveColor;
final bool value;
final double size;
final ValueChanged<bool> onChanged;
final AnimatedSwitcherTransitionBuilder transitionBuilder;
final Duration duration;
Expand Down Expand Up @@ -88,9 +89,11 @@ class _IconToggleState extends State<IconToggle>
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<bool>(widget.value),
),
),
Expand Down