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

패키지 상세v4.0.0+13

interval_time_picker

시간 간격을 선택할 수 있는 기본 Flutter 시간 선택기의 변형입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
10
좋아요
27
Pub 점수
160

패키지 설치

flutter pub add interval_time_picker

패키지 개요

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

기본 시간 선택기를 확장하여 개별 시간 대신 시간 간격을 선택할 수 있도록 하는 플러터 패키지입니다. 사용자가 미리 정의된 시간 슬롯 중에서 선택할 수 있게 해 주며, 고정된 간격이 필요한 스케줄링 애플리케이션에 적합합니다. 안드로이드, iOS, 웹, macOS, Windows, 리눅스 등 모든 주요 플랫폼을 지원하며 장치 간 일관된 동작을 보장합니다. Dart로 제작되어 플러터 프로젝트에 원활하게 통합되며, 시간 간격 기반의 시간 선택을 위한 깔끔하고 사용자 정의 가능한 인터페이스를 제공합니다.

사용 사례

  • 고정 시간대 예약 일정 조정
  • 간격 기반 시간 선택을 요구하는 예약 시스템
  • 사전 정의된 간격을 갖춘 시간 추적 도구
  • 고정 지속 시간 블록을 사용한 이벤트 기획
  • 온라인 수업 또는 회의 시간 선택

주요 기능

  • 사용자 정의 간격 지속 시간을 지원
  • 간편한 인터벌 선택 사용자 인터페이스
  • 크로스 플랫폼 호환성
  • 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

카테고리

소스 저장소

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