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

animated_toggle 표지
패키지 상세v0.1.3

animated_toggle

Animated Toggle는 사용자 정의 애니메이션 토글을 만드는 쉬운 방법을 제공합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
196
좋아요
29
Pub 점수
150

패키지 설치

flutter pub add animated_toggle

패키지 개요

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

Animated Toggle는 커스터마이즈된 애니메이션 토글 스위치를 만드는 것을 단순화하는 Flutter 패키지입니다. 최소한의 설정으로 켜짐/꺼짐 상태 간에 부드럽고 시각적으로 매력적인 전환을 제공합니다. 복잡한 애니메이션 코드 없이 UI 상호작용을 향상시키고자 하는 개발자를 위한 것으로, Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원합니다. 가볍고 간단한 추가 명령어로 기존 Flutter 프로젝트에 쉽게 통합할 수 있습니다. 설정 패널, 테마 토글 또는 어떤 인터랙티브 스위치 인터페이스에도 이상적입니다.

사용 사례

  • 사용자 정의 테마 전환
  • 사용자 선호 스위치
  • 설정 UI 컴포넌트
  • 온보딩 흐름 지표
  • 인터랙티브 폼 요소

주요 기능

  • 부드러운 애니메이션 전환
  • 사용자 정의 가능한 외관
  • 크로스 플랫폼 지원
  • 최소한의 보일러플레이트
  • pub를 통한 간편한 통합
  • 사용자 정의 가능한 토글 동작

적합한 대상

  • 인터랙티브 요소를 찾는 UI 디자이너
  • 설정 화면을 구축하는 개발자
  • 시각적 피드백이 필요한 앱
  • Flutter 초보자가 애니메이션 탐색 중
  • 크로스 플랫폼 요구 사항이 있는 프로젝트

고려 사항

  • 토글 전용 사용 사례에 한정
  • 고급 디자인을 위해 수동 스타일링이 필요합니다
  • 내장된 접근성 기능 없음
  • 외부 애니메이션 로직에 의존
  • 복잡한 상태 기계에 적합하지 않습니다
  • 완전한 사용자 지정을 위해서는 추가 패키지가 필요할 수 있습니다

원본 README

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

Animated Toggle

Pub Pub likes Pub popularity Pub points

P1

Animated Toggle Give you easy way to make your custom Animated toggle.

Vertical Examples Horizontal Examples Default Ex

Full Ex

Installation

Add this to your pubspec.yaml:

dependencies:
  animated_toggle: ^Last Version

Features

Easy to use the Animated Toggle Package you can handle all colors and width and the height and you can make it vertical or horizontal. You can control the start from left or right if you need this for arabic or english or etc. you can control the Text Style and the padding for the Animated Toggle.

Getting started

import 'package:animated_toggle/animated_toggle.dart';

void main() {
  
}

// Start use th package in your State Widget

What you can handle

Horizontal Animated Toggle

final Duration duration;
final List<String> taps;
final double width;
final double height;
final int initialIndex;
final Color background;
final Color activeColor;
final Color inActiveColor;
final Color underLineColor;
final Color activeUnderLineColor;
final TextStyle activeTextStyle;
final TextStyle inActiveTextStyle;
final double spaceBetween;
final double horizontalPadding;
final double verticalPadding;
final double activeHorizontalPadding;
final double activeVerticalPadding;
final double radius;
final double underLineHeight;
final double activeUnderLineHeight;
final double activeButtonRadius;
final double inActiveButtonRadius;
final Function(int currentIndex, int targetIndex)? onChange;
final bool showUnderLine;
final bool showActiveButtonColor;
final String local;
final List<Widget>? prefixIcons;
final bool showPrefixIcon;
final double spaceBetweenIconAndText;
final List<BoxShadow>? activeBoxShadow;
final List<BoxShadow>? inActiveBoxShadow;
final Border? activeBorder;
final Border? inActiveBorder;

Vertical Animated Toggle

