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

flutter_toggle_tab 표지
패키지 상세v2.0.0

flutter_toggle_tab

Flutter에서 아름답고 사용자 정의 가능한 토글 탭 위젯을 생성하기 위한 라이브러리

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.1만
좋아요
121
Pub 점수
160

패키지 설치

flutter pub add flutter_toggle_tab

패키지 개요

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

개발자가 시각적으로 매력적이고 고도로 사용자 정의 가능한 토글 탭 위젯을 만들 수 있도록 해주는 플러터 패키지입니다. 모든 주요 플랫폼에서 부드러운 애니메이션과 반응성 있는 동작을 제공하는 유연하고 사용하기 쉬운 인터페이스를 제공합니다. 콘텐츠 필터링, 뷰 전환, 또는 깔끔하고 현대적인 UI에서 옵션 선택에 이상적입니다. 커스텀 스타일, 정렬 및 동적 콘텐츠 렌더링을 지원하여 단순한 경우부터 복잡한 경우까지 다양한 용도에 적합합니다.

사용 사례

  • 카테고리별로 데이터 필터링
  • 앱 뷰 간 전환
  • 폼 입력 선택기 만들기
  • 테마 전환 구현
  • 네비게이션 탭 빌드
  • 세그먼트 컨트롤 사용자 정의

주요 기능

  • 높은 사용자 정의가 가능한 외관
  • 부드러운 애니메이션 전환
  • 크로스 플랫폼 호환성
  • 동적 콘텐츠 지원
  • 기존 위젯과의 간편한 통합
  • 반응형 디자인 처리

적합한 대상

  • 현대적인 UI를 개발하는 개발자
  • 세그먼트 선택이 필요한 앱
  • 시각적 완성도를 추구하는 디자이너
  • 다중 플랫폼 프로젝트
  • 재사용 가능한 컴포넌트를 우선시하는 팀

고려 사항

  • Flutter 레이아웃 원칙에 대한 이해가 필요합니다
  • 복잡한 테마를 위해 추가 스타일링이 필요할 수 있습니다
  • 많은 수의 탭으로 인한 성능 영향
  • 제한된 내장 접근성 기능
  • 매우 높은 주파수 업데이트에 최적화되지 않음

원본 README

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

Flutter Tab Toggle

pub package

A Beautiful and Simple Toggle Tab widget. It can be fully customized with desired icons, width, colors, text, corner radius, etc. It also maintains selection state.

Getting Started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  flutter_toggle_tab: "^latestVersion"

Import it:

import 'package:flutter_toggle_tab/flutter_toggle_tab.dart';

Usage Examples

Basic tab/toggle switch

image


// Here default theme colors are used for activeBgColor, activeFgColor, inactiveBgColor and inactiveFgColor
FlutterToggleTab
(
  width: 90, // width in percent
  borderRadius: 30,
  height: 50,
  selectedIndex: _tabTextIndexSelected,
  selectedBackgroundColors: [Colors.blue, Colors.blueAccent],
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w700),
  unSelectedTextStyle: TextStyle(
  color: Colors.black87,
  fontSize: 14,
  fontWeight: FontWeight.w500),
  dataTabs: _listTextTabToggle,
  selectedLabelIndex: (index) {
    setState(() {
        _tabTextIndexSelected = index;
    });
  },
  isScroll:false,
)

Basic tab/toggle switch with Custom Counter Widget

image


// Here default theme colors are used for activeBgColor, activeFgColor, inactiveBgColor and inactiveFgColor
FlutterToggleTab
(
  width: 90, // width in percent
  borderRadius: 30,
  height: 50,
  selectedIndex: _tabTextIndexSelected,
  selectedBackgroundColors: [Colors.blue, Colors.blueAccent],
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w700),
  unSelectedTextStyle: TextStyle(
  color: Colors.black87,
  fontSize: 14,
  fontWeight: FontWeight.w500),
  dataTabs: _listTextTabToggleCounter,
  selectedLabelIndex: (index) {
    setState(() {
        _tabTextIndexSelected = index;
    });
  },
  isScroll:false,
)

Basic tab/toggle switch with Icon

image

FlutterToggleTab
(
  width: 50,
  borderRadius: 15,
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w600),
  unSelectedTextStyle: TextStyle(
  color: Colors.blue,
  fontSize: 14,
  fontWeight: FontWeight.w400),
  dataTabs: _listGenderText,
  selectedIndex: _tabTextIconIndexSelected,
  selectedLabelIndex: (index) {
    setState(() {
      _tabTextIconIndexSelected = index;
    });
  },
)

Basic tab/toggle switch with Icon Only and add margin on selected item

image

FlutterToggleTab
(
  width: 40,
  borderRadius: 15,
  selectedIndex: _tabIconIndexSelected,
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w600),
  unSelectedTextStyle: TextStyle(
  color: Colors.grey,
  fontSize: 14,
  fontWeight: FontWeight.w400),
  dataTabs: _listIconTabToggle,
  selectedLabelIndex: (index) {
    setState(() {
      _tabIconIndexSelected = index;
    });
  },
  marginSelected: EdgeInsets.symmetric(horizontal: 4,vertical:4),
)

Update selected tab Programmatically
FlutterToggleTab
(
  width: 90,
  borderRadius: 15,
  selectedIndex: _tabSelectedIndexSelected,
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w600),
  unSelectedTextStyle: TextStyle(
  color: Colors.grey,
  fontSize: 14,
  fontWeight: FontWeight.w400),
  dataTabs: _listTextSelectedToggle,
  selectedLabelIndex: (index) {
    setState(() {
      _tabSelectedIndexSelected = index;
    });
  },
)

Available Parameters

Param isRequired
List<DataTab> dataTabs Yes
Function(int) selectedLabelIndex Yes
TextStyle selectedTextStyle default:Theme.of(context).textTheme.bodyMedium, No
TextStyle unSelectedTextStyle default:Theme.of(context).textTheme.bodyMedium, No
int selectedIndex (listener for index selected) see on example Yes
double width (in Percent of width Screen) default: 100 No
double height (double) default: 45 No
double iconSize No
double borderRadius (double) default 30 No
List<Color> selectedBackgroundColors default : [ Theme.of(context).primaryColor] No
List<Color> unSelectedBackgroundColors default [ Color(0xffe0e0e0)] No
Alignment begin default : Alignment.topCenter No
Alignment end default : Alignment.bottomCenter No
bool isScroll default : true No
EdgeInsets marginSelected default : EdgeInsets.zero No
bool isShadowEnable default : true No
bool isInnerShadowEnable default : true No

LinkedIn

Buy me coffee if you love my works ☕️

buymeacoffe      ko-fi      paypal



카테고리

의존성

의존성 목록 1 개

소스 저장소

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

아직 데이터가 없습니다.