SnakeBottomNavigationBar
herodotdigital/SnakeBottomNavigationBar open-source repository details.
- 스타
- 211
- 포크
- 51
- 최근 푸시(UTC)
- 2023. 4. 10.
- 프로젝트 상태
- 활성
원본 README
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
SnakeNavigationBar
A new Flutter SnakeNavigationBar widget package.
BREAKING CHANGES
To separate colors and gradient logic now you have SnakeNavigationBar.color and SnakeNavigationBar.gradient constructors. Changes naming: style => behaviour, snakeColor => snakeViewColor (snakeViewGradient in gradient configuration), onPositionChanged => onTap
Added selectedItemColor and unselectedItemColor (selectedItemGradient and unselectedItemGradient in gradient configuration)
Preview
Usage
To use this plugin, add flutter_snake_navigationbar as a dependency in your pubspec.yaml file.
Properties
SnakeNavigationBar has a similar API to BottomNavigationBar and uses BottomNavigationBarItem to show items as well.
Scaffold(
bottomNavigationBar: SnakeNavigationBar.color(
behaviour: snakeBarStyle,
snakeShape: snakeShape,
shape: bottomBarShape,
padding: padding,
///configuration for SnakeNavigationBar.color
snakeViewColor: selectedColor,
selectedItemColor: snakeShape == SnakeShape.indicator ? selectedColor : null,
unselectedItemColor: Colors.blueGrey,
///configuration for SnakeNavigationBar.gradient
//snakeViewGradient: selectedGradient,
//selectedItemGradient: snakeShape == SnakeShape.indicator ? selectedGradient : null,
//unselectedItemGradient: unselectedGradient,
showUnselectedLabels: showUnselectedLabels,
showSelectedLabels: showSelectedLabels,
currentIndex: _selectedItemPosition,
onTap: (index) => setState(() => _selectedItemPosition = index),
items: [
BottomNavigationBarItem(icon: Icon(Icons.notifications), label: 'tickets'),
BottomNavigationBarItem(icon: Icon(CustomIcons.calendar), label: 'calendar'),
BottomNavigationBarItem(icon: Icon(CustomIcons.home), label: 'home'),
BottomNavigationBarItem(icon: Icon(CustomIcons.podcasts), label: 'microphone'),
BottomNavigationBarItem(icon: Icon(CustomIcons.search), label: 'search')
],
),
final List<BottomNavigationBarItem> items;
/// If [SnakeBarBehaviour.floating] this color is
/// used as background color of shaped view.
/// If [SnakeBarBehaviour.pinned] this color just
/// a background color of whole [SnakeNavigationBar] view
final Gradient backgroundGradient;
/// This color represents a SnakeView and unselected
/// Icon and label color
final Gradient snakeViewGradient;
/// This color represents a selected Icon color
final Gradient selectedItemGradient;
/// This color represents a unselected Icon color
final Gradient unselectedItemGradient;
/// Whether the labels are shown for the selected [BottomNavigationBarItem].
final bool showSelectedLabels;
/// Whether the labels are shown for the selected [BottomNavigationBarItem].
final bool showUnselectedLabels;
/// The index into [items] for the current active [BottomNavigationBarItem].
final int currentIndex;
///You can specify custom elevation shadow color
final Color shadowColor;
/// Defines the [SnakeView] shape and behavior of a [SnakeNavigationBar].
///
/// See documentation for [SnakeShape] for information on the
/// meaning of different shapes.
///
/// Default is [SnakeShape.circle]
final SnakeShape snakeShape;
/// Defines the layout and behavior of a [SnakeNavigationBar].
///
/// See documentation for [SnakeBarBehaviour] for information on the
/// meaning of different styles.
///
/// Default is [SnakeBarBehaviour.pinned]
final SnakeBarBehaviour behaviour;
/// You can define custom [ShapeBorder] with padding and elevation to [SnakeNavigationBar]
final ShapeBorder shape;
final EdgeInsets padding;
final double elevation;
/// Called when one of the [items] is pressed.
final ValueChanged<int> onTap;
!! IMPORTANT !! if you use [SnakeShape.circle] then [showSelectedLabels] parameter will be always [FALSE]
사용 중인 의존성
의존성 목록 3 개
- flutter
{"sdk":"flutter"} - flutter_lints개발 의존성
^1.0.4 - flutter_test개발 의존성
{"sdk":"flutter"}
프로젝트에 맞는 저장소를 선택하려면?
사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
- 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
- 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
- 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.
출처 및 관리
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