TabBar와 TabBarView를 사용하여 동적 탭을 생성하고 관리하는 것을 단순화하는 플러터 패키지입니다. 개발자는 복잡한 상태 관리 없이 런타임에 탭을 쉽게 추가, 삭제 또는 업데이트할 수 있습니다. 이 패키지는 탭 탐색, 뷰 전환 및 상태 보존을 원활하게 처리하여 유연한 탭 레이아웃이 필요한 앱에 이상적입니다. 간단함을 중심으로 설계되어 봐일러플레이트 코드를 줄이고 개발 생산성을 향상시킵니다. Android, iOS 및 웹 플랫폼과 호환됩니다.
사용 사례
동적 대시보드 인터페이스 구축
사용자 정의 가능한 탭 기반 탐색 만들기
사용자 중심의 탭 추가/제거 구현
다중 섹션 콘텐츠 뷰 개발
실시간 탭 업데이트 지원
주요 기능
런타임 탭 조작
자동 상태 보존
최소한의 보일러플레이트 코드
크로스 플랫폼 지원 (Android, iOS, Web)
탭 추가/제거를 위한 간단한 API
적합한 대상
간편한 탭 관리를 원하는 개발자
변동하는 탭 수를 가진 앱
반응형 탭을 필요로 하는 동적 UI
Flutter 탭 패턴을 배우는 초보자
경량 탭 솔루션이 필요한 프로젝트
고려 사항
기본 탭 스타일링을 초과한 맞춤 설정은 제한적
스와이프 제스처에 내장된 지원 없음
탭별 로직을 수동으로 처리해야 합니다
매우 복잡한 탭 계층 구조에는 적합하지 않습니다
고급 사용 사례를 위해 외부 상태 관리에 의존합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Dynamic TabBar
A Flutter package that simplifies the implementation of dynamic TabBar in your application.
With DynamicTabBarWidget, users can effortlessly manage and navigate through a list of Tabs. The widget is designed to auto-update as Tabs are added or removed, providing a seamless and dynamic user experience.
Dynamic Tab Management: Users can push or pop items in the List<TabData> tabs array, and the DynamicTabBarWidget will auto-update accordingly.
Tab Navigation: Implement the onTabChanged callback to handle tab change events.
Customization Options: Customize the appearance and behavior of the DynamicTabBarWidget using parameters like backIcon, nextIcon, showBackIcon, and showNextIcon.
Tab Position : Specify the position to which cursor moves to after adding new Tab using the onAddTabMoveTo property.
🧰 Parameters
dynamicTabs: List of TabData objects representing the dynamic tabs.
isScrollable: Set to true to enable scrollable tabs.
onTabChanged: Callback function triggered when a tab is changed.
onAddTabMoveTo: Enum value (MoveToTab.idol, MoveToTab.last) specifying where a tab navigator should move when Tab is added.
backIcon: Custom icon for the "Back" button, If isScrollable is false, this property is ignored.
nextIcon: Custom icon for the "Next" button.
showBackIcon: Boolean to show or hide the Back icon button, If isScrollable is false, this property is ignored.
showNextIcon: Boolean to show or hide the Next icon button, If isScrollable is false, this property is ignored.
leading: Custom leading Widget if needed.
trailing: Custom trailing Widget if needed.
TabBar default properties...
and TabBarView default properties...
📚 How to use
isScrollable
isScrollable: false
isScrollable: true
showBackIcon
If isScrollable is false, this property is ignored.
showBackIcon: false
showBackIcon: true
showNextIcon
If isScrollable is false, this property is ignored.
showNextIcon: false
showNextIcon: true
backIcon
We can use custom Icon for back button, If isScrollable is false, this property is ignored.
backIcon: Icon()
backIcon: null
Icon(Icons.keyboard_double_arrow_left)
Default back icon will be used
nextIcon
We can use custom Icon for next button, If isScrollable is false, this property is ignored.
nextIcon: Icon()
nextIcon: null
Icon(Icons.keyboard_double_arrow_right)
Default back icon will be used
💻 Example
Check out the example app in the example directory for a complete example with additional parameters.