flutter_calendar_collection 1.0.1 copy "flutter_calendar_collection: ^1.0.1" to clipboard
flutter_calendar_collection: ^1.0.1 copied to clipboard

A comprehensive Flutter calendar widget library featuring multiple view modes, visual styles, date pickers, and business scenarios like attendance, booking, and lunar calendar.

example/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_calendar_collection/flutter_calendar_collection.dart';

void main() {
  runApp(const ProviderScope(child: ExampleApp()));
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Calendar Example',
      theme: AppTheme.lightTheme,
      home: const CalendarExample(),
    );
  }
}

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

  @override
  State<CalendarExample> createState() => _CalendarExampleState();
}

class _CalendarExampleState extends State<CalendarExample> {
  DateTime _currentMonth = DateTime.now();
  DateTime? _selectedDate;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Calendar Example')),
      body: Column(
        children: [
          // Navigation header
          CalendarHeader(
            currentDate: _currentMonth,
            title:
                '${_currentMonth.year}-${_currentMonth.month.toString().padLeft(2, '0')}',
            onPrevious: () {
              setState(() {
                _currentMonth = DateTime(
                  _currentMonth.year,
                  _currentMonth.month - 1,
                );
              });
            },
            onNext: () {
              setState(() {
                _currentMonth = DateTime(
                  _currentMonth.year,
                  _currentMonth.month + 1,
                );
              });
            },
            onToday: () {
              setState(() {
                _currentMonth = DateTime.now();
              });
            },
          ),
          // Week header
          const WeekHeader(),
          // Month grid
          Expanded(
            child: MonthGrid(
              month: _currentMonth,
              selectedDate: _selectedDate,
              config: const CalendarConfig(showLunar: true),
              onDateTap: (date) {
                setState(() => _selectedDate = date);
              },
            ),
          ),
        ],
      ),
    );
  }
}
1
likes
130
points
117
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A comprehensive Flutter calendar widget library featuring multiple view modes, visual styles, date pickers, and business scenarios like attendance, booking, and lunar calendar.

Repository (GitHub)
View/report issues

Topics

#calendar #flutter-widget #date-picker #lunar-calendar #scheduling

License

MIT (license)

Dependencies

collection, equatable, fl_chart, flutter, flutter_animate, flutter_localizations, flutter_riverpod, intl, lunar, uuid

More

Packages that depend on flutter_calendar_collection