flutter_modal_date_picker 0.1.1 copy "flutter_modal_date_picker: ^0.1.1" to clipboard
flutter_modal_date_picker: ^0.1.1 copied to clipboard

A fancy and highly customizable date picker for Flutter

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_modal_date_picker/flutter_modal_date_picker.dart';

void main() {
  runApp(MaterialApp(theme: ThemeData(), home: MyApp()));
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String date = "";

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
          backgroundColor: Colors.white,
          body: Container(
            child: Center(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  ElevatedButton(
                    child: Text(
                      'show date picker',
                      style: TextStyle(fontSize: 30),
                    ),
                    onPressed: () async {
                      String chosenDate =
                          await showModalDatePicker(context, DateTime.now());
                      setState(() {
                        date = chosenDate;
                      });
                    },
                  ),
                  SizedBox(
                    height: 20,
                  ),
                  Text(
                    date,
                    style: TextStyle(
                      backgroundColor: Colors.amber,
                      fontSize: 30
                    ),
                  )
                ],
              ),
            ),
          )),
    );
  }
}
1
likes
110
pub points
0%
popularity

Publisher

unverified uploader

A fancy and highly customizable date picker for Flutter

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

auto_size_text, flutter, flutter_svg, intl

More

Packages that depend on flutter_modal_date_picker