nepali_date_picker 3.1.0+1

Nepali Date Picker #

Pub Package Licence Download

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 (c) 2019 Sarbagya Dhaubanjar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[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.1.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]
73
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 Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

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