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

riff_switch 표지
패키지 상세v0.0.4

riff_switch

RiffSwitch를 통해 원활한 전환과 매력적인 상호작용을 경험하세요. 간편한 슬라이딩 효과와 매혹적인 애니메이션을 가능하게 하는 스위치 라이브러리입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
185
좋아요
10
Pub 점수
140

패키지 설치

flutter pub add riff_switch

패키지 개요

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

RiffSwitch는 부드러운 슬라이딩 전환과 시각적으로 매력적인 애니메이션을 통해 사용자 인터페이스를 향상시키기 위해 설계된 Flutter 패키지입니다. 개발자가 최소한의 코드로 매력적이고 상호작용 가능한 스위치를 만들 수 있게 해주며, 설정, 선호 사항 또는 상태 표시기에서의 토글에 이상적입니다. 이 라이브러리는 Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원하여 장치 간 일관된 동작을 보장합니다. 사용자 정의 가능한 스타일과 반응형 피드백을 통해 RiffSwitch는 상호작용을 역동적이고 완성도 있는 느낌으로 만들어 UX를 향상시킵니다.

사용 사례

  • 사용자 지정 토글 스위치
  • 사용자 선호 설정
  • on/off 상태 표시기
  • 인터랙티브 UI 요소
  • 모바일 및 웹 앱 인터페이스

주요 기능

  • 부드러운 슬라이딩 애니메이션
  • 크로스 플랫폼 호환성
  • 사용자 정의 가능한 외관
  • 반응형 상호작용 피드백
  • 최소한의 설정 필요

적합한 대상

  • 시각적 완성도를 추구하는 UI 디자이너
  • 인터랙티브 폼을 개발하는 개발자
  • 직관적인 토글 제어가 필요한 앱
  • 크로스 플랫폼 Flutter 프로젝트
  • 사용자 경험을 중시하는 프로젝트

고려 사항

  • 복잡한 테마에 맞추기 위해 추가적인 스타일링이 필요할 수 있습니다
  • 대규모 스위치 목록의 성능 영향
  • 스위치 전용 기능에 한정됨
  • 전환형이 아닌 상호작용 컴포넌트에 적합하지 않습니다
  • Flutter의 애니메이션 프레임워크에 의존합니다

원본 README

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

RiffSwitch

Build pub package pub points popularity likes Star on Github Awesome Flutter License: BSD

Breathe life into your Flutter UI with RiffSwitch, the switch library that empowers effortless sliding effects and captivating animations. Customize the sliding behavior for a unique user experience, while interactive dragging fosters a sense of control and responsiveness. Witness smooth state transitions as the switch flips, adding a touch of visual polish to your app. Whether you prefer simple or decorative switch types, RiffSwitch seamlessly integrates into your UI, transforming basic interactions into engaging experiences.

Experience seamless transitions and engaging interactions with RiffSwitch.

Table of Contents

Installation

To use RiffSwitch in your Flutter project, add the following to your pubspec.yaml file:

dependencies:
  riff_switch: ^0.0.4

Then, run:

flutter pub get

Usage

Import the package:

import 'package:riff_switch/riff_switch.dart';

Add the RiffSwitch widget to your UI, providing the necessary parameters:

RiffSwitch(
  value: _isEnabled,
  onChanged: (bool newValue) {
    setState(() {
      _isEnabled = newValue;
    });
  },
  // Additional customization options...
)

Features

  • Customization: Customize the appearance with various options such as colors, texts, and child widgets.
  • Sliding Effects: RiffSwitch supports sliding effects for a modern and interactive user experience.
  • Enum Types: Choose between simple and decorative switch types based on your UI requirements.
  • Animation:
    • Smooth Transitions: Enjoy smooth animations when the switch transitions between on and off states.
    • Interactive Dragging: The sliding effects are accompanied by interactive dragging animations for a responsive feel.

Examples

Here's a basic example of how to use RiffSwitch:

import 'package:flutter/material.dart';
import 'package:riff_switch/riff_switch.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('RiffSwitch Example'),
        ),
        body: Center(
          child: RiffSwitch(
            value: true,
            onChanged: (bool newValue) {
              // Handle switch state change
            },
            // Additional customization options...
          ),
        ),
      ),
    );
  }
}

More examples from main.dart

// 1
  RiffSwitch(
    value: _switchValue,
    onChanged: (value) => setState(() {
      _switchValue = value;
    }),
    type: RiffSwitchType.simple,
  ),

  const SizedBox(height: 30),

  // 2
  RiffSwitch(
    value: _switchValue,
    onChanged: (value) => setState(() {
      _switchValue = value;
    }),
    type: RiffSwitchType.simple,
    activeText: const Text("Accept"),
    inactiveText: const Text("Decline"),
    thumbColor: MaterialStateProperty.resolveWith((Set<MaterialState> states) {
      if (states.contains(MaterialState.selected)) {
        return Colors.greenAccent;
      }
      return Colors.pinkAccent;
    }),
    trackColor: MaterialStateProperty.resolveWith((Set<MaterialState> states) {
      if (states.contains(MaterialState.selected)) {
        return Colors.grey;
      }
      return Colors.grey;
    }),
  ),

  const SizedBox(height: 30),

  // 3
  RiffSwitch(
    value: _switchValue,
    onChanged: (value) => setState(() {
      _switchValue = value;
    }),
    type: RiffSwitchType.decorative,
    activeColor: Colors.orange,
  ),

  const SizedBox(height: 30),

  // 4
  RiffSwitch(
    value: _switchValue,
    onChanged: (value) => setState(() {
      _switchValue = value;
    }),
    type: RiffSwitchType.decorative,
    activeChild: const Card(
      color: CupertinoColors.systemBlue,
      child: FlutterLogo(),
    ),
    inactiveChild: const Card(
      color: CupertinoColors.systemYellow,
      child: FlutterLogo(),
    ),
  )

NOTE: It's important to note that the thumbColor property takes precedence over any color applied directly to the active or inactive thumb, whether through a container widget or any other means. This allows for consistent and predictable customization of the thumb's color across different states of the switch, ensuring a cohesive visual appearance throughout the application.

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3
Screenshot 1 Screenshot 2 Screenshot 3
Screenshot 4 Screenshot 5 Screenshot 6
Screenshot 4 Screenshot 5 Screenshot 6
Screen Record 1 Screen Record 2
Screen Record 1 Screen Record 2

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

  • Issues: If you encounter any bugs, have feature requests, or want to suggest improvements, please open an issue on our GitHub repository. Provide as much detail as possible to help us understand the problem or idea better.

  • Pull Requests: If you'd like to contribute code changes, feel free to submit a pull request. Before doing so, make sure to fork the repository and create a new branch for your changes. Follow the existing coding style and guidelines, and write clear and concise commit messages. Your pull request will undergo review, and we'll work together to ensure the changes align with the project's goals.

  • Feature Requests: If you have ideas for new features or enhancements, please open an issue to discuss them. We value community feedback and want to ensure that new features align with the project's direction and objectives.

  • Spread the Word: Help us grow the FontResoft community by sharing the project with others. Whether through social media, blog posts, or word of mouth, spreading the word about FontResoft helps attract more users and contributors.

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

카테고리

의존성

의존성 목록 1 개

소스 저장소

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

아직 데이터가 없습니다.