flutter_cupertino_date_picker 0.1.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 96

Flutter Cupertino Date Picker

[pub packages] | 中文说明

Flutter cupertino date picker.

Example

Usage

1. Depend

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

dependencies:
  flutter_cupertino_date_picker: ^0.1.0

2. Install

Run command:

$ flutter packages get

3. Import

Import in Dart code:

import 'packages:flutter_cupertino_date_picker/flutter_cupertino_date_picker.dart';

4. Display DatePicker

///
/// context: BuildContext.
/// showTitleActions: Display confirm and cancel button in title bar or not.
/// local: i18n, 'zh' for Chinese, default is English.
/// minYear: Min value of year's selection range. Default is 1900.
/// maxYear: Max value of year's selection range. Default is 2100.
/// initialYear: Initial value of year.
/// initialMonth: Initial value of month.
/// initialDate: Initial value of date.
/// dateFormat: Format English months.
/// onChange: An option callback when the currently selected datetime changes.
/// onConfirm: An option callback when tap the confirm button in title bar.
DatePicker.showDatePicker(
  context,
  showTitleActions: true,
  locale: 'zh',
  minYear: 1970,
  maxYear: 2020,
  initialYear: 2018,
  initialMonth: 6,
  initialDate: 21,
  dateFormat: 'yyyy-mm-dd'
  onChanged: (year, month, date) { },
  onConfirm: (year, month, date) { },
);

showTitleActions: false

Example: showTitleActions=false

locale: 'zh'

i18n, default is English

Thanks to: Robbie Boyd

Example: locale=zh

dateFormat: 'yyyy-mmm-dd'

Just support English months.

It will also put the Pickers in the same order. The date String output does not change

dd-mm-yyyy -> 1-10-2018
dd-mmm-yyyy -> 1-Oct-2018
dd-mmmm-yyyy -> 1-October-2018

Example: dateFormat

Example

Example sources

Futures

  1. Format datetime display.

License

Copyright 2018 wuzhen

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

0.1.0

  • Refactor locale message.

0.0.7

  • Support locale Portuguese Brazil (pt-br)

0.0.6

  • Support English months.

0.0.5

  • Fix month and day in zh locale.

0.0.4

  • Support i18n.

0.0.2

  • Complete README file.

0.0.1

  • Initial Release.

example/README.md

Date Picker Example

A Flutter application example of DatePicker.

Getting Started

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

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_cupertino_date_picker: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_cupertino_date_picker/flutter_cupertino_date_picker.dart';
  
Version Uploaded Documentation Archive
0.1.0 Nov 13, 2018 Go to the documentation of flutter_cupertino_date_picker 0.1.0 Download flutter_cupertino_date_picker 0.1.0 archive
0.0.7 Oct 8, 2018 Go to the documentation of flutter_cupertino_date_picker 0.0.7 Download flutter_cupertino_date_picker 0.0.7 archive
0.0.6 Sep 4, 2018 Go to the documentation of flutter_cupertino_date_picker 0.0.6 Download flutter_cupertino_date_picker 0.0.6 archive
0.0.5 Aug 22, 2018 Go to the documentation of flutter_cupertino_date_picker 0.0.5 Download flutter_cupertino_date_picker 0.0.5 archive
0.0.4 Aug 2, 2018 Go to the documentation of flutter_cupertino_date_picker 0.0.4 Download flutter_cupertino_date_picker 0.0.4 archive
0.0.3 Jun 22, 2018 Go to the documentation of flutter_cupertino_date_picker 0.0.3 Download flutter_cupertino_date_picker 0.0.3 archive
0.0.2+1 Jun 22, 2018 Go to the documentation of flutter_cupertino_date_picker 0.0.2+1 Download flutter_cupertino_date_picker 0.0.2+1 archive
0.0.2 Jun 22, 2018 Go to the documentation of flutter_cupertino_date_picker 0.0.2 Download flutter_cupertino_date_picker 0.0.2 archive
0.0.1 Jun 21, 2018 Go to the documentation of flutter_cupertino_date_picker 0.0.1 Download flutter_cupertino_date_picker 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
91
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]
96
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8