kalender 0.31.2 copy "kalender: ^0.31.2" to clipboard
kalender: ^0.31.2 copied to clipboard

A highly customizable calendar widget with day, multi-day, month and schedule views, drag-and-drop rescheduling, event resizing, and timezone support.

example/README.md

Example #

A complete calendar, using only the base KalenderEvent class with no custom fields. Tapping an empty slot creates an event, which takes a long press on a phone or tablet. Events can be dragged and resized.

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(body: MyCalendar()),
    );
  }
}

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

  @override
  State<MyCalendar> createState() => _MyCalendarState();
}

class _MyCalendarState extends State<MyCalendar> {
  final eventsController = DefaultEventsController();
  final kalenderController = KalenderController();

  @override
  void dispose() {
    kalenderController.dispose();
    eventsController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return KalenderView(
      eventsController: eventsController,
      kalenderController: kalenderController,
      viewConfiguration: MultiDayViewConfiguration.week(
        // Without this the day opens at midnight.
        initialTimeOfDay: const KalenderTime(hour: 7, minute: 0),
      ),
      callbacks: KalenderCallbacks(
        onEventCreated: (event) => eventsController.addEvent(event),
      ),
      header: KalenderHeader(),
      body: KalenderBody(),
    );
  }
}

For a real app you almost always want custom fields on your events. The Events guide covers subclassing KalenderEvent, and the documentation index lists the rest.

Runnable examples #

The examples index lists all ten with what each one shows.

187
likes
160
points
74.2k
downloads

Documentation

API reference

Publisher

verified publisherkdab.com

Weekly Downloads

A highly customizable calendar widget with day, multi-day, month and schedule views, drag-and-drop rescheduling, event resizing, and timezone support.

Repository (GitHub)
View/report issues
Contributing

Topics

#calendar #widget #scheduler #timezone #drag-and-drop

License

MIT (license)

Dependencies

collection, flutter, intl, linked_pageview, meta, scrollable_positioned_list, timezone, universal_platform

More

Packages that depend on kalender