v0.1.0stage_navigation_bar
一个用于精美导航栏的 Flutter 包,选择项目时带有动画效果。
9喜欢 10近 30 天下载150Pub 分数
AndroidiOSWebmacOSWindowsLinux
mu7mmd/stage_navigation_bar open-source repository details.
以下为英文项目原文快照,最新内容请访问 GitHub。
A beautiful navigation bar with animation when select item.
dependencies:
stage_navigation_bar: ^0.1.0 #latest version
import 'package:stage_navigation_bar/stage_navigation_bar.dart';
Place your StageNavigationBar to the bottomNavigationBar slot of a Scaffold. Or in the bottom
of your main page view.
class StageNavigationBarExample extends StatefulWidget {
const StageNavigationBarExample({super.key});
@override
State<StageNavigationBarExample> createState() =>
_StageNavigationBarExampleState();
}
class _StageNavigationBarExampleState extends State<StageNavigationBarExample> {
/// Your initial page
int _selectedIndex = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
bottomNavigationBar: StageNavigationBar(
items: const [
Icon(Icons.home_filled, color: Colors.white),
Icon(Icons.favorite, color: Colors.white),
Icon(Icons.search, color: Colors.white),
Icon(Icons.person, color: Colors.white),
],
selectedIndex: _selectedIndex,
indicatorColor: Colors.amber,
onTap: (int index) {
setState(() {
_selectedIndex = index;
});
},
),
);
}
}
animationDirection: Define the animation move shape when tap.alignment: Alignment of the items.barHeight: StageNavigationBar height.barWidth: StageNavigationBar width.indicatorHeight: Indicator line height.itemPadding: Each item padding.duration: Indicator animation Transition duration.selectedIndex*: Current selected index.indicatorColor*: Color of the indicator and the gradient.onTap*: On item tap.barPadding?: StageNavigationBar internal padding.barMargin?: StageNavigationBar external padding.decoration?: StageNavigationBar box decoration.selectedIndicatorBorderRadius?: Selected item indicator border radius.unselectedIndicatorBorderRadius?: Unselected item indicator border radius.items!: StageNavigationBar items, List of widget.itemsCount!: Items count for itemBuilder callback.itemBuilder!: Callback will be called with indices greater than or equal to zero and less than itemsCount.animationDirection = IndicatorAnimationDirection.topToBottom,alignment = Alignment.center,barHeight = 60,barWidth = double.infinityindicatorHeight = 5,itemPadding = const EdgeInsets.all(0),duration = const Duration(milliseconds: 200),selectedIndicatorBorderRadius: default value depends on 'animationDirection' value,unselectedIndicatorBorderRadius: default value depends on 'animationDirection' value,IndicatorAnimationDirection.top
IndicatorAnimationDirection.topToBottom
IndicatorAnimationDirection.centerToTop
IndicatorAnimationDirection.centerToBottom
IndicatorAnimationDirection.bottom
IndicatorAnimationDirection.bottomToTop
onTap: (index){
}
IndicatorAnimationDirectionanimationDirection: IndicatorAnimationDirection.top
animationDirection: IndicatorAnimationDirection.topToBottom
animationDirection: IndicatorAnimationDirection.centerToTop
animationDirection: IndicatorAnimationDirection.centerToBottom
animationDirection: IndicatorAnimationDirection.bottom
animationDirection: IndicatorAnimationDirection.bottomToTop
Mohammad Alamoudi @mu7mmd
依赖清单 3 项
{"sdk":"flutter"}{"sdk":"flutter"}^3.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