Giter Club home page Giter Club logo

date_time_picker_widget's Introduction

date_time_picker_widget

pub package

This package brings us a way to pick date and time with fresh new UI design

Usage

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  date_time_picker_widget: ^0.1.0

In your library add the following import:

import 'package:date_time_picker_widget/date_time_picker_widget.dart';

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

Example

There are three presentations for DateTimePickerWidget and can be defined in the type parameter:

  • DateTimePickerType.Date will present date picker;
  • DateTimePickerType.Time will present time picker;
  • DateTimePickerType.Both will present date and time picker both;
DateTimePicker(
  type: DateTimePickerType.Both, // options: [Date | Time | Both], default is Both
  ...
)

More complete example:

DateTimePicker(
  initialSelectedDate: dt,
  startDate: dt.add(Duration(days: 1)),
  endDate: dt.add(Duration(days: 60)),
  startTime: DateTime(dt.year, dt.month, dt.day, 6),
  endTime: DateTime(dt.year, dt.month, dt.day, 18),
  timeInterval: Duration(minutes: 15),
  datePickerTitle: 'Pick your preferred date',
  timePickerTitle: 'Pick your preferred time',
  timeOutOfRangeError: 'Sorry shop is closed now',
  is24h: false,
  onDateChanged: (date) {
    setState(() {
      _d1 = DateFormat('dd MMM, yyyy').format(date);
    });
  },
  onTimeChanged: (time) {
    setState(() {
      _t1 = DateFormat('hh:mm:ss aa').format(time);
    });
  },
)

Demo

Demo

Screen Shot

Screenshot

date_time_picker_widget's People

Contributors

pasaneramusugoda avatar rithviknishad 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.