kalender 0.31.0-dev.1 copy "kalender: ^0.31.0-dev.1" to clipboard
kalender: ^0.31.0-dev.1 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, and 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 #

Example Shows
Basic All view types with a toolbar, sample events, and custom tiles. Start here.
Advanced A custom event layout with a lane per person, zoom, and tap-location-aware event creation.
Recurrence Recurring events built on top of the package, which has no recurrence of its own.
ICS Importing and exporting .ics files, expanding RRULE recurrence lazily over the visible range.
Riverpod Sharing the controllers and the selected view through providers.
intl4x The calendar's localized strings rendered with intl4x instead of intl.
material_ui The calendar inside an app that uses the standalone material_ui package.
Web demo The source behind the live demo: every option, theming, locales, and a split view.
187
likes
0
points
69.3k
downloads

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

Topics

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

License

unknown (license)

Dependencies

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

More

Packages that depend on kalender