date_field 0.2.2 copy "date_field: ^0.2.2" to clipboard
date_field: ^0.2.2 copied to clipboard

outdated

Contains DateField and DateFormField which allows the user to pick a DateTime from an input field!

example/main.dart

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  runApp(ExampleApp());
}

class ExampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(title: 'Example app', home: HomeWidget());
  }
}

class HomeWidget extends StatefulWidget {
  @override
  _HomeWidgetState createState() => _HomeWidgetState();
}

class _HomeWidgetState extends State<HomeWidget> {
  DateTime selectedDate;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: <Widget>[
          Column(
            children: <Widget>[
              DateField(

                selectedDate: selectedDate,
                onDateSelected: (DateTime date) {
                  setState(() {
                    selectedDate = date;
                  });
                },
                lastDate: DateTime(2020),
              ),
            ],
          ),
        ],
      ),
    );
  }
}
117
likes
0
pub points
97%
popularity

Publisher

verified publishergaspardmerten.dev

Contains DateField and DateFormField which allows the user to pick a DateTime from an input field!

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, intl

More

Packages that depend on date_field