Giter Site home page Giter Site logo

hackman-adu / flutter_web_date_picker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ngocvuphan/flutter_web_date_picker

0.0 0.0 0.0 294 KB

License: MIT License

C++ 30.54% C 1.92% Objective-C 0.05% Kotlin 0.17% Dart 38.06% Swift 1.56% HTML 2.48% CMake 25.23%

flutter_web_date_picker's Introduction

Flutter date picker package for web application

Pub.Dev Demo Web

Showcase

Usage

    final textFieldKey = GlobalKey();
    ...
    TextField(
        key: textFieldKey,
        controller: _controller,
        onTap: () async {
            final pickedDate = await showWebDatePicker(
                context: textFieldKey.currentContext!,
                initialDate: _selectedDate,
                firstDate: DateTime.now().subtract(const Duration(days: 7)),
                lastDate: DateTime.now().add(const Duration(days: 14000)),
                //width: 300,
                //withoutActionButtons: true,
                //weekendDaysColor: Colors.red,
            );
            if (pickedDate != null) {
                _selectedDate = pickedDate;
                _controller.text = pickedDate.toString();
            }
        },
    ),
    ...

showWebDatePicker shows a dialog containing a date picker.

The returned Future resolves to the date selected by the user when the user confirms the dialog. If the user cancels the dialog, null is returned.

When the date picker is first displayed, it will show the month of initialDate, with initialDate selected.

The firstDate is the earliest allowable date. The lastDate is the latest allowable date. initialDate must either fall between these dates, or be equal to one of them

The width define the width of date picker dialog

The month view action buttons include:

  • Reset button: jump to initialDate and select it
  • Today button: jump to today and select it

The withoutActionButtons is true, the action buttons are removed from the month view. Default is false

The weekendDaysColor define the color of weekend days Saturday and Sunday. Default is null

flutter_web_date_picker's People

Contributors

ngocvuphan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.