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

パッケージ詳細v4.0.0+13

interval_time_picker

時間間隔を選択できる、デフォルトのFlutter時刻ピッカーのバリエーションです。

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

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

flutter pub add interval_time_picker

パッケージ概要

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

デフォルトの時刻ピッカーを拡張して、個々の時刻ではなく時間間隔を選択できるようにするFlutterパッケージです。事前に定義された時間スロットから選択できるため、固定間隔が必要なスケジューリングアプリケーションに最適です。Android、iOS、Web、macOS、Windows、Linuxなどすべての主要プラットフォームをサポートしており、デバイス間で一貫した動作を保証します。Dartで構築されており、Flutterプロジェクトにスムーズに統合され、時間間隔に基づく時刻選択用に洗練されカスタマイズ可能なインターフェースを提供します。

用途

  • 固定時間枠での予約のスケジューリング
  • インターバルベースの時間選択を必要とする予約システム
  • 事前に定義されたインターバルを備えたタイムトラッキングツール
  • 固定期間ブロックを使用したイベント計画
  • オンライン授業または会議の時間選択

主な機能

  • カスタムインターバル期間をサポート
  • インターバル選択用の直感的なUI
  • クロスプラットフォーム互換性
  • Flutterアプリへの簡単な統合
  • 開始時刻および終了時刻のカスタマイズ可能
  • すべての画面サイズに対応するレスポンシブデザイン

適している対象

  • 予約予約アプリを開発する開発者
  • タイムトラッキングソフトウェアを作成するチーム
  • スケジュールされたセッションを提供する教育プラットフォーム
  • 構造化された時間入力を必要とするアプリ

注意事項

  • ユーザーの混乱を避けるために、正確なインターバル設定が必要です
  • エッジケースに対する追加の検証が必要になる場合があります
  • 時刻のみの選択に制限(日付なし)
  • 動的または不規則な時間範囲には適していません
  • タイムスロットが予測可能で均一なときに最適に使用されます

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Interval Time Picker

pub version likes pub points

This package modifies the default Flutter Time Picker widget by adding interval options when picking minutes. This means you can restrict the user from picking only certain intervals of minutes and you can choose to which interval of minutes the Time Picker will snap to in dial mode.

Version notes
  • Flutter 2.0.0 until 3.7.12 should use version 1.1.0+4.
  • Flutter 3.1.0 until 3.19.6 should use version 2.0.0+5.
  • Flutter 3.22.x should use version 3.0.2+8.
  • Flutter 3.24.0 until 3.32.8 should use version 3.0.4+10.
  • Flutter 3.35.0 and higher should use version 4.0.0+13.
Usage

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  interval_time_picker: ^4.0.0+13

On top of your code add the following import:

import 'package:interval_time_picker/interval_time_picker.dart';

In your code you can then call:

showIntervalTimePicker(
    context: context,
    initialTime: TimeOfDay.fromDateTime(DateTime.now()),
    interval: 5,
    visibleStep: VisibleStep.fifths,
);
Explanation

This package adds two parameters:

  • interval
  • visibleStep

In most cases it is recommended to set the Interval and VisibleStep as the same: i.e. respectively 5 and VisibleStep.fifths or 12 and VisibleStep.twelfths.

Interval

The interval parameter is the steps the Interval Time Picker uses when validating the chosen time (minutes) as well as the steps it rounds off to.
The default and minimum value is 1 minute. The maximum is 60 minutes.

It is actually possible to also use an interval that is not a factor of 60.
So i.e., if you want to use 7 you can use that as well. In that case the highest pickable minute is 56 and going higher will pick 0.

This package also fixes the issue that individual minutes are only selectable by dragging the ring:
Flutter issue #62424

VisibleStep

The visibleStep parameter is the minute labels that are visible on the ring. Choose the steps by using the VisibleStep enum.
The options are a factor of 60 with 5 being the lowest and 60 (shown as 00) being the highest. The default value is VisibleStep.fifths.

Disclaimers
  • If the initial minute is not a multiplication of the interval it will still pick that minute. So handle this yourself when calling showIntervalTimePicker.
Contributions
  • https://github.com/markj
  • https://github.com/MarkCLinovy
  • https://github.com/nilsreichardt
  • https://github.com/hromov
  • https://github.com/harshgmx47
  • https://github.com/pamafe1976

カテゴリー

ソースリポジトリ

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