GithubHelp home page GithubHelp logo

qaison / month_picker_dialog_2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from macacoazul01/month_picker_dialog

0.0 0.0 0.0 578 KB

Internationalized dialog for picking a single month from an infinite list of years.

Home Page: https://pub.dev/packages/month_picker_dialog_2

License: MIT License

Shell 1.32% Objective-C 0.09% Kotlin 0.35% Dart 97.25% Swift 0.99%

month_picker_dialog_2's Introduction

month_picker_dialog_2

Build Status pub package

Internationalized material style dialog for picking a single month from an infinite list of years. This package makes use of the intl package and flutter's i18n abilities to provide labels in all languages known to flutter.

This package is a fork of the original month_picker_dialog from https://github.com/hmkrivoj/month_picker_dialog with some updates and fixes.

Setting up an internationalized app: the flutter localization package

How to use it:

Just add showMonthPicker() inside your button function like a normal date picker dialog (context and initialDate parameters are required):

Example:

FloatingActionButton(
    onPressed: () {
        showMonthPicker(
        context: context,
        initialDate: DateTime.now(),
        ).then((date) {
        if (date != null) {
            setState(() {
            selectedDate = date;
            });
        }
        });
    },
    child: Icon(Icons.calendar_today),
),

There are other parameters to configure on the dialog if you want:

[initialDate] is the initially selected month.

[firstDate] is the optional lower bound for month selection.

[lastDate] is the optional upper bound for month selection.

[selectableMonthPredicate] lets you control enabled months just like the official selectableDayPredicate.

[capitalizeFirstLetter] lets you control if your months names are capitalized or not.

[headerColor] lets you control the calendar header color.

[headerTextColor] lets you control the calendar header text and arrows color.

[selectedMonthBackgroundColor] lets you control the current selected month/year background color.

[selectedMonthTextColor] lets you control the text color of the current selected month/year.

[unselectedMonthTextColor] lets you control the text color of the current unselected months/years.

[confirmText] lets you set a custom confirm text widget.

[cancelText] lets you set a custom cancel text widget.

[customHeight] lets you set a custom height for the calendar widget.

[customWidth] lets you set a custom width for the calendar widget.

[yearFirst] lets you define that the user must select first the year, then the month.

[dismissible] lets you define if the dialog will be dismissible by clicking outside it.

Screenshots

Left-To-Right

LTR portrait LTR landscape

Right-To-Left

RTL portrait RTL landscape

month_picker_dialog_2's People

Contributors

hmkrivoj avatar macacoazul01 avatar wolfteam avatar sagarzala123 avatar leoncolt avatar mono0926 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.