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

color_picker_field 표지
패키지 상세v2.1.0

color_picker_field

Material 및 Cupertino용 색상 선택기 필드로, 색조 기반의 원형 색상 선택기가 포함됨

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
199
좋아요
16
Pub 점수
150

패키지 설치

flutter pub add color_picker_field

패키지 개요

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

Material 및 Cupertino 디자인을 위한 사용자 정의 가능한 색상 선택 필드를 제공하는 플러터 패키지로, 직관적인 색상 선택을 위한 색조 기반 원형 색상 선택기가 특징입니다. 안드로이드, iOS, 웹, macOS, 윈도우, 리눅스 등 여러 플랫폼을 지원합니다. 위젯은 폼에 자연스럽게 통합되며, 원형 색조 휠과 채도/명도 슬라이더를 사용하여 사용자가 정밀하게 색상을 선택할 수 있도록 합니다. UI 커스터마이징 또는 디자인 도구에서 동적 색상 입력이 필요한 앱에 적합합니다.

사용 사례

  • 색상 선택이 필요한 폼 입력
  • UI 테마 사용자 정의
  • 디자인 도구 인터페이스
  • 색상 팔레트 생성
  • 모바일 및 웹 앱 스타일링
  • 다시보드에서의 인터랙티브 색상 선택기

주요 기능

  • 라디얼 색조 기반 색상 선택기
  • 재료 및 컵ertino 호환성
  • 크로스 플랫폼 지원
  • 사용자 정의 가능한 UI 구성 요소
  • 폼 필드와의 통합
  • 실시간 색상 미리보기

적합한 대상

  • 디자인 도구를 구축하는 앱 개발자
  • 색상 선택기 구현하는 UI/UX 디자이너
  • 동적 테마 옵션을 필요로 하는 앱
  • 색상 입력이 포함된 폼 중심 애플리케이션
  • 크로스플랫폼 모바일 및 웹 앱

고려 사항

  • 복잡한 테마에 대해 추가 스타일링이 필요할 수 있습니다
  • 많은 인스턴스로 인한 성능 영향
  • 기본 색상 선택에 제한됨(고급 색상 모델 없음)
  • 고정밀 색상 워크플로우에 적합하지 않습니다
  • 외부 종속성 관리에 의존

원본 README

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

Color Picker Field

Pub

Color Picker field for Material and Cupertino, including a Radial Color picker(Hue based)

Material

Material Fields Color wheel Remove colors Saturation and Lightness

Cupertino

Cupertino Fields Color wheel Remove colors Saturation and Lightness

Usage

Just the ColorPickerField without a Form with a controller set
final ColorPickerFieldController controller = ColorPickerFieldController();
ColorPickerField(
  colors: [],
  defaultColor: Colors.blue,
  onChanged: (Color value) {},
  controller: controller,
  decoration: InputDecoration(
    labelText: 'Colors',
  ),
),
ColorPickerFieldFor with a validator, decoration and an onChange callback
ColorPickerFormField(
  initialValue: [],
  defaultColor: Colors.blue,
  autovalidateMode: AutovalidateMode.onUserInteraction,
  maxColors: 3,
  decoration: InputDecoration(
    labelText: 'Colors',
    helperText: 'test',
  ),
  validator: (List<Color>? value) {
    if (value!.isEmpty) {
      return 'a minimum of 1 color is required';
    }
    return null;
  },
  onChanged: (Color value) {},
),
Just a CupertinoColorPickerField without a Form
CupertinoColorPickerField(
  placeholder: 'CupertinoColorPickerField',
  colors: [],
  defaultColor: Colors.blue,
  onChanged: (Color value) {},
  clearButtonMode: ClearButtonVisibilityMode.always,
),
A CupertinoColorPickerField inside a CupertinoFormSection using CupertinoColorPickerFormFieldRow
CupertinoFormSection.insetGrouped(
  header: const Text('Section 1'),
  children: [
    // A field with an always showing clear button
    CupertinoColorPickerFormFieldRow(
      prefix: const Text('Enter Color'),
      defaultColor: defaultColor,
      clearButtonMode: ClearButtonVisibilityMode.always,
      placeholder: 'Enter Color',
      onChanged: _onChanged,
      validator: (List<Color>? value) {
        if (value == null || value.isEmpty) {
          return 'Please enter at least one color';
        }
        return null;
      },
    ),
    
    // A field with a reversed position and order of the chosen colors list
    CupertinoColorPickerFormFieldRow(
      prefix: const Text('Enter Color'),
      defaultColor: defaultColor,
      placeholder: 'Enter Color',
      onChanged: (Color value) {},
      colorListReversed: true,
      validator: (List<Color>? value) {
        if (value == null || value.isEmpty) {
          return 'Please enter at least one color';
        }
        return null;
      },
    ),

    // Forcing Text Direction using Directionality widget, 
    // by default the TextDirection will be read from the Localization
    Directionality(
      textDirection: TextDirection.rtl,
      child: CupertinoColorPickerFormFieldRow(
        prefix: const Text('Enter Color rtl'),
        defaultColor: defaultColor,
        placeholder: 'Enter Color rtl',
        onChanged: (Color value) {},
        validator: (List<Color>? value) {
          if (value == null || value.isEmpty) {
            return 'Please enter at least one color';
          }
          return null;
        },
      ),
    ),
  ],
),

API reference

카테고리

의존성

의존성 목록 2 개

소스 저장소

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

아직 데이터가 없습니다.