패키지, 저장소 및 앱 카테고리 검색

buttons_tabbar 표지
패키지 상세v2.0.0

buttons_tabbar

각 레이블이 토글 버튼인 탭바를 구현하는 플러터 패키지입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1만
좋아요
448
Pub 점수
150

패키지 설치

flutter pub add buttons_tabbar

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

ButtonsTabBar는 각 탭 레이블이 토글 버튼처럼 작동하여 사용자가 개별적으로 옵션을 선택하고 해제할 수 있는 사용자 정의 가능한 탭바를 제공하는 Flutter 패키지입니다. 선택된 상태에 대한 시각적 피드백을 제공함으로써 여러 섹션이 있는 앱에서의 탐색을 향상시킵니다. 이 패키지는 Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼을 지원하며, 크로스플랫폼 애플리케이션에 이상적입니다. 단순성과 유연성을 중심으로 설계되어 기존의 Flutter 프로젝트에 쉽게 통합될 수 있습니다.

사용 사례

  • 모바일 및 웹 앱에서의 사용자 정의 탭 탐색
  • 인터랙티브 필터링 인터페이스
  • 다중 선택 탭 레이아웃
  • 동적 콘텐츠 전환
  • 사용자 선호 설정
  • 대시보드 탐색

주요 기능

  • 전환 가능한 탭 레이블
  • 크로스 플랫폼 호환성
  • 사용자 정의 스타일
  • Flutter와의 간단한 통합
  • 선택된 탭에 대한 상태 관리
  • 반응형 디자인 지원

적합한 대상

  • 인터랙티브 UI를 구축하는 개발자
  • 다중 선택 탭을 필요로 하는 앱
  • 직관적인 탐색을 찾는 디자이너
  • 크로스 플랫폼 Flutter 프로젝트
  • 빠른 프로토타입 인터페이스 변경

고려 사항

  • 복잡한 상태 처리를 위해 사용자 정의 로직이 필요할 수 있습니다
  • 제한된 내장 애니메이션
  • 단일 선택 전용 시나리오에는 적합하지 않습니다
  • 탭 전환을 수동으로 처리해야 합니다
  • 작은부터 중간 규모의 탭 세트에 가장 적합
  • 고급 시각 효과를 위해 외부 스타일링에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Buttons TabBar

Publish Pub

Buttons TabBar is an open-source Flutter package that provides a tabbar where each tab indicator is a toggle button. It allows you to create interactive and customizable tab bars for your Flutter applications.

ButtonsTabBar screen animation

Features

✨ Each tab indicator is a toggle button 🎨 Customizable appearance and behavior 🖌️ Supports various styling options, including background color, border color, label style, icon color, and more 🚀 Smooth transition animations 📱 Works like a native TabBar ⚙️ Simple and easy to use configuration with a wide range of parameters

Installation

To use Buttons TabBar in your Flutter project, follow these steps:

  1. Add the dependency to your pubspec.yaml file:
dependencies:
  flutter:
    sdk: flutter
  buttons_tabbar: ^1.3.14
  1. Run flutter pub get to install the package.

Usage

Import the package in your Dart file and customize the tab bar according to your needs:

import 'package:buttons_tabbar/buttons_tabbar.dart';

DefaultTabController(
  length: ...,
  child: Column(
    children: <Widget>[
      ButtonsTabBar(
        // Customize the appearance and behavior of the tab bar
        backgroundColor: Colors.red,
        borderWidth: 2,
        borderColor: Colors.black,
        labelStyle: TextStyle(
          color: Colors.white,
          fontWeight: FontWeight.bold,
        ),
        unselectedLabelStyle: TextStyle(
          color: Colors.black,
          fontWeight: FontWeight.bold,
        ),
        // Add your tabs here
        tabs: ...,
      ),
      Expanded(
        child: TabBarView(
          children: ...,
        ),
      ),
    ],
  ),
)

Examples

Here are a few examples of how you can use Buttons TabBar:

Example #1

ButtonsTabBar - Example #1

DefaultTabController(
  length: ...,
  child: Column(
    children: <Widget>[
      ButtonsTabBar(
        backgroundColor: Colors.red,
        tabs: ...,
      ),
      Expanded(
        child: TabBarView(
          children: ...,
        ),
      ),
    ],
  ),
)
Example #2

ButtonsTabBar - Example #2

