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

flutter_switch 표지
패키지 상세v0.3.2

flutter_switch

사용자 정의 높이와 너비, 테두리, 테두리 반지름, 색상, 전환 크기, 전환 내부의 사용자 지정 텍스트 및 아이콘을 가질 수 있는 사용자 지정 스위치 위젯입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
15.5만
좋아요
634
Pub 점수
150

패키지 설치

flutter pub add flutter_switch

패키지 개요

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

flutter_switch는 Flutter용 사용자 정의 가능한 스위치 위젯으로 개발자가 크기, 테두리, 모서리 반지름, 색상 및 전환 크기를 조정할 수 있습니다. 전환 내에 사용자 지정 텍스트와 아이콘을 지원하여 높은 시각적 유연성을 제공합니다. 여러 플랫폼에서 맞춤형 디자인으로 고유한 케이스/오프 제어를 만들기에 적합합니다. 패키지는 가볍고 pub.dev를 통해 쉽게 통합할 수 있습니다.

사용 사례

  • 사용자 지정 UI 스위치
  • 테마 전환 요소
  • 크로스 플랫폼 스위치 컴포넌트
  • 인터랙티브 폼 컨트롤
  • 향상된 사용자 인터페이스 디자인

주요 기능

  • 조정 가능한 높이와 너비
  • 사용자 지정 테두리 및 모서리 반지름
  • 토글 내 아이콘 및 텍스트 지원
  • 사용자 지정 가능한 색상 및 토글 크기
  • 크로스 플랫폼 호환성

적합한 대상

  • 사용자 정의를 원하는 UI 디자이너
  • 인터랙티브 폼을 개발하는 개발자
  • 브랜드 토글 스위치가 필요한 앱
  • 다중 플랫폼을 대상으로 하는 프로젝트
  • 일관된 UI 요소를 우선시하는 팀

고려 사항

  • 상태 관리를 수동으로 처리해야 합니다
  • 제한된 내장 애니메이션
  • 복잡한 동적 토글에 적합하지 않습니다
  • 접근성에 대한 추가 스타일링이 필요할 수 있습니다
  • 고급 기능을 위해 외부 패키지에 의존합니다

원본 README

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

flutter_switch

All Contributors

pub package pub points popularity likes

An easy to implement custom switch created for Flutter. Give it a custom height and width, border for the switch and toggle, border radius, colors, toggle size, a choice to display an 'On' and 'Off' text and able to add an icon inside the toggle.

GitHub followers

Demo

flutter_switch

Video version: https://youtu.be/JqJnxjE6Efc

Use this package as a library

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_switch: ^0.3.1

You can install packages from the command line with Flutter:

$ flutter pub get

Import in your project:

import 'package:flutter_switch/flutter_switch.dart';

Sample Usage

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool status = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("FlutterSwitch Demo"),
      ),
      body: Center(
        child: Container(
          child: FlutterSwitch(
            width: 125.0,
            height: 55.0,
            valueFontSize: 25.0,
            toggleSize: 45.0,
            value: status,
            borderRadius: 30.0,
            padding: 8.0,
            showOnOff: true,
            onToggle: (val) {
              setState(() {
                status = val;
              });
            },
          ),
        ),
      ),
    );
  }
}

Want to Contribute?

Contributions to this project is very much welcome. Let's work together to maintain and improve the project Simply Fork the repository, Commit and Push your changes and create a new Pull Request.

Don't forget to try out the example project under the ./example folder.

Also test your changes by running this command.

$ flutter test

If you have some suggestions, you can reach me at romero.nicholejohn@gmail.com

License

BSD 3-Clause License

Copyright (c) 2020, Nichole John Romero
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this
    list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

    3. Neither the name of the copyright holder nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Nickr

💻 📖 🚧 ⚠️

Lucas Eduardo

💻

Douglas Ramos

💻

Daniyil Yevtyushkin

💻 ⚠️

Maksim Nikolaev

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

카테고리

소스 저장소

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