calendar_picker 0.0.1-alpha copy "calendar_picker: ^0.0.1-alpha" to clipboard
calendar_picker: ^0.0.1-alpha copied to clipboard

Material Calendar Picker with additional feature that allows you exclude multiple specific date

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: HomeView(),
    );
  }
}

class HomeView extends StatelessWidget {
  const HomeView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: MaterialButton(
            color: Colors.blue,
            onPressed: () {
              showCustomCalendarPicker(
                context: context,
                initialDate: DateTime.now(),
                firstDate: DateTime.now(),
                lastDate: DateTime.now().add(const Duration(days: 30)),
                excluded: [
                  DateTime.now().add(const Duration(days: 2)),
                  DateTime.now().add(const Duration(days: 5)),
                  DateTime.now().subtract(const Duration(days: 5)),
                ],
                onSelected: (date) {
                  print("date $date");
                },
              );
            },
            child: const Text(
              "calendar picker",
              style: TextStyle(color: Colors.white),
            ),
          ),
        ),
      ),
    );
  }
}
0
likes
150
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

Material Calendar Picker with additional feature that allows you exclude multiple specific date

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, intl

More

Packages that depend on calendar_picker