nepali_date_picker 3.2.0+1

Nepali Date Picker #

Pub Package Licence Download effective dart

Material and Cupertino Style Date Picker with Bikram Sambat(Nepali) Calendar Support. Supports Android, iOS and Fuchsia. Available in Nepali and English Languages.

Loading Demo

Nepali Date Picker returns data in NepaliDateTime type, which is included in nepali_utils package.

Salient Features #

  • Material DatePicker
  • Cupertino DatePicker
  • Adaptive DatePicker
  • Supports from 2000 B.S. to 2099 B.S.

Usage #

Material Style Date Picker #

import 'package:nepali_date_picker/nepali_date_picker.dart' as picker;

NepaliDateTime _selectedDateTime = await picker.showMaterialDatePicker(
    context: context,
    initialDate: NepaliDateTime.now(),
    firstDate: NepaliDateTime(2000),
    lastDate: NepaliDateTime(2090),
    language: _language,
    initialDatePickerMode: DatePickerMode.day,
);

print(_selectedDateTime); // 2076-02-16T00:00:00

Cupertino Style Date Picker #

picker.showCupertinoDatePicker(
    context: context,
    initialDate: NepaliDateTime.now(),
    firstDate: NepaliDateTime(2000),
    lastDate: NepaliDateTime(2090),
    language: _language,
    dateOrder: _dateOrder,
    onDateChanged: (newDate) {
        print(_selectedDateTime);
    },
);

Adaptive Date Picker #

Shows DatePicker based on Platform. i.e. Cupertino DatePicker will be shown on iOS while Material on Android and Fuchsia.

NepaliDateTime _selectedDateTime = await picker.showAdaptiveDatePicker(
    context: context,
    initialDate: NepaliDateTime.now(),
    firstDate: NepaliDateTime(2000),
    lastDate: NepaliDateTime(2090),
    language: _language,
    dateOrder: _dateOrder, // for iOS only
    initialDatePickerMode: DatePickerMode.day, // for platform except iOS
);

Screenshots #

Material Design (Portrait)

Portrait Screenshot

Material Design (Landscape)

Landscape Screenshot

Cupertino Design

Cupertino English

Cupertino Nepali

Example #

Detailed Example

License #

Copyright 2019 Sarbagya Dhaubanjar. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.
    * Neither the name of Google Inc. nor the names of its
      contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

[3.2.0+1] - January 25, 2020

  • Updated nepali_utils to latest version.
  • Memory Optimizations

[3.2.0] - November 21, 2019

  • [Improvement] Code Refactor.

[3.1.0+1] - August 3, 2019

  • Update to support up to 2099 B.S.
  • Updated nepali_utils dependency.
  • Minor layout related fixes.
  • Example updated with time picker

[3.0.1] -July 30, 2019

  • FIXED Resolved selected date being overflowed.
  • FIXED Added Nepali Language support to Year Picker.

[3.0.0] - June 16, 2019

Version 3 introduces Cupertino style Date picker.

  • BREAKING CHANGES In order to maintain consistency. showNepaliDatePicker is now replace with showMaterialDatePicker.
  • [Feature Added] showCupertinoDatePicker and showAdaptiveDatePicker added.

[2.0.0] - May 19, 2019

This is a completely re-written version, so include BREAKING CHANGES.

  • [Improved] Works on any screen sizes without layout problems.
  • [Feature Added] Includes semantics i.e ease of access.
  • [Improved] Now backed by nepali_utils.
  • [Feature Added] Fuchsia Compatible.

[1.2.2] - April 25, 2019

  • Added buttons to adjust month.
  • Breaking Change Dart constraint is now >=2.1.0 <3.0.0

[1.2.1] - December 24, 2018

  • Documentation adn Example Added.

[1.2.0] - December 23, 2018

  • Changes in ReadMe

[1.1.0] - December 23, 2018

  • Initial Release

example/README.md

Nepali Date Picker Example #

Scaffold(
      appBar: AppBar(
        title: Text("Nepali Date Picker"),
        centerTitle: true,
      ),
      body: Center(
        child: MaterialButton(
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(
                  Radius.circular(20),
                ),
              ),
              color: Colors.pink,
              onPressed: () async {
                _selectedDateTime = await showNepaliDatePicker(
                  context: context,
                  initialDate: NepaliDateTime.now(),
                  firstDate: NepaliDateTime(2000),
                  lastDate: NepaliDateTime(2090),
                  language: _language,
                );
                setState(() {});
              },
              child: Padding(
                padding: const EdgeInsets.all(8.0),
                child: Text(
                  'SELECT DATE',
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 20.0,
                    fontWeight: FontWeight.w300,
                  ),
                ),
              ),
            ),
      ),
    );

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  nepali_date_picker: ^3.2.0+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:nepali_date_picker/nepali_date_picker.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
71
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
86
Learn more about scoring.

We analyzed this package on Feb 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
flutter 0.0.0
nepali_utils >=2.2.0 <3.0.0 2.2.0+2
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test