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

ios_color_picker 封面
插件详情v3.0.0

ios_color_picker

一个为所有 Flutter 平台提供 iOS 风格颜色选择器 UI 的 Flutter 包,同时在 iOS 上提供原生 iOS 颜色选择器。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
167
喜欢数
10
Pub 分数
140

安装插件

flutter pub add ios_color_picker

插件介绍

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

ios_color_picker 包在所有 Flutter 平台上提供 iOS 风格的颜色选择器界面,确保外观和感觉的一致性。在 iOS 上,它利用原生颜色选择器实现真实的集成。该包非常适合需要直观颜色选择且具有平台适当设计的应用程序。它支持多个平台,包括 Android、Web、macOS、Windows 和 Linux,使其适用于跨平台开发。其用户界面模仿 Apple 的原生颜色选择器,在非 iOS 设备上提升用户体验,同时在可用时保持原生行为。

适合场景

  • 跨平台颜色选择
  • iOS 原生 UI 在非 iOS 平台
  • 带有颜色选择器的设计工具
  • 自定义主题构建器
  • 移动应用颜色自定义

主要特点

  • iOS 风格的用户界面适用于所有平台
  • 在 iOS 上使用原生 iOS 选择器
  • 支持多个平台
  • 通过 pub 的简单集成
  • 跨设备的一致用户体验

适合对象

  • 针对iOS美学的开发者
  • 需要颜色输入的应用程序
  • 跨平台 UI 一致性
  • 注重设计的应用程序
  • 带有颜色自定义的 Flutter 应用

使用建议

  • 仅限颜色选择
  • 无高级颜色操作
  • 需要手动处理颜色值
  • 默认情况下未针对可访问性进行优化
  • 在边缘情况下可能与iOS不完全匹配

原始 README

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

ios_color_picker

A Flutter package that provides an iOS-style color picker UI for every Flutter platform, plus access to the native iOS color picker on iOS.

Supported Platforms

  • Linux
  • macOS
  • Web
  • Windows
  • iOS
  • Android

Requirements

  • Flutter 3.41.0 or later
  • Dart 3.11.4 or later
  • Android minSdk 24
  • iOS 14.0 or later for the native iOS picker
  • macOS 10.15 or later

Features

Screenshots & Demo

Getting Started

Add the package and create a controller. Dispose the controller from your widget's dispose method because the native iOS picker streams color changes through an event channel.

Usage

final iosColorPickerController = IOSColorPickerController();

/// Native iOS Color Picker
ElevatedButton(
  onPressed: () {
    iosColorPickerController.showNativeIosColorPicker(
      startingColor: backgroundColor,
      darkMode: true,
      onColorChanged: (color) {
        setState(() {
          backgroundColor = color;
        });
      },
    );
  },
  child: Text("Native iOS"),
),

/// Custom iOS Color Picker (for all platforms)
ElevatedButton(
  onPressed: () {
    iosColorPickerController.showIOSCustomColorPicker(
      startingColor: backgroundColor,
      onColorChanged: (color) {
        setState(() {
          backgroundColor = color;
        });
      },
      context: context,
    );
  },
  child: Text("Custom iOS for all"),
),

Dispose the controller:

final IOSColorPickerController iosColorPickerController =
    IOSColorPickerController();

@override
void dispose() {
  iosColorPickerController.dispose();
  super.dispose();
}

Example

Run the app in the example/ folder to explore the plugin.

Additional Information

For more updates and inquiries, connect with me on LinkedIn:

所属分类

依赖

依赖清单 5 项

源码仓库

使用此插件的项目

暂无相关数据。