selectable_icon 1.0.2 selectable_icon: ^1.0.2 copied to clipboard
A flutter package that will allow you to create a selectable icon with multiple customizations.
Selectable Box #
Use SelectableIcon
to create a selectable box in your flutter app, SelectableIcon
comes with a lot of customization options mentioned below.
Convert any widget into a selectable box.
Installation #
Add selectable_icon: ^1.0.2
in your project's pubspec.yaml:
dependencies:
selectable_icon: ^1.0.2
Usage #
Import selectable_icon
in your dart file:
import 'package:selectable_icon/selectable_icon.dart';
Then use SelectableIcon
in your widget tree:
bool isSelected = false;
int count = 0;
SelectableIcon(
onTap: () {
setState(() {
isSelected = !isSelected;
if (isSelected) {
count++;
} else {
count--;
}
});
},
isSelected: isSelected,
selectedIcon: Icons.thumb_up,
unSelectedIcon: Icons.thumb_up,
size: 70,
selectedColor: Colors.blue,
unSelectedColor: Colors.grey,
count: count,
showCount: true,
animationDuration: const Duration(milliseconds: 500),
padding: const EdgeInsets.all(10),
),