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

datepicker_dropdown 표지
패키지 상세v1.0.2

datepicker_dropdown

사용자 정의 옵션을 가진 Flutter용 드롭다운 날짜 선택기입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.2천
좋아요
48
Pub 점수
160

패키지 설치

flutter pub add datepicker_dropdown

패키지 개요

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

사용자 정의 가능한 옵션을 제공하는 드롭다운 스타일의 날짜 선택기인 플러터 패키지입니다. 폼과 UI에 자연스럽게 통합되어 전체 캘린더 모달을 열지 않고도 컴팩트하고 사용자 친화적인 방식으로 날짜를 선택할 수 있습니다. 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스 등 다양한 플랫폼을 지원합니다. 개발자가 표준 날짜 선택기의 간단하고 접근성 있는 대안을 찾고 있다면 이상적입니다. 커스터마이징은 스타일, 날짜 형식, 선택 동작 등을 포함합니다.

사용 사례

  • 날짜 선택이 필요한 폼 입력
  • 모바일 및 웹 앱에서 사용하는 가벼운 날짜 입력
  • 제한된 UI 공간에서 사용자 정의 가능한 날짜 선택기
  • 날짜 선택을 드롭다운 메뉴에 통합하기
  • 접근성 중심의 날짜 입력 컴포넌트

주요 기능

  • 드롭다운 기반의 날짜 선택
  • 크로스 플랫폼 호환성
  • 사용자 정의 가능한 외관 및 동작
  • 다양한 날짜 형식을 지원합니다
  • 기존 양식과의 간편한 통합
  • 필요한 보일러플레이트 최소화

적합한 대상

  • 작은 크기의 날짜 선택기를 필요로 하는 개발자
  • UI에 공간 제약이 있는 프로젝트
  • 다중 플랫폼을 대상으로 하는 앱
  • 접근성 우선 고려 팀
  • 일관된 날짜 입력 디자인을 필요로 하는 UI

고려 사항

  • 단일 날짜 선택에 제한됨
  • 내장된 검증 없음
  • 날짜 파싱을 수동으로 처리해야 합니다
  • 복잡한 날짜 범위에 적합하지 않습니다
  • 완전한 캘린더 선택기와 비교해 시각적 피드백이 적음

원본 README

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

Date Picker Dropdown

pub package

A customizable dropdown date picker for Flutter with support for multiple field orders, validation, localization, and form-friendly callbacks.

Web demo: datepicker.robertrobinson.in

Features

  • Day, month, and year dropdowns with configurable order
  • Optional form validation for each field
  • Locale-specific month labels
  • Configurable year range, spacing, flex, styles, and decorations
  • Safe handling of invalid date combinations such as 31 February
  • Controlled-widget support when the parent rebuilds with new selected values

Main View Month View Date View Year View

Getting Started

Add the package to your pubspec.yaml:

dependencies:
  datepicker_dropdown: ^1.0.2

Then run:

flutter pub get

Basic Usage

import 'package:datepicker_dropdown/datepicker_dropdown.dart';
import 'package:datepicker_dropdown/order_format.dart';
import 'package:flutter/material.dart';

class BirthDateField extends StatefulWidget {
  const BirthDateField({super.key});

  @override
  State<BirthDateField> createState() => _BirthDateFieldState();
}

class _BirthDateFieldState extends State<BirthDateField> {
  int? _day;
  int? _month;
  int? _year;

  @override
  Widget build(BuildContext context) {
    return DropdownDatePicker(
      dateFormatOrder: OrderFormat.ydm,
      startYear: 1900,
      endYear: DateTime.now().year,
      selectedDay: _day,
      selectedMonth: _month,
      selectedYear: _year,
      onChangedDay: (String? value) {
        setState(() {
          _day = int.tryParse(value ?? '');
        });
      },
      onChangedMonth: (String? value) {
        setState(() {
          _month = int.tryParse(value ?? '');
        });
      },
      onChangedYear: (String? value) {
        setState(() {
          _year = int.tryParse(value ?? '');
        });
      },
    );
  }
}

Form Example

DropdownDatePicker(
  dateFormatOrder: OrderFormat.mdy,
  isFormValidator: true,
  isDropdownHideUnderline: true,
  startYear: 1900,
  endYear: 2025,
  hintDay: 'Day',
  hintMonth: 'Month',
  hintYear: 'Year',
  inputDecoration: InputDecoration(
    enabledBorder: const OutlineInputBorder(),
    border: OutlineInputBorder(
      borderRadius: BorderRadius.circular(10),
    ),
    contentPadding: const EdgeInsets.symmetric(horizontal: 12),
  ),
  onChangedDay: (String? value) {
    debugPrint('day: $value');
  },
  onChangedMonth: (String? value) {
    debugPrint('month: $value');
  },
  onChangedYear: (String? value) {
    debugPrint('year: $value');
  },
)

Notes

  • dateFormatOrder is the preferred property name.
  • dateformatorder is still supported as a deprecated backwards-compatible alias.
  • If the current day becomes invalid after a month or year change, the widget automatically adjusts it to the last valid day and notifies onChangedDay.
  • The widget syncs correctly when the parent rebuilds with new selectedDay, selectedMonth, or selectedYear values.

Supported Locales

en, en_abbv, num, ar, de_DE, el_GR, es_ES, fr_FR, gu_IN, hi_IN, id_ID, it_IT, ja, kn_IN, ko_KR, ml_IN, mr_IN, nl_NL, pl_PL, pt_BR, ru_RU, sv_SE, ta_IN, te_IN, th, tr, vi, zh_CN

Example App

See the example app in example/lib/main.dart for a complete integration.

Repository

Source code: github.com/Robertrobinson777/dropdown_date_picker

Support

Buy Me A Coffee

카테고리

소스 저장소

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

아직 데이터가 없습니다.