flutter_datetime_picker 1.0.4

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

flutter_datetime_picker

Pub

A flutter date time picker inspired by flutter-cupertino-date-picker

you can choose date / time / date&time in English, Dutch and Chinese, and you can also custom your own picker content

Date pickerTime pickerDate & Time picker (Chinese)Date & Time picker (English-America)Date & Time picker (Dutch)

Usage

FlatButton(
    onPressed: () {
        DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
            print('change $date');
        }, onConfirm: (date) {
            print('confirm $date');
        }, currentTime: DateTime(2008, 12, 31, 23, 12, 34), locale: 'zh');
    },
    child: Text(
        'show date time picker (Chinese)',
        style: TextStyle(color: Colors.blue),
    ));

Getting Started

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

For help on editing package code, view the documentation.

[0.1.0] - initial submit

[0.1.1] - add time picker and date time picker, add i18n

[0.1.2] - fix bugs

[0.1.3] - fix bugs

[0.1.4] - change screenshot path

[0.1.5] - change screenshot path

[0.1.6] - sync

[0.1.7] - pub.dartlang.org bug, re-submit

[0.1.8] - update description

[0.1.9] - update description

[0.1.10] - update description

[1.0.0] - release stable version

[1.0.1] - fix day bug when changing month

[1.0.2] - add Dutch support

[1.0.3] - add Dutch in demo

[1.0.4] - add Dutch in readme

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or press Run > Flutter Hot Reload in IntelliJ). Notice that the
        // counter didn't reset back to zero; the application is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: new HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Datetime Picker'),
      ),
      body: Center(
        child: Column(
          children: <Widget>[
            FlatButton(
                onPressed: () {
                  DatePicker.showDatePicker(context, showTitleActions: true, onChanged: (date) {
                    print('change $date');
                  }, onConfirm: (date) {
                    print('confirm $date');
                  }, currentTime: DateTime(2008, 12, 31, 23, 12, 34), locale: LocaleType.zh);
                },
                child: Text(
                  'show date picker',
                  style: TextStyle(color: Colors.blue),
                )),
            FlatButton(
                onPressed: () {
                  DatePicker.showTimePicker(context, showTitleActions: true, onChanged: (date) {
                    print('change $date');
                  }, onConfirm: (date) {
                    print('confirm $date');
                  }, currentTime: DateTime(2008, 12, 31, 23, 12, 34));
                },
                child: Text(
                  'show time picker',
                  style: TextStyle(color: Colors.blue),
                )),
            FlatButton(
                onPressed: () {
                  DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
                    print('change $date');
                  }, onConfirm: (date) {
                    print('confirm $date');
                  }, currentTime: DateTime(2008, 12, 31, 23, 12, 34), locale: LocaleType.zh);
                },
                child: Text(
                  'show date time picker (Chinese)',
                  style: TextStyle(color: Colors.blue),
                )),
            FlatButton(
                onPressed: () {
                  DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
                    print('change $date');
                  }, onConfirm: (date) {
                    print('confirm $date');
                  }, currentTime: DateTime(2008, 12, 31, 23, 12, 34));
                },
                child: Text(
                  'show date time picker (English-America)',
                  style: TextStyle(color: Colors.blue),
                )),
            FlatButton(
                onPressed: () {
                  DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
                    print('change $date');
                  }, onConfirm: (date) {
                    print('confirm $date');
                  }, currentTime: DateTime(2008, 12, 31, 23, 12, 34), locale: LocaleType.nl);
                },
                child: Text(
                  'show date time picker (Dutch)',
                  style: TextStyle(color: Colors.blue),
                )),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_datetime_picker: ^1.0.4

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_datetime_picker/flutter_datetime_picker.dart';
  
Version Uploaded Documentation Archive
1.0.4 Oct 15, 2018 Go to the documentation of flutter_datetime_picker 1.0.4 Download flutter_datetime_picker 1.0.4 archive
1.0.3 Oct 15, 2018 Go to the documentation of flutter_datetime_picker 1.0.3 Download flutter_datetime_picker 1.0.3 archive
1.0.2 Sep 27, 2018 Go to the documentation of flutter_datetime_picker 1.0.2 Download flutter_datetime_picker 1.0.2 archive
1.0.1 Sep 11, 2018 Go to the documentation of flutter_datetime_picker 1.0.1 Download flutter_datetime_picker 1.0.1 archive
1.0.0 Sep 4, 2018 Go to the documentation of flutter_datetime_picker 1.0.0 Download flutter_datetime_picker 1.0.0 archive
0.1.10 Sep 4, 2018 Go to the documentation of flutter_datetime_picker 0.1.10 Download flutter_datetime_picker 0.1.10 archive
0.1.9 Sep 4, 2018 Go to the documentation of flutter_datetime_picker 0.1.9 Download flutter_datetime_picker 0.1.9 archive
0.1.8 Sep 4, 2018 Go to the documentation of flutter_datetime_picker 0.1.8 Download flutter_datetime_picker 0.1.8 archive
0.1.7 Sep 4, 2018 Go to the documentation of flutter_datetime_picker 0.1.7 Download flutter_datetime_picker 0.1.7 archive
0.1.6 Aug 31, 2018 Go to the documentation of flutter_datetime_picker 0.1.6 Download flutter_datetime_picker 0.1.6 archive

All 16 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
83
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]
92
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 >=2.0.0-dev.28.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
Dev dependencies
flutter_test