Skip to content

Commit

Permalink
add: activeColor and inactiveColor property to bottom bar item
Browse files Browse the repository at this point in the history
  • Loading branch information
jagritjkh committed Mar 17, 2021
1 parent 92f033e commit e9ba680
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.0.3] - 2021-03-18

* add activeColor and inactiveColor property to bottom bar item

## [0.0.2] - 2021-03-17

* Migrate to null safety.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To use this package, add `animation_wrappers` as a [dependency in your pubspec.y
## Add dependency
```
dependencies:
animation_wrappers: ^0.0.1
animation_wrappers: ^0.0.3
```

## Import
Expand Down
20 changes: 16 additions & 4 deletions lib/AnimatedBottomNavigationBars/animated_text_bottom_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ class _AnimatedTextBottomBarState extends State<AnimatedTextBottomBar>
borderRadius: BorderRadius.all(Radius.circular(30))),
child: Row(
children: <Widget?>[
item.icon,
ImageIcon(
AssetImage(item.image!),
color: isSelected
? item.activeColor ?? Theme.of(context).primaryColor
: item.inactiveColor ?? Colors.black12,
),
SizedBox(width: 10.0),
AnimatedSize(
duration: widget.animatedTextDuration,
Expand Down Expand Up @@ -96,8 +101,15 @@ class _AnimatedTextBottomBarState extends State<AnimatedTextBottomBar>
///text: the text to be animated (it will be shown only when the item is selected
///icon: icon shown when the item is selected or unselected
class BottomBarItem {
String? text;
Widget? icon;
final String? text;
final String? image;
final Color? activeColor;
final Color? inactiveColor;

BottomBarItem({this.text, this.icon});
BottomBarItem({
this.text,
this.image,
this.activeColor,
this.inactiveColor,
});
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: animation_wrappers
description: Animation Wrapper widgets, just wrap the child to be animated with this wrapper widget and that child will be animated.
version: 0.0.2
version: 0.0.3
author: Jagrit Kharbanda<jagritjkh@gmail.com>
homepage: https://github.com/jagritjkh/animation_wrappers

Expand Down

0 comments on commit e9ba680

Please sign in to comment.