パッケージ、リポジトリ、アプリカテゴリを検索

cupertino_height_picker のカバー
パッケージ詳細v1.0.1

cupertino_height_picker

このパッケージは、Cupertinoスタイルの高さピッカーをシームレスに提供し、メートル法のセンチメートルとインペリアル法のフィート/インチの両方をサポートしており、ユーザーに柔軟性と正確性を提供します。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
189
いいね数
8
Pub ポイント
160

パッケージをインストール

flutter pub add cupertino_height_picker

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

cupertino_height_picker パッケージは、Flutter アプリ向けにネイティブ風のカーピトリオスタイルの身長ピッカーを提供し、メートル法(センチメートル)およびインペリアル(フィート/インチ)単位をサポートしています。iOS のデザインガイドラインとシームレスに統合された滑らかでインタラクティブなインターフェースを提供し、Android、Web、macOS、Windows、Linux でも機能します。正確さと使いやすさを重視して設計されており、直感的なスクロール操作と明確な視覚フィードバックにより、ユーザーが身長を選択できるようにしています。カスタマイズ性が高く、正確な身長入力が必要なフォームに適しています。

用途

  • ユーザープロファイルのセットアップ
  • 健康とフィットネスアプリ
  • 医療データ収集
  • 年齢/身長に基づくフォーム入力
  • アプリでの高さのカスタマイズ選択

主な機能

  • 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

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。