final Duration duration;
final List<String> taps;
final double width;
final double height;
final int initialIndex;
final Color background;
final Color activeColor;
final Color inActiveColor;
final Color sideLineColor;
final Color activeSideLineColor;
final TextStyle activeTextStyle;
final TextStyle inActiveTextStyle;
final double horizontalPadding;
final double verticalPadding;
final double activeHorizontalPadding;
final double activeVerticalPadding;
final double radius;
final double activeButtonHeight;
final double sideLineWidth;
final double activeSideLineWidth;
final double activeButtonRadius;
final double inActiveButtonRadius;
final Function(int currentIndex, int targetIndex)? onChange;
final bool showSideLine;
final bool showActiveButtonColor;
final String local;
final List<Widget>? prefixIcons;
final bool showPrefixIcon;
final double spaceBetweenIconAndText;
final List<BoxShadow>? activeBoxShadow;
final List<BoxShadow>? inActiveBoxShadow;
final Border? activeBorder;
final Border? inActiveBorder;

Usage

For More Examples Go To Example Tap

How to use Horizontal Animated Toggle

class MyAnimatedToggle extends StatefulWidget {
  const MyAnimatedToggle({super.key});

  @override
  State<MyAnimatedToggle> createState() => _MyAnimatedToggleState();
}

class _MyAnimatedToggleState extends State<MyAnimatedToggle> {
  
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Animated Toggle'),
      ),
      body: Center(
        child: AnimatedHorizontalToggle(
          taps: const ['First', 'Second', 'Last'],
          // write you taps names
          width: MediaQuery.of(context).size.width - 40,
          height: 48,
          duration: const Duration(milliseconds: 300),
          initialIndex: 0,
          background: Colors.black.withOpacity(0.1),
          activeColor: Colors.deepPurple,
          // here you can control the active text style
          activeTextStyle: const TextStyle(
              fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white),
          // here you can control the inactive text style
          inActiveTextStyle: const TextStyle(
              fontSize: 14,
              fontWeight: FontWeight.w400,
              color: Colors.deepPurple),
          // the next 2 line if you need to put padding for the inactive buttons
          horizontalPadding: 4,
          verticalPadding: 4,
          // the next 2 line if you need to put padding for the active button
          activeHorizontalPadding: 2,
          activeVerticalPadding: 4,
          radius: 14,
          // you can control the radius for the Animated widget
          activeButtonRadius: 14,
          // you can control the radius for the active button
          onChange: (int currentIndex, int targetIndex) {
            // write Your Personal Code Here
          },
          showActiveButtonColor: true,
          // 'en' mean make the start from left other mean start from right
          local:
          'en', // her you can add the local to control the alignment like if you use en its the normal to start from left to right and if you use ar the will start from right to left
        ),
      ),
    );
  }
}

How to use Vertical Animated Toggle

class MyAnimatedToggle extends StatefulWidget {
  const MyAnimatedToggle({super.key});

  @override
  State<MyAnimatedToggle> createState() => _MyAnimatedToggleState();
}

class _MyAnimatedToggleState extends State<MyAnimatedToggle> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Animated Toggle'),
      ),
      body: Center(
        child: AnimatedVerticalToggle(
          taps: const ['First', 'Second', 'Third', 'Last'],
          width: 80,
          height: 200,
          duration: const Duration(milliseconds: 300),
          activeButtonHeight: 34,
          initialIndex: 0,
          background: Colors.black.withOpacity(0.1),
          activeColor: Colors.deepPurple,
          // here you can control the active text style
          activeTextStyle: const TextStyle(
              fontSize: 16,
              fontWeight: FontWeight.w600,
              color: Colors.white),
          // here you can control the inactive text style
          inActiveTextStyle: const TextStyle(
              fontSize: 14,
              fontWeight: FontWeight.w400,
              color: Colors.deepPurple),
          // the next 2 line if you need to put padding for the inactive buttons
          horizontalPadding: 4,
          verticalPadding: 4,
          // the next 2 line if you need to put padding for the active button
          activeHorizontalPadding: 4,
          activeVerticalPadding: 2,
          radius: 14,
          // you can control the radius for the Animated widget
          activeButtonRadius: 10,
          // you can control the radius for the active button
          onChange: (int currentIndex, int targetIndex) {
            // write Your Personal Code Here
          },
          showActiveButtonColor: true,
          // 'en' mean make the start from left other mean start from right
          local:
          'en', // her you can add the local to control the alignment like if you use en its the normal to start from left to right and if you use ar the will start from right to left
        ),
      ),
    );
  }
}

Additional information

Say to me in GitHub what you need to see in the package in the next update. Wait for more feature soon.

Author

Loay Omar

카테고리

의존성

의존성 목록 1 개

소스 저장소

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

아직 데이터가 없습니다.