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

cupertino_height_picker 표지
패키지 상세v1.0.1

cupertino_height_picker

이 패키지는 쿠퍼티노 스타일의 높이 선택기로, 미터법(센티미터)과 영국식(피트/인치)을 모두 지원하여 사용자에게 유연성과 정밀도를 제공합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
189
좋아요
8
Pub 점수
160

패키지 설치

flutter pub add cupertino_height_picker

패키지 개요

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

cupertino_height_picker 패키지는 플러터 앱용으로 네이티브 느낌의 커퍼티노 스타일의 키 선택기를 제공하며, 미터법(센티미터)과 영제법(피트/인치) 단위를 모두 지원합니다. iOS 디자인 가이드라인과 자연스럽게 통합된 부드럽고 상호작용 가능한 인터페이스를 제공하며, 안드로이드, 웹, macOS, Windows, 리눅스에서도 기능을 유지합니다. 정밀성과 사용성을 고려해 설계되어 직관적인 스크롤링과 명확한 시각적 피드백을 통해 사용자가 자신의 키를 쉽게 선택할 수 있도록 합니다. 사용자 정의가 가능하며 정확한 키 입력이 필요한 폼에 적합합니다.

사용 사례

  • 사용자 프로필 설정
  • 건강 및 피트니스 애플리케이션
  • 의료 데이터 수집
  • 나이/키 기반 폼 입력
  • 앱에서 사용자 정의 높이 선택

주요 기능

  • Cupertino 스타일의 UI
  • 메트릭 및 영국식 단위를 지원합니다
  • 크로스 플랫폼 호환성
  • 스무스 스크롤 인터페이스
  • 사용자 정의 가능한 외관
  • 정확한 높이 선택

적합한 대상

  • iOS 중심의 Flutter 앱
  • 크로스 플랫폼 헬스 앱
  • 양식 중심 애플리케이션
  • 디자인 일관성 있는 사용자 인터페이스
  • 원시적인 느낌의 피커를 찾는 개발자

고려 사항

  • Flutter 3.0 이상이 필요합니다
  • 내부 레이아웃의 사용자 정의가 제한적
  • Cupertino 테마가 아닌 경우 추가 스타일링이 필요할 수 있습니다
  • 매우 큰 데이터 세트에 최적화되지 않음
  • 플랫폼별 렌더링 동작에 의존합니다

원본 README

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

🎚️ Cupertino Height Picker Plugin

pub package

A seamless Cupertino-style height picker widget for Flutter. Supports height selection in both centimeters (metric) and feet/inches (imperial), providing versatility and precision for users.

Imperial System Metric System Automatic Unit Conversion
Imperial System Demo Metric System Demo Unit Conversion Demo

Features

  • Automatic Unit Conversion: Effortlessly switch between centimeters and feet/inches with automatic conversions.
  • Decimal Value Precision: Allows for precise height measurements.
  • Cupertino Styled Number Picker: A clean, intuitive interface consistent with iOS design.
  • Light & Dark Themes: Built-in support for both light and dark themes, adapting to the user's theme settings.

Getting started

1. Depend on it

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

dependencies:
  cupertino_height_picker: ^1.0.1
2. Install it

You can install packages from the command line:

$ flutter pub get
3. Import it

Now in your Dart code, you can use:

import 'package:cupertino_height_picker/cupertino_height_picker.dart';

Usage

Call the default showCupertinoHeightPicker Function which always returns the height in centimeters and has automatic unit conversion enabled by default

screenshot_1
await showCupertinoHeightPicker(
  context: context,
  onHeightChanged: (val) {
    setState(() {
      heightInCm = val;
      });
  },
);




Allow Height to be input only from metric system

screenshot_2
await showCupertinoHeightPicker(
  context: context,
  initialSelectedHeightUnit:HeightUnit.cm,
  canConvertUnit: false,
  onHeightChanged: (val) {
    print(val);
  },
);




Start from a custom initial height and don't show the separation text between feet and inches

screenshot_3
await showCupertinoHeightPicker(
  context: context,
  initialHeight: 185.5,
  showSeparationText: false,
  onHeightChanged: (val) {
    print(val);
  },
);




Customize the Look of the Modal to your liking!

screenshot_4
await showCupertinoHeightPicker(
  context: context,
  modalHeight: 300,
  maxModalWidth: 500,
  modalBackgroundColor: CupertinoColors.systemTeal,
  barrierColor: CupertinoColors.systemGreen.withOpacity(0.5),
  onHeightChanged: (val) {
    print(val);
  },
);


Parameters
  • context: (Required) The BuildContext object, which is necessary for rendering the height picker within the widget tree.

  • onHeightChanged: (Required) A callback function that handles height changes when the user scrolls through different height values. The selected height is returned in centimeters.

  • initialHeight: Sets the default initial height value when the picker is opened. The default is 150.0 cm.

  • initialSelectedHeightUnit: Specifies the default height unit (either HeightUnit.inches or HeightUnit.cm) when the picker is opened. The default is HeightUnit.inches.

  • canConvertUnit: A boolean that determines whether the height picker allows conversion between imperial and metric systems. The default is true.

  • showSeparationText: A boolean that controls whether a separation text (e.g., 'feet') or a decimal point text is shown between the two sliders. The default is true.

  • modalHeight: Specifies the height of the modal sheet. The default value is 216.0.

  • maxModalWidth: Defines the maximum width of the modal sheet. This is useful for responsiveness on larger screens, such as tablets and laptops. If null, the modal takes up the full device width. The default is null.

  • modalBackgroundColor: Defines the background color of the modal sheet. The default is null.

  • barrierColor: Sets the color of the screen behind the modal, allowing for a custom background color with reduced opacity. The default is kCupertinoModalBarrierColor.

Maintainers

Aditya R

카테고리

소스 저장소

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

아직 데이터가 없습니다.