clean_calendar 0.5.2 copy "clean_calendar: ^0.5.2" to clipboard
clean_calendar: ^0.5.2 copied to clipboard

outdated

A brand-new Flutter calendar package that enables you to make a simple, lovely, and customizable calendar.

example/lib/main.dart

import 'package:clean_calendar/clean_calendar.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:example/Theme/app_theme_data.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 DynamicColorBuilder(
      builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
        return MaterialApp(
          debugShowCheckedModeBanner: false,
          title: 'Calendar App',
          theme: AppThemeData.lightThemeData(lightDynamic),
          darkTheme: AppThemeData.darkThemeData(darkDynamic),
          themeMode: ThemeMode.system,
          home: const Home(),
        );
      },
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 2,
        title: const Text("Calendar"),
      ),
      body: Center(
        child: ListView(
          children: [
            CleanCalendar(
              enableDenseViewForDates: true,
              enableDenseSplashForDates: true,
              datesForStreaks: [
                DateTime(2022, 8, 5),
                DateTime(2022, 8, 6),
                DateTime(2022, 8, 7),
                DateTime(2022, 8, 9),
                DateTime(2022, 8, 10),
                DateTime(2022, 8, 11),
                DateTime(2022, 8, 13),
                DateTime(2022, 8, 20),
                DateTime(2022, 8, 21),
                DateTime(2022, 8, 23),
                DateTime(2022, 8, 24),
              ],
              dateSelectionMode: DatePickerSelectionMode.single,
            ),
            const SizedBox(
              height: 20,
            ),
            CleanCalendar(
              datePickerCalendarView: DatePickerCalendarView.weekView,
              enableDenseViewForDates: true,
              enableDenseSplashForDates: true,
              datesForStreaks: [
                DateTime(2022, 8, 5),
                DateTime(2022, 8, 6),
                DateTime(2022, 8, 7),
                DateTime(2022, 8, 9),
                DateTime(2022, 8, 10),
                DateTime(2022, 8, 11),
                DateTime(2022, 8, 13),
                DateTime(2022, 8, 20),
                DateTime(2022, 8, 21),
                DateTime(2022, 8, 23),
                DateTime(2022, 8, 24),
              ],
              dateSelectionMode: DatePickerSelectionMode.single,
              onCalendarViewDate: (DateTime calendarViewDate) {
                // print(calendarViewDate);
              },
            ),
            CleanCalendar(
              datePickerCalendarView: DatePickerCalendarView.weekView,
              enableDenseViewForDates: true,
              enableDenseSplashForDates: true,
              datesForStreaks: [
                DateTime(2022, 8, 5),
                DateTime(2022, 8, 6),
                DateTime(2022, 8, 7),
                DateTime(2022, 8, 9),
                DateTime(2022, 8, 10),
                DateTime(2022, 8, 11),
                DateTime(2022, 8, 13),
                DateTime(2022, 8, 20),
                DateTime(2022, 8, 21),
                DateTime(2022, 8, 23),
                DateTime(2022, 8, 24),
              ],
              dateSelectionMode: DatePickerSelectionMode.single,
              onCalendarViewDate: (DateTime calendarViewDate) {
                // print(calendarViewDate);
              },
              startWeekday: WeekDay.monday,
              weekdaysSymbol: const ["m", "t", "w", "t", "f", "s", "s"],
              monthsSymbol: const [
                "Jan",
                "Feb",
                "Mar",
                "Apr",
                "May",
                "Jun",
                "Jul",
                "Aug",
                "Sep",
                "Oct",
                "Nov",
                "Dec"
              ],
            ),
          ],
        ),
      ),
    );
  }
}
70
likes
0
pub points
87%
popularity

Publisher

verified publisherdeepanshuchaudhary.com

A brand-new Flutter calendar package that enables you to make a simple, lovely, and customizable calendar.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_riverpod

More

Packages that depend on clean_calendar