搜索插件、代码仓与 APP 分类

插件详情v0.0.1

custom_switch

使用 Flutter 创建的精美自定义开关。

近 30 天下载
118
喜欢数
52
Pub 分数
20

安装插件

flutter pub add custom_switch

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个视觉上吸引人的自定义开关小部件,使用 Flutter 构建,提供流畅现代的设计,可在状态之间切换。它为开发者提供了一个易于使用的界面,帮助他们通过精美的开关组件提升应用的用户界面。该包轻量且可自定义,允许调整颜色、大小和动画效果。它可无缝集成到 Flutter 项目中,并支持在开启和关闭状态之间实现平滑过渡。非常适合用于设置、偏好或任何需要切换输入功能的场景。

适合场景

  • 应用设置开关
  • 用户偏好开关
  • 启用/禁用深色模式
  • 表单输入控件
  • 自定义 UI 组件

主要特点

  • 漂亮的动画设计
  • 易于自定义
  • 平滑的状态转换
  • 轻量级实现
  • 无缝 Flutter 集成

适合对象

  • 寻求视觉精致的UI设计师
  • 开发人员构建设置屏幕
  • 频繁切换交互的应用
  • 注重现代美学的项目
  • Flutter 初学者探索组件

使用建议

  • 无平台特定样式
  • 仅限基本开关功能
  • 需要手动处理状态
  • 无内置的可访问性功能
  • 不支持列出的多个平台

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

custom_switch

Beautiful Custom Switch package created with Flutter.

Say Thanks!

The source code is 100% Dart, and everything resides in the /lib folder.

Show some :heart: and star the repo to support the project

GitHub followers Twitter Follow

Open Source Love

💻 Installation

In the dependencies: section of your pubspec.yaml, add the following line:

custom_switch: <latest_version>

Import in your project:

import 'package:custom_switch/custom_switch.dart';

❔Basic Usage

class HomeScreen extends StatefulWidget {
  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {

  bool status = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Custom Switch Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            CustomSwitch(
              activeColor: Colors.pinkAccent,
              value: status,
              onChanged: (value) {
                print("VALUE : $value");
                setState(() {
                  status = value;
                });
              },
            ),
            SizedBox(height: 12.0,),
            Text('Value : $status', style: TextStyle(
              color: Colors.black,
              fontSize: 20.0
            ),)
          ],
        ),
      ),
    );
  }
}

Screenshots

custom_switch

👨 Developed By

Mohak Gupta

👍 How to Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

📃 License

Copyright (c) 2019 Mohak Gupta

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

所属分类

源码仓库

使用此插件的项目