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

A customizable and lightweight Flutter calendar widget package supporting day and list-based selections with user-defined decorations.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:m_calendar/m_calendar.dart';
import 'package:m_calendar/model/marked_date_model.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: SafeArea(
        child: Center(
          child: MCalendar(
            isRangeSelection: true,
            selectedMonth: DateTime(2025, 4),
            decoration: BoxDecoration(
              color: Colors.grey.shade200,
              borderRadius: BorderRadius.circular(6),
            ),
            userPickedDecoration: const BoxDecoration(color: Colors.lightBlue),
            weekNameHeaderStyle: const TextStyle(fontSize: 20, color: Colors.black54),
            markedDaysList: [
              MarkedDaysModel(
                selectedDateList: [7, 12, 14, 16],
                decoration: BoxDecoration(
                  gradient: LinearGradient(
                    colors: [
                      Colors.orange.shade300,
                      Colors.deepOrange.shade400,
                    ],
                    begin: Alignment.topLeft,
                    end: Alignment.bottomRight,
                  ),
                  borderRadius: BorderRadius.circular(10),
                  boxShadow: [
                    BoxShadow(
                      color: Colors.orange.shade100,
                      blurRadius: 6,
                      offset: const Offset(2, 2),
                    ),
                  ],
                ),
              ),
              MarkedDaysModel(
                selectedDateList: [5],
                decoration: BoxDecoration(
                  color: Colors.purple.shade600,
                  borderRadius: BorderRadius.circular(10),
                  boxShadow: [
                    BoxShadow(
                      color: Colors.purple.shade100,
                      blurRadius: 6,
                      offset: const Offset(2, 2),
                    ),
                  ],
                ),
                child: const Icon(Icons.star, color: Colors.white, size: 20),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
8
likes
0
points
12
downloads

Publisher

unverified uploader

Weekly Downloads

A customizable and lightweight Flutter calendar widget package supporting day and list-based selections with user-defined decorations.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, provider

More

Packages that depend on m_calendar