datetime_picker_formfield 0.1.2 copy "datetime_picker_formfield: ^0.1.2" to clipboard
datetime_picker_formfield: ^0.1.2 copied to clipboard

discontinued
outdated

A Flutter widget that wraps a TextFormField and integrates the date and/or time picker dialogs.

example/main.dart

import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
import 'package:datetime_picker_formfield/time_picker_formfield.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Date-Time Picker example',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  MyHomePageState createState() {
    return new MyHomePageState();
  }
}

class MyHomePageState extends State<MyHomePage> {
  final dateFormat = DateFormat("EEEE, MMMM d, yyyy 'at' h:mma");
  final timeFormat = DateFormat("h:mm a");
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView(
        children: <Widget>[
          DateTimePickerFormField(
            format: dateFormat,
            onChanged: (date) {
              Scaffold
                  .of(context)
                  .showSnackBar(SnackBar(content: Text('$date')));
            },
          ),
          TimePickerFormField(
            format: timeFormat,
            onChanged: (time) {
              Scaffold
                  .of(context)
                  .showSnackBar(SnackBar(content: Text('$time')));
            },
          ),
          DateTimePickerFormField(
            format: dateFormat,
            enabled: false,
          ),
          TimePickerFormField(
            format: toDateFormat(TimeOfDayFormat.HH_colon_mm),
            enabled: false,
          ),
        ],
      ),
    );
  }
}
245
likes
0
pub points
97%
popularity

Publisher

verified publisherdefylogic.dev

A Flutter widget that wraps a TextFormField and integrates the date and/or time picker dialogs.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, intl

More

Packages that depend on datetime_picker_formfield