DefaultTabController(
  length: ...,
  child: Column(
    children: <Widget>[
      ButtonsTabBar(
        backgroundColor: Colors.blue[600],
        unselectedBackgroundColor: Colors.white,
        labelStyle: TextStyle(
          color: Colors.white,
          fontWeight: FontWeight.bold,
        ),
        unselectedLabelStyle: TextStyle(
          color: Colors.blue[600],
          fontWeight: FontWeight.bold,
        ),
        borderWidth: 1,
        unselectedBorderColor: Colors.blue[600],
        radius: 100,
        tabs: ...,
      ),
      Expanded(
        child: TabBarView(
          children: ...,
        ),
      ),
    ],
  ),
)
Example #3

ButtonsTabBar - Example #3

DefaultTabController(
  length: 6,
  child: Column(
    children: <Widget>[
      ButtonsTabBar(
        radius: 12,
        contentPadding: EdgeInsets.symmetric(horizontal: 12),
        borderWidth: 2,
        borderColor: Colors.transparent,
        center: true,
        decoration: BoxDecoration(
          gradient: LinearGradient(
            colors: <Color>[
              Color(0xFF0D47A1),
              Color(0xFF1976D2),
              Color(0xFF42A5F5),
            ],
          ),
        ),
        unselectedLabelStyle: TextStyle(color: Colors.black),
        labelStyle: TextStyle(color: Colors.white),
        height: 56,
        tabs: ...,
      ),
      Expanded(
        child: TabBarView(
          children: ...,
        ),
      ),
    ],
  ),
)

For more examples, please refer to the example.dart file.

Properties

Below are the properties available for customizing the ButtonsTabBar. For more detailed information, check the API reference.

Property Type Description Default
backgroundColor Color The background color of the button on its selected state. Theme.of(context).accentColor
borderColor Color The border color of the button on its selected state. Colors.black
borderWidth double The width of the solid border for each button. 0
buttonMargin EdgeInsets The EdgeInsets used for the margin of the buttons. EdgeInsets.all(4.0)
center bool Center the tab buttons. false
contentPadding EdgeInsets The EdgeInsets used for the padding of the buttons' content. EdgeInsets.symmetric(horizontal: 4.0)
controller TabController This widget's selection and animation state. DefaultTabController.of
decoration BoxDecoration The BoxDecoration of the button on its selected state. null
duration int The duration in milliseconds of the transition animation. 250
elevation double The value of elevation applied to each button. 0
height double? Override the default height. 46.0
labelSpacing double The spacing between the icon and the text. If only one of those is provided, no spacing is applied. 4.0
labelStyle TextStyle The TextStyle of the button's text on its selected state. The color provided on the TextStyle will be used for the icon's color. TextStyle(color: Colors.white)
onTap void Function(int)? An optional callback that's called when the TabBar is tapped. null
physics ScrollPhysics The physics used for the ScrollController of the tabs list. BouncingScrollPhysics()
radius double The value of the BorderRadius.circular applied to each button. 7.0
splashColor Color? The splash color of the button. null
tabs List<Widget> The tabs to display. Typically a list of two or more Tab widgets. @required
unselectedBackgroundColor Color The background color of the button on its unselected state. Colors.grey[300]
unselectedBorderColor Color The border color of the button on its unselected state. If it's value is null, the Color of borderColor is used. null
unselectedDecoration BoxDecoration The BoxDecoration of the button on its unselected state. null
unselectedLabelStyle TextStyle The TextStyle of the button's text on its unselected state. The color provided on the TextStyle will be used for the icon's color. TextStyle(color: Colors.black)

Apps Using Buttons TabBar

Here are some apps that are using Buttons TabBar to create engaging and interactive tab bars:

  1. Spotube - Open source Spotify client that doesn't require Premium nor uses Electron! Available for both desktop & mobile! Spotube

If you are using Buttons TabBar in your app and would like to showcase it here, please let us know. We would be happy to feature your app as well.

Please note that the above apps are provided as examples and may not be actively maintained or associated with the Buttons TabBar package.

Future Development

If you have any suggestions or encounter any issues, feel free to let me know. I am committed to improving and maintaining this package.

License

This package is licensed under the MIT License. For more information, see the LICENSE.md file.

More Information

For more information, visit the Buttons TabBar GitHub repository or the author's website.

카테고리

의존성

의존성 목록 1 개

소스 저장소

이 패키지를 사용하는 프로젝트