easy_calendar_picker 0.1.3 copy "easy_calendar_picker: ^0.1.3" to clipboard
easy_calendar_picker: ^0.1.3 copied to clipboard

A simple and customizable calendar picker for Flutter. This package support single and range pick

example/lib/main.dart

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

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  DateTime? _dateTime;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Text("$_dateTime"),
            const SizedBox(height: 30),
            FilledButton(
              onPressed: () {
                showBottomCalendarPicker(
                  context,
                  labelConfig: LabelConfiguration(
                      name: 'App Calendar',
                      textStyle: const TextStyle(fontSize: 18)),
                  pickType: CalendarPickerType.range,
                  calendarStyle: CalendarStyle(
                      textPlaceholderColor: Colors.red,
                      placeholderColor: Colors.pink),
                  onTapDate: (val) {
                    setState(() {
                      _dateTime = val;
                    });
                  },
                  onRangeChanged: (fromDate, toDate) {},
                );
              },
              child: const Text("Show calendar"),
            ),
          ],
        ),
      ),
    );
  }
}
2
likes
130
points
59
downloads

Publisher

unverified uploader

Weekly Downloads

A simple and customizable calendar picker for Flutter. This package support single and range pick

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

dartx, flutter, gap, intl

More

Packages that depend on easy_calendar_picker