wheel_date_picker_sheet 0.1.0 copy "wheel_date_picker_sheet: ^0.1.0" to clipboard
wheel_date_picker_sheet: ^0.1.0 copied to clipboard

A modern, easy date and time picker shown as a bottom sheet with scrolling day / month / year (and hour / minute) wheels. dd/MM/yyyy preview, future dates, English and Lao labels built in.

example/lib/main.dart

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

void main() => runApp(const MaterialApp(home: ExamplePage()));

class ExamplePage extends StatefulWidget {
  const ExamplePage({super.key});

  @override
  State<ExamplePage> createState() => _ExamplePageState();
}

class _ExamplePageState extends State<ExamplePage> {
  DateTime? _dob;
  DateTime? _expiry;
  TimeOfDay? _time;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('wheel_date_picker_sheet')),
      body: ListView(
        padding: const EdgeInsets.all(16),
        children: [
          ListTile(
            title: const Text('Date of birth'),
            subtitle: Text(_dob == null ? '—' : formatDdMmYyyy(_dob!)),
            onTap: () async {
              final d = await showWheelDatePicker(
                context: context,
                initialDate: _dob,
                lastDate: DateTime.now(),
              );
              if (d != null) setState(() => _dob = d);
            },
          ),
          ListTile(
            title: const Text('Document expiry date'),
            subtitle: Text(_expiry == null ? '—' : formatDdMmYyyy(_expiry!)),
            onTap: () async {
              final d = await showWheelDatePicker(
                context: context,
                initialDate: _expiry ?? DateTime.now(),
                labels: WheelPickerLabels.lo,
              );
              if (d != null) setState(() => _expiry = d);
            },
          ),
          ListTile(
            title: const Text('Time'),
            subtitle: Text(_time == null ? '—' : _time!.format(context)),
            onTap: () async {
              final t = await showWheelTimePicker(context: context, initialTime: _time ?? TimeOfDay.now());
              if (t != null) setState(() => _time = t);
            },
          ),
        ],
      ),
    );
  }
}
0
likes
150
points
346
downloads

Documentation

API reference

Publisher

verified publisherljthao.com

Weekly Downloads

A modern, easy date and time picker shown as a bottom sheet with scrolling day / month / year (and hour / minute) wheels. dd/MM/yyyy preview, future dates, English and Lao labels built in.

Repository (GitHub)
View/report issues

Topics

#date-picker #datepicker #time-picker #bottom-sheet #wheel

License

MIT (license)

Dependencies

flutter

More

Packages that depend on wheel_date_picker_sheet