Search packages, repositories and app categories

custom_date_range_picker cover
Package detailsv1.2.0

custom_date_range_picker

A Flutter package for both Android and iOS that provides a customizable date range picker with beautiful UI and smooth animations.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
4K
Likes
85
Pub points
160

Install package

flutter pub add custom_date_range_picker

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package offering a highly customizable date range picker for Android, iOS, Web, macOS, Windows, and Linux. It features an elegant user interface with smooth animations, enabling developers to tailor the picker's appearance and behavior to match their app's design. The picker supports intuitive date selection with visual feedback, making it ideal for booking systems, scheduling apps, and data filtering interfaces. Built with cross-platform compatibility in mind, it ensures consistent user experience across devices.

Use cases

  • Booking and reservation systems
  • Data filtering by date range
  • Event scheduling apps
  • Travel planning tools
  • Custom calendar integrations

Key features

  • Cross-platform support
  • Smooth animations
  • Highly customizable UI
  • Intuitive date selection
  • Visual feedback for selected ranges

Suitable for

  • Developers building travel or booking apps
  • Teams needing consistent date pickers across platforms
  • Apps requiring custom calendar designs
  • Projects focused on user experience and aesthetics

Considerations

  • Requires integration with existing date handling logic
  • May need additional styling for complex themes
  • Limited to date range selection (no time component)
  • Depends on Flutter SDK version compatibility

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

custom_date_range_picker

custom_date_range_picker

Usage

...
  floatingActionButton: FloatingActionButton(
        onPressed: () {
          showCustomDateRangePicker(
            context,
            dismissible: true,
            minimumDate: DateTime.now().subtract(const Duration(days: 30)),
            maximumDate: DateTime.now().add(const Duration(days: 30)),
            endDate: endDate,
            startDate: startDate,
            backgroundColor: Colors.white,
            primaryColor: Colors.green,
            onApplyClick: (start, end) {
              setState(() {
                endDate = end;
                startDate = start;
              });
            },
            onCancelClick: () {
              setState(() {
                endDate = null;
                startDate = null;
              });
            },
          );
        },
        tooltip: 'choose date Range',
        child: const Icon(Icons.calendar_today_outlined, color: Colors.white),
      ),

Function: showCustomDateRangePicker

This function displays a custom date range picker dialog box.

Parameters

  • context (required): The context in which to show the dialog.
  • dismissible (required): A boolean value indicating whether the dialog can be dismissed by tapping outside of it.
  • minimumDate (required): A DateTime object representing the minimum allowable date that can be selected in the date range picker.
  • maximumDate (required): A DateTime object representing the maximum allowable date that can be selected in the date range picker.
  • startDate (optional): A nullable DateTime object representing the initial start date of the date range selection.
  • endDate (optional): A nullable DateTime object representing the initial end date of the date range selection.
  • onApplyClick (required): A function that takes two DateTime parameters representing the selected start and end dates, respectively, and is called when the user taps the "Apply" button.
  • onCancelClick (required): A function that is called when the user taps the "Cancel" button.
  • backgroundColor (required): The background color of the dialog.
  • primaryColor (required): The primary color of the dialog.
  • fontFamily (optional): The font family to use for the text in the dialog.

Usage

Inside the function, a FocusNode is requested to take focus away from any input field that might be in focus. A showDialog function is then called to show the CustomDateRangePicker dialog box. The CustomDateRangePicker widget is built with the parameters passed to showCustomDateRangePicker, and then passed as the builder parameter of the showDialog function.

When the user interacts with the CustomDateRangePicker dialog box, the onApplyClick and onCancelClick functions are called accordingly.

Many Thanks to the creator of this Repo https://github.com/mitesh77/Best-Flutter-UI-Templates

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package