搜尋套件、儲存庫與 APP 分類

flutter_time_picker_spinner 封面
套件詳情v2.0.0

flutter_time_picker_spinner

使用旋轉式元件取代預設的 Material 時間選擇器。此組件支援 12 或 24 小時格式,以及自訂間隔模式。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2.3萬
喜歡數
166
Pub 分數
130

安裝套件

flutter pub add flutter_time_picker_spinner

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個可自訂的時間選擇器小組件,適用於Flutter,使用旋轉式介面而非預設的Material時間選擇器。支援12小時制與24小時制,並允許設定自訂時間間隔,提供跨平台一致且簡潔的使用者介面。非常適合需要輕量級、可自訂樣式的時間選擇元件,而不依賴平台特定的選擇器。

適用情境

  • 表單中的自定義時間輸入
  • 需要統一時間選擇器的行動和Web應用程式
  • 具有非標準時間間隔的應用程式
  • 注重設計的介面需要一致的時間選擇
  • 跨平台時間輸入,統一外觀

主要特色

  • 基於旋轉器的時間選擇
  • 支援 12/24 小時格式
  • 自訂間隔設定
  • 跨平台相容性
  • 輕量且易於整合
  • 可透過主題和樣式選項進行樣式設定

適合對象

  • 尋求 Material 時間選擇器替代方案的開發者
  • 需要在 Android、iOS 和 Web 上保持一致 UI 的項目
  • 具有特定時間間隔要求的應用程式
  • 以設計為導向的應用程式
  • 重視跨平台一致性的團隊

使用建議

  • 僅限基本時間選擇(某些設定中無上午/下午標籤)
  • 可能需要手動處理時間格式邏輯
  • 不適用於複雜的時間範圍或持續時間輸入
  • 除了時間範圍外,沒有內建驗證
  • 依賴外部樣式進行進階自訂

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_time_picker_spinner

Time Picker widget with spinner instead of a material time picker.

12H format

24H format

24H format with second

Custom style

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Props

props types defaultValues
time DateTime Current Time [ DateTime.now() ]
minutesInterval int 1
secondsInterval int 1
is24HourMode bool true
isShowSeconds bool false
isShowSeconds bool false
highlightedTextStyle TextStyle false
normalTextStyle TextStyle false
itemHeight double 60.0
itemWidth double 45.0
spacing double 20.0
alignment AlignmentGeometry Alignment.centerRight
isForce2Digits bool false
onTimeChange TimePickerCallback

Usage

import 'package:flutter_time_picker_spinner/flutter_time_picker_spinner.dart';

Widget widget() {
  return new TimePickerSpinner(
    is24HourMode: false,
    normalTextStyle: TextStyle(
      fontSize: 24,
      color: Colors.deepOrange
    ),
    highlightedTextStyle: TextStyle(
      fontSize: 24,
      color: Colors.yellow
    ),
    spacing: 50,
    itemHeight: 80,
    isForce2Digits: true,
    onTimeChange: (time) {
      setState(() {
        _dateTime = time;
      });
    },
  );
}

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。