diff --git a/CHANGELOG.md b/CHANGELOG.md index 988ba59..5fac8ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [0.0.4] - 2021-03-18 + +* add textStyle, margin and borderRadius properties in animatedTextBottomBar +* make text and image property as required in BottomBarItem + ## [0.0.3] - 2021-03-18 * add activeColor and inactiveColor property to bottom bar item diff --git a/README.md b/README.md index d46aacf..7c12e9e 100644 --- a/README.md +++ b/README.md @@ -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.3 + animation_wrappers: ^0.0.4 ``` ## Import @@ -38,4 +38,8 @@ FadedSlideAnimation( beginOffset: Offset(0.5, 2), endOffset: Offset(0.5, 1), ), -``` \ No newline at end of file +``` + +Many more animation wrappers and animated bottom bars will be added soon..! + +Made with :heart: by Jagrit \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index 84c3175..b95ccea 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "0.0.2" + version: "0.0.3" async: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index ca848b4..0e872bf 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -22,6 +22,4 @@ dev_dependencies: flutter: - uses-material-design: true - assets: - - assets/ \ No newline at end of file + uses-material-design: true \ No newline at end of file diff --git a/lib/AnimatedBottomNavigationBars/animated_text_bottom_bar.dart b/lib/AnimatedBottomNavigationBars/animated_text_bottom_bar.dart index 83a0245..c4e29ba 100644 --- a/lib/AnimatedBottomNavigationBars/animated_text_bottom_bar.dart +++ b/lib/AnimatedBottomNavigationBars/animated_text_bottom_bar.dart @@ -1,23 +1,33 @@ import 'package:flutter/material.dart'; ///animated bottom navigation bar with animated text + ///children: list of bottom navigation bar items which consists of text and icon ///text: the title of the item ///icon: widget(image or icon) of the item ///onBarTap: function performed when a particular child item is pressed ///animatedTextDuration: duration of animated text (default value: Duration(milliseconds: 250)) ///animatedTextCurve: curve of animated text (default value: Curves.easeInOut) +///textStyle: styling of animated text +///margin: margin of animated bottom navigation bar (default value: EdgeInsets.zero) +///borderRadius: border radius of animated bottom navigation bar (default value: BorderRadius.zero) class AnimatedTextBottomBar extends StatefulWidget { final List<BottomBarItem> children; final Function onBarTap; final Duration animatedTextDuration; final Curve animatedTextCurve; + final TextStyle? textStyle; + final EdgeInsetsGeometry? margin; + final BorderRadiusGeometry? borderRadius; AnimatedTextBottomBar({ required this.children, required this.onBarTap, this.animatedTextDuration = const Duration(milliseconds: 250), this.animatedTextCurve = Curves.easeInOut, + this.textStyle, + this.margin = EdgeInsets.zero, + this.borderRadius = BorderRadius.zero, }); @override @@ -32,8 +42,10 @@ class _AnimatedTextBottomBarState extends State<AnimatedTextBottomBar> Widget build(BuildContext context) { return Material( elevation: 10.0, + borderRadius: widget.borderRadius!, child: Container( padding: EdgeInsets.symmetric(vertical: 10.0), + margin: widget.margin!, color: Theme.of(context).scaffoldBackgroundColor, child: Row( mainAxisSize: MainAxisSize.max, @@ -68,10 +80,10 @@ class _AnimatedTextBottomBarState extends State<AnimatedTextBottomBar> child: Row( children: <Widget?>[ ImageIcon( - AssetImage(item.image!), + AssetImage(item.image), color: isSelected ? item.activeColor ?? Theme.of(context).primaryColor - : item.inactiveColor ?? Colors.black12, + : item.inactiveColor ?? Colors.black, ), SizedBox(width: 10.0), AnimatedSize( @@ -79,11 +91,12 @@ class _AnimatedTextBottomBarState extends State<AnimatedTextBottomBar> curve: widget.animatedTextCurve, vsync: this, child: Text( - isSelected ? item.text! : "", - style: Theme.of(context) - .textTheme - .headline2! - .copyWith(fontWeight: FontWeight.w600), + isSelected ? item.text : "", + style: widget.textStyle ?? + Theme.of(context) + .textTheme + .headline2! + .copyWith(fontWeight: FontWeight.w600), ), ), ] as List<Widget>, @@ -100,15 +113,17 @@ 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 +///activeColor: color of image(icon) when the item is selected +///inactiveColor: color of image(icon) when the item is not selected class BottomBarItem { - final String? text; - final String? image; + final String text; + final String image; final Color? activeColor; final Color? inactiveColor; BottomBarItem({ - this.text, - this.image, + required this.text, + required this.image, this.activeColor, this.inactiveColor, }); diff --git a/pubspec.yaml b/pubspec.yaml index b81eb15..5b81261 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.3 +version: 0.0.4 author: Jagrit Kharbanda<jagritjkh@gmail.com> homepage: https://github.com/jagritjkh/animation_wrappers