### Install Application Bundle Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/CMakeLists.txt Configures the installation process to create a relocatable application bundle, including cleaning the build directory and installing executable, data, and libraries. ```cmake set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Install Executable Target Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Installs the main executable target to the specified runtime destination. This makes the application executable available after the installation step. ```cmake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) ``` -------------------------------- ### Install Flutter Library Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Installs the main Flutter library file to the root of the application bundle's installation directory. This makes the core Flutter runtime available. ```cmake install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Setup CalendarControllerProvider Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Wrap your MaterialApp with CalendarControllerProvider and assign an EventController to it for basic setup. ```dart CalendarControllerProvider( controller: EventController(), child: MaterialApp( // Your initialization for material app. ), ) ``` -------------------------------- ### Install Flutter Packages Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md After updating your pubspec.yaml file, run this command in your terminal to fetch and install the necessary packages for your Flutter project. ```bash flutter pub get ``` -------------------------------- ### Install Bundled Plugin Libraries Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Installs any bundled plugin libraries to the application bundle's library directory. This ensures that plugin dependencies are correctly placed. ```cmake if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Clone Repository Example Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/CONTRIBUTING.md Clone the forked repository to your local development machine. Replace placeholders with your GitHub username and desired repository name. ```bash git clone git@github.com:/flutter_calendar_view.git ``` -------------------------------- ### Push New Branch Example Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/CONTRIBUTING.md Push your new branch to your own fork on GitHub. Replace 'my-username.my-new-feature' with your username and branch name. ```bash git push origin my-username.my-new-feature ``` -------------------------------- ### Deprecated Method Example Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/CONTRIBUTING.md Example of marking a method as deprecated. Include a message specifying the version it will be removed and the alternative method to use. ```dart @Deprecated('Will be removed in v1.5.0, use nonDeprecatedFeature() instead') void deprecatedFeature() {} ``` -------------------------------- ### Install AOT Library Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Installs the Ahead-Of-Time (AOT) compiled library to the data directory, but only for Profile and Release build configurations. This optimizes runtime performance for non-debug builds. ```cmake # Install the AOT library on non-Debug builds only. install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Commit Changes Example Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/CONTRIBUTING.md Commit your changes with a clear and concise message. Use conventional commit prefixes like 'Fixes' or 'feat:'. ```bash git commit -m 'Fixes duplicate key found in example' ``` -------------------------------- ### Set Installation RPATH Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Configures the runtime search path for libraries relative to the executable. This is useful for ensuring the application can find its dependencies when installed. ```cmake set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") ``` -------------------------------- ### Set Installation Prefix for Windows Bundles Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Configures the installation prefix to be next to the executable for Windows builds. This ensures that all necessary files are co-located, allowing the application to run directly from the build directory. ```cmake # === Installation === # Support files are copied into place next to the executable, so that it can # run in place. This is done instead of making a separate bundle (as on Linux) # so that building and running from within Visual Studio will work. set(BUILD_BUNDLE_DIR "$") # Make the "install" step default, as it's required to run. set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") ``` -------------------------------- ### MultiDayView Customization Example Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md This snippet demonstrates a comprehensive set of customizations for the MultiDayView, including custom builders, date/time boundaries, view dimensions, multi-day configurations, event handling, hour settings, indicator styles, and page transitions. It shows how to configure event tiles, time lines, headers, and various visual elements like lines and dividers. It also includes event handling callbacks and scroll behavior settings. ```dart MultiDayView( controller: EventController(), // Custom builders eventTileBuilder: (date, events, boundry, start, end) { // Return your widget to display as event tile. return Container(); }, timeLineBuilder: (date) => Text(date.toString()), weekPageHeaderBuilder: WeekHeader.hidden, // To hide week header weekDetectorBuilder: ({date, height, width, heightPerMinute, minuteSlotSize}) => Container(), weekDayBuilder: (date) => Text(date.day.toString()), weekNumberBuilder: (weekNumber) => Text('W$weekNumber'), // Custom string builders for I18n headerStringBuilder: (date, {secondaryDate}) => '${date.month}/${date.year}', timeLineStringBuilder: (date) => '${date.hour}:${date.minute}', weekDayStringBuilder: (weekDay) => ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][weekDay], weekDayDateStringBuilder: (date) => '${date.day}', fullDayEventBuilder: (events, date) { // Return your widget to display full day event view. return Container(); }, // Time and date boundaries minDay: DateTime(1990), maxDay: DateTime(2050), initialDay: DateTime(2021), heightPerMinute: 1, // Height occupied by 1 minute time span. timeLineWidth: 60, // Width of time line timeLineOffset: 0, // Offset of time line width: 400, // Width of multi-day view // Multi-day configuration daysInView: 3, // Number of days to display (default is 3) weekTitleHeight: 50, // Height of week day title showVerticalLines: true, // Show the vertical line between days showWeekDayAtBottom: false, // Show week day at bottom position showLiveTimeLineInAllDays: true, // Display live time line in all pages showHalfHours: false, // Show half hour indicator showQuarterHours: false, // Show quarter hour indicator showWeekDayBottomLine: true, // Display workday bottom line // Event handling eventArranger: SideEventArranger(), // Define how simultaneous events will be arranged onEventTap: (events, date) => print(events), onEventDoubleTap: (events, date) => print(events), onEventLongTap: (events, date) => print(events), onDateLongPress: (date) => print(date), onDateTap: (date) => print('Tapped: $date'), onTimestampTap: (date) => print('Timestamp tapped: $date'), onHeaderTitleTap: () => print('Header tapped'), // Hour settings startHour: 5, // Set the first hour displayed endHour: 20, // Set the end hour displayed emulateVerticalOffsetBy: 0, // Emulates offset of vertical line from hour line // Hour indicator settings hourIndicatorSettings: HourIndicatorSettings( color: Colors.greenAccent, lineStyle: LineStyle.dashed, ), halfHourIndicatorSettings: HourIndicatorSettings( color: Colors.redAccent, lineStyle: LineStyle.dashed, ), quarterHourIndicatorSettings: HourIndicatorSettings( color: Colors.blueAccent, lineStyle: LineStyle.dashed, ), // Custom hour line painter hourLinePainter: (lineColor, lineHeight, offset, minuteHeight, showVerticalLine, verticalLineOffset, lineStyle, dashWidth, dashSpaceWidth, emulateVerticalOffsetBy, startHour, endHour) { return // Your custom painter. }, // Live time indicator liveTimeIndicatorSettings: LiveTimeIndicatorSettings( color: Colors.red, showTime: true, // Support for different timezones - provide custom DateTime function currentTimeProvider: () => DateTime.now(), ), // Divider settings dividerSettings: DividerSettings( thickness: 2, height: 2, color: Colors.blueAccent, indent: 10, endIndent: 10, ), // Page transition settings pageTransitionDuration: Duration(milliseconds: 300), pageTransitionCurve: Curves.ease, // Minute slot size for long press callbacks minuteSlotSize: MinuteSlotSize.minutes60, // Background color backgroundColor: Colors.white, // Full day header configuration fullDayHeaderTitle: 'All day', fullDayHeaderTextConfig: FullDayHeaderTextConfig( textAlign: TextAlign.center, textOverflow: TextOverflow.ellipsis, maxLines: 2, ), // Scroll configuration scrollOffset: 0.0, scrollPhysics: ScrollPhysics(), // ScrollPhysics for vertical scrolling pageViewPhysics: ScrollPhysics(), // ScrollPhysics for page view keepScrollOffset: true, // Maintain scroll offset when the page changes // Header and safe area headerStyle: HeaderStyle( headerTextStyle: TextStyle(fontSize: 18), decoration: BoxDecoration(color: Colors.blue), ), safeAreaOption: SafeAreaOption.all(), onPageChange: (date, pageIndex) => print("$date, Page: $pageIndex"), ); ``` -------------------------------- ### Install Flutter Assets Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Installs the Flutter assets directory to the application's data directory. It first removes any existing assets to ensure a clean copy from the build directory. ```cmake # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install ICU Data File Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Installs the ICU data file, which is necessary for internationalization and localization, to the data directory of the application bundle. ```cmake install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Set Minimum CMake Version and Project Name Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Specifies the minimum required CMake version and names the project. This is a standard starting point for any CMake project. ```cmake cmake_minimum_required(VERSION 3.15) project(example LANGUAGES CXX) ``` -------------------------------- ### Customize MonthView Header Style Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Example of customizing the header style for MonthView, including icon colors and background decoration. This uses `HeaderStyle` to modify the appearance of the calendar's header. ```dart headerStyle: HeaderStyle( leftIconConfig: IconDataConfig(color: Colors.red), rightIconConfig: IconDataConfig(color: Colors.red), decoration: BoxDecoration( color: Theme.of(context).highlightColor, ), ), ``` -------------------------------- ### Import Calendar View Package in Dart Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Import the calendar_view package into your Dart files to start using its calendar functionalities. This import statement makes all the package's components available for use. ```dart import 'package:calendar_view/calendar_view.dart'; ``` -------------------------------- ### Find and check GTK, GLIB, and GIO modules Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/flutter/CMakeLists.txt Uses PkgConfig to find and check for the required GTK, GLIB, and GIO system libraries. This ensures that the necessary development files are available for linking. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) ``` -------------------------------- ### Add Executable and Link Libraries Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/CMakeLists.txt Defines the main executable target, links necessary libraries like 'flutter' and GTK, and sets runtime output directory. ```cmake add_executable(${BINARY_NAME} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) apply_standard_settings(${BINARY_NAME}) target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) add_dependencies(${BINARY_NAME} flutter_assemble) set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) ``` -------------------------------- ### Implement Custom Theme with CalendarThemeProvider Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Recommended approach for applying custom themes using `CalendarThemeProvider`. This allows for granular control over specific view themes like `MonthViewThemeData` by extending the light theme. ```dart CalendarThemeProvider( calendarTheme: CalendarThemeData( monthViewTheme: MonthViewThemeData.light().copyWith( cellInMonthColor: Colors.blue.shade50, cellBorderColor: Colors.blue.shade300, ), dayViewTheme: DayViewThemeData.light(), weekViewTheme: WeekViewThemeData.light(), multiDayViewTheme: MultiDayViewThemeData.light(), ), child: YourApp(), ) ``` -------------------------------- ### Profile Build Configuration Settings Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Copies release build flags and linker options to the profile build configuration. This ensures that the profile build uses similar optimization levels as the release build. ```cmake set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") ``` -------------------------------- ### Format Code with Dart Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/CONTRIBUTING.md Format the entire project code using the dart format command. Ensure this is run before committing changes. ```bash dart format . ``` -------------------------------- ### Set Project and Binary Name Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/CMakeLists.txt Defines the minimum CMake version, project name, and the executable binary name. ```cmake cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) set(BINARY_NAME "example") set(APPLICATION_ID "com.calendar.page.example.example") ``` -------------------------------- ### Configure Build Types (Multi-Config Generators) Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Sets the available build configurations (Debug, Profile, Release) for multi-configuration build systems like Visual Studio. The CACHE STRING "" FORCE ensures these settings are applied and visible in the CMake cache. ```cmake get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" CACHE STRING "" FORCE) else() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() endif() ``` -------------------------------- ### Enable Unicode Support Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Adds preprocessor definitions to enable Unicode support in the project. This is crucial for handling international characters correctly. ```cmake # Use Unicode for all projects. add_definitions(-DUNICODE -D_UNICODE) ``` -------------------------------- ### Customize Day View with Various Builders and Settings Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md This snippet demonstrates how to customize the Day View by providing custom builders for date and time strings, event tiles, and day headers. It also shows how to configure time and date boundaries, visual elements like timelines and lines, and event handling callbacks. ```dart DayView( controller: EventController(), // Custom date string formatter for I18n dateStringBuilder: (date) => '${date.day}/${date.month}/${date.year}', // Custom time string formatter for I18n timeStringBuilder: (date) => '${date.hour}:${date.minute}', // Custom timeline widget builder timeLineBuilder: (date) => Text(date.toString()), // Custom day header builder dayTitleBuilder: DayHeader.hidden, // Custom press detector widget dayDetectorBuilder: ({date, height, width, heightPerMinute, minuteSlotSize}) => Container(), eventTileBuilder: (date, events, boundry, start, end) { // Return your widget to display as event tile. return Container(); }, fullDayEventBuilder: (events, date) { // Return your widget to display full day event view. return Container(); }, // Time and date boundaries minDay: DateTime(1990), maxDay: DateTime(2050), initialDay: DateTime(2021), heightPerMinute: 1, // Height occupied by 1 minute time span. timeLineWidth: 60, // Width of the timeline showVerticalLine: true, // Display vertical line in day view. verticalLineOffset: 5, // Offset of vertical line from hour line backgroundColor: Colors.white, // Background color of day view showLiveTimeLineInAllDays: true, // Display live time line in all pages scrollOffset: 0, // Initial scroll position width: 400, // Width of day view page timeLineOffset: 0, // Offset for timeline // Event handling eventArranger: SideEventArranger(), // Define how simultaneous events are arranged onEventTap: (events, date) => print(events), onEventDoubleTap: (events, date) => print(events), onEventLongTap: (events, date) => print(events), onDateLongPress: (date) => print(date), onDateTap: (date) => print('Tapped: $date'), onTimestampTap: (date) => print('Timestamp tapped: $date'), // Hour settings startHour: 5, // To set the first hour displayed (ex: 05:00) endHour: 20, // To set the end hour displayed // Custom hour line painter hourLinePainter: (lineColor, lineHeight, offset, minuteHeight, showVerticalLine, verticalLineOffset, lineStyle, dashWidth, dashSpaceWidth, emulateVerticalOffsetBy, startHour, endHour) { return // Your custom painter. }, // Hour indicator settings hourIndicatorSettings: HourIndicatorSettings( color: Colors.grey, lineStyle: LineStyle.solid, ), halfHourIndicatorSettings: HourIndicatorSettings( color: Colors.grey.shade300, lineStyle: LineStyle.solid, ), quarterHourIndicatorSettings: HourIndicatorSettings( color: Colors.grey.shade200, lineStyle: LineStyle.solid, ), // Live time indicator liveTimeIndicatorSettings: LiveTimeIndicatorSettings( color: Colors.red, showTime: true, // Support for different timezones - provide custom DateTime function currentTimeProvider: () => DateTime.now(), ), // Page transition settings pageTransitionDuration: Duration(milliseconds: 300), pageTransitionCurve: Curves.ease, // Minute slot size for long press callbacks minuteSlotSize: MinuteSlotSize.minutes60, // Scroll physics scrollPhysics: ScrollPhysics(), // ScrollPhysics for vertical scrolling pageViewPhysics: ScrollPhysics(), // ScrollPhysics for horizontal page transitions // Header and safe area headerStyle: HeaderStyle( headerTextStyle: TextStyle(fontSize: 18), decoration: BoxDecoration(color: Colors.blue), ), safeAreaOption: SafeAreaOption.all(), // Miscellaneous keepScrollOffset: true, // Maintain scroll offset when the page changes ); ``` -------------------------------- ### Configure Flutter library and headers Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/flutter/CMakeLists.txt Sets the path to the Flutter Linux GTK shared library and its header files. These are then used to configure the 'flutter' interface library. ```cmake set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) list(APPEND FLUTTER_LIBRARY_HEADERS "fl_basic_message_channel.h" "fl_binary_codec.h" "fl_binary_messenger.h" "fl_dart_project.h" "fl_engine.h" "fl_json_message_codec.h" "fl_json_method_codec.h" "fl_message_codec.h" "fl_method_call.h" "fl_method_channel.h" "fl_method_codec.h" "fl_method_response.h" "fl_plugin_registrar.h" "fl_plugin_registry.h" "fl_standard_message_codec.h" "fl_standard_method_codec.h" "fl_string_codec.h" "fl_value.h" "fl_view.h" "flutter_linux.h" ) list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") ``` -------------------------------- ### Customize Week View Appearance and Behavior Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Configure custom builders for event tiles, time lines, and day elements. Set date boundaries, time line widths, and visual styles for week days and numbers. Control the visibility of weekends, half/quarter hours, and midnight hours. Define event arrangement and handle various tap events. Customize hour indicators, live time indicators, dividers, page transitions, and background colors. Adjust scroll behavior and header styles for a tailored user experience. ```dart WeekView( controller: EventController(), // Custom builders eventTileBuilder: (date, events, boundry, start, end) { // Return your widget to display as event tile. return Container(); }, timeLineBuilder: (date) => Text(date.toString()), weekPageHeaderBuilder: WeekHeader.hidden, // To hide week header weekDetectorBuilder: ({date, height, width, heightPerMinute, minuteSlotSize}) => Container(), weekDayBuilder: (date) => Text(date.day.toString()), weekNumberBuilder: (weekNumber) => Text('W$weekNumber'), // Custom string builders for I18n headerStringBuilder: (date, {secondaryDate}) => '${date.month}/${date.year}', timeLineStringBuilder: (date) => '${date.hour}:${date.minute}', weekDayStringBuilder: (weekDay) => ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][weekDay], weekDayDateStringBuilder: (date) => '${date.day}', fullDayEventBuilder: (events, date) { // Return your widget to display full day event view. return Container(); }, // Time and date boundaries minDay: DateTime(1990), maxDay: DateTime(2050), initialDay: DateTime(2021), heightPerMinute: 1, // Height occupied by 1 minute time span. timeLineWidth: 60, // Width of time line timeLineOffset: 0, // Offset of time line width: 400, // Width of week view // Week configuration weekTitleHeight: 50, // Height of week day title weekTitleBackgroundColor: Colors.grey.shade200, // Background color of week title showVerticalLines: false, // Show the vertical line between days showWeekends: true, // Show weekends or not showWeekDayAtBottom: false, // Show week day at bottom position showLiveTimeLineInAllDays: true, // Display live time line in all pages showHalfHours: false, // Show half hour indicator showQuarterHours: false, // Show quarter hour indicator showMidnightHour: false, // Show 00:00 (midnight) hour in timeline // Week days configuration weekDays: [ WeekDays.monday, WeekDays.tuesday, WeekDays.wednesday, WeekDays.thursday, WeekDays.friday, ], startDay: WeekDays.sunday, // Change the first day of the week // Event handling eventArranger: SideEventArranger(), // Define how simultaneous events will be arranged onEventTap: (events, date) => print(events), onEventDoubleTap: (events, date) => print(events), onEventLongTap: (events, date) => print(events), onDateLongPress: (date) => print(date), onDateTap: (date) => print('Tapped: $date'), onTimestampTap: (date) => print('Timestamp tapped: $date'), onHeaderTitleTap: () => print('Header tapped'), // Hour settings startHour: 5, // Set the first hour displayed endHour: 20, // Set the end hour displayed emulateVerticalOffsetBy: 0, // Emulates offset of vertical line from hour line // Hour indicator settings hourIndicatorSettings: HourIndicatorSettings( color: Colors.greenAccent, lineStyle: LineStyle.dashed, ), halfHourIndicatorSettings: HourIndicatorSettings( color: Colors.redAccent, lineStyle: LineStyle.dashed, ), quarterHourIndicatorSettings: HourIndicatorSettings( color: Colors.blueAccent, lineStyle: LineStyle.dashed, ), // Custom hour line painter hourLinePainter: (lineColor, lineHeight, offset, minuteHeight, showVerticalLine, verticalLineOffset, lineStyle, dashWidth, dashSpaceWidth, emulateVerticalOffsetBy, startHour, endHour) { return // Your custom painter. }, // Live time indicator liveTimeIndicatorSettings: LiveTimeIndicatorSettings( color: Colors.red, showTime: true, // Support for different timezones - provide custom DateTime function currentTimeProvider: () { final utcNow = DateTime.now().toUtc(); return utcNow.subtract(Duration(hours: 4)); }, ), // Divider settings dividerSettings: DividerSettings( thickness: 2, height: 2, color: Colors.blueAccent, indent: 10, endIndent: 10, ), // Page transition settings pageTransitionDuration: Duration(milliseconds: 300), pageTransitionCurve: Curves.ease, // Minute slot size for long press callbacks minuteSlotSize: MinuteSlotSize.minutes60, // Background color backgroundColor: Colors.white, // Full day header configuration fullDayHeaderTitle: 'All day', fullDayHeaderTextConfig: FullDayHeaderTextConfig( textAlign: TextAlign.center, textOverflow: TextOverflow.ellipsis, maxLines: 2, ), // Scroll configuration scrollOffset: 0.0, scrollPhysics: ScrollPhysics(), // ScrollPhysics for vertical scrolling pageViewPhysics: ScrollPhysics(), // ScrollPhysics for page view keepScrollOffset: true, // Maintain scroll offset when the page changes // Header and safe area headerStyle: HeaderStyle( ) ``` -------------------------------- ### PackageStrings Class Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md A static class for managing calendar localizations at runtime. It allows registering new locales, setting the active locale, and localizing numbers. ```APIDOC ## Class: PackageStrings ### Description A static class for managing calendar localizations at runtime. ### Methods - **`addLocaleObject(String locale, CalendarLocalizations localeObj)`** Register a new locale or override an existing one. - **`setLocale(String locale)`** Set the active locale for the calendar. - **`localizeNumber(int number)`** Convert a number to its localized string representation. ### Properties - **`currentLocale`** (CalendarLocalizations) Get the current `CalendarLocalizations` object. - **`selectedLocale`** (String) Get the current locale code (e.g., 'en', 'es'). ``` -------------------------------- ### Custom command to assemble Flutter library and headers Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/flutter/CMakeLists.txt Defines a custom command to run the Flutter tool backend script. This command generates the Flutter library and header files, ensuring they are up-to-date before compilation. ```cmake # _phony_ is a non-existent file to force this command to run every time, # since currently there's no way to get a full input/output list from the # flutter tool. add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/_phony_ COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} VERBATIM ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ) ``` -------------------------------- ### Set Binary Name and Policy Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Defines the name of the executable binary and sets a specific CMake policy. CMP0063 NEW ensures consistent behavior for target properties. ```cmake set(BINARY_NAME "example") cmake_policy(SET CMP0063 NEW) ``` -------------------------------- ### Apply Standard Compilation Settings Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/CMakeLists.txt A function to apply common compilation features and options, including C++ standard, warning levels, optimization, and NDEBUG definition. ```cmake function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) target_compile_options(${TARGET} PRIVATE "<$>:-O3>") target_compile_definitions(${TARGET} PRIVATE "<$>:NDEBUG>") endfunction() ``` -------------------------------- ### Include Flutter Managed Directory Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Includes the Flutter managed directory, which contains Flutter's build rules and libraries. This is essential for integrating Flutter into the native build. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") # Flutter library and tool build rules. add_subdirectory(${FLUTTER_MANAGED_DIR}) ``` -------------------------------- ### Define Flutter interface library and link dependencies Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/flutter/CMakeLists.txt Creates an interface library target named 'flutter' and links it with the Flutter library, GTK, GLIB, and GIO. This allows other targets to easily depend on Flutter's functionality. ```cmake add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") target_link_libraries(flutter INTERFACE PkgConfig::GTK PkgConfig::GLIB PkgConfig::GIO ) add_dependencies(flutter flutter_assemble) ``` -------------------------------- ### Pin Exact Version for 2.x.x Releases Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md When depending on 2.x.x releases, pin the exact version in your pubspec.yaml to avoid unexpected breaking changes. ```yaml dependencies: calendar_view: 2.0.0 ``` -------------------------------- ### Configure Build Type Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/CMakeLists.txt Sets the default build type to 'Debug' if not already configured, ensuring consistent build modes. ```cmake if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() ``` -------------------------------- ### Apply Standard Compilation Settings Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Defines a function to apply common compilation settings to a target. This includes setting the C++ standard to C++17, enabling specific compiler warnings and error checks, and disabling exceptions. ```cmake function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() ``` -------------------------------- ### Define list_prepend function for CMake < 3.10 Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/linux/flutter/CMakeLists.txt This function mimics the behavior of list(TRANSFORM ... PREPEND ...) which is not available in CMake version 3.10. It prepends a prefix to each element in a given list. ```cmake function(list_prepend LIST_NAME PREFIX) set(NEW_LIST "") foreach(element ${${LIST_NAME}}) list(APPEND NEW_LIST "${PREFIX}${element}") endforeach(element) set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) endfunction() ``` -------------------------------- ### CalendarLocalizations Constructor Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Defines the structure for localizable strings within the calendar view. It includes essential elements like AM/PM suffixes, 'more' text, and weekday abbreviations. ```dart const CalendarLocalizations({ required String am, // AM suffix (e.g., 'am', 'a. m.') required String pm, // PM suffix (e.g., 'pm', 'p. m.') required String more, // "More" text for additional events required List weekdays, // Weekday abbreviations [Mon-Sun] List? numbers, // Localized numbers 0-60 (61 elements) bool isRTL = false, // Right-to-left layout }); ``` -------------------------------- ### Implement Custom Theme with ThemeData Extensions Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Alternative approach using `ThemeData` extensions to apply custom themes. This method involves creating custom theme data classes that extend `ThemeExtension` and adding them to the app's `ThemeData`. ```dart // Create custom theme final myMonthViewTheme = MonthViewThemeData.light().copyWith( cellInMonthColor: Colors.blue.shade50, cellBorderColor: Colors.blue.shade300, ); // Apply to your app theme final theme = ThemeData.light().copyWith( extensions: [ myMonthViewTheme, DayViewThemeData.light(), WeekViewThemeData.light(), MultiDayViewThemeData.light(), ], ); ``` -------------------------------- ### Complete Integration with Localization Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md This snippet shows a full Flutter app integration. It includes setting up the CalendarControllerProvider, defining supported locales, and dynamically changing the app's locale using a PopupMenuButton. Custom locales can be registered using PackageStrings.addLocaleObject. ```dart import 'package:calendar_view/calendar_view.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatefulWidget { const MyApp({super.key}); @override State createState() => _MyAppState(); } class _MyAppState extends State { String _currentLocale = 'en'; @override void initState() { super.initState(); _registerCustomLocales(); } void _registerCustomLocales() { PackageStrings.addLocaleObject( 'es', const CalendarLocalizations( am: 'a. m.', pm: 'p. m.', more: 'Más', weekdays: ['L', 'M', 'X', 'J', 'V', 'S', 'D'], ), ); } void _changeLocale(String locale) { setState(() { _currentLocale = locale; PackageStrings.setLocale(locale); }); } @override Widget build(BuildContext context) { return CalendarControllerProvider( controller: EventController(), child: MaterialApp( locale: Locale(_currentLocale), supportedLocales: const [ Locale('en'), Locale('es'), Locale('ar'), ], localizationsDelegates: const [ GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, GlobalWidgetsLocalizations.delegate, ], home: Scaffold( appBar: AppBar( title: const Text('Calendar Localization Demo'), actions: [ PopupMenuButton( onSelected: _changeLocale, itemBuilder: (context) => const [ PopupMenuItem(value: 'en', child: Text('English')), PopupMenuItem(value: 'es', child: Text('Español')), PopupMenuItem(value: 'ar', child: Text('العربية')), ], ), ], ), body: const MonthView(), ), ), ); } } ``` -------------------------------- ### Configure Windows Runner Executable Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/runner/CMakeLists.txt Defines the main executable for the Windows runner, including source files, resource files, and manifest. It also applies standard build settings and sets compiler definitions. ```cmake cmake_minimum_required(VERSION 3.15) project(runner LANGUAGES CXX) add_executable(${BINARY_NAME} WIN32 "flutter_window.cpp" "main.cpp" "run_loop.cpp" "utils.cpp" "win32_window.cpp" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" "Runner.rc" "runner.exe.manifest" ) apply_standard_settings(${BINARY_NAME}) target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Month View Theme Settings Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Applies custom highlight and text colors for selected dates and week days, and customizes the text style for week day labels in the Month view. ```dart MonthView( monthViewThemeSettings: MonthViewThemeSettings( selectedHighlightColor: Colors.blue, selectedTitleColor: Colors.white, cellsInMonthHighlightColor: Colors.blue, weekDayTextStyle: TextStyle(color: Colors.black, fontWeight: FontWeight.bold), ), ) ``` -------------------------------- ### Set Built-in Locales Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Use `PackageStrings.setLocale` to switch between pre-defined languages like Spanish, Arabic, and Hindi. Arabic includes RTL support and Arabic numerals, while Hindi includes Devanagari numerals. ```dart import 'package:calendar_view/calendar_view.dart'; void main() { // Switch to Spanish PackageStrings.setLocale('es'); // Switch to Arabic (includes RTL and Arabic numerals) PackageStrings.setLocale('ar'); // Switch to Hindi (includes Devanagari numerals) PackageStrings.setLocale('hi'); runApp(MyApp()); } ``` -------------------------------- ### Include Generated Plugins Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/example/windows/CMakeLists.txt Includes the CMake script that manages the building of generated plugins and adds them to the application. This is a key step for incorporating third-party Flutter plugins. ```cmake # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) ``` -------------------------------- ### CalendarLocalizations Class Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Represents a collection of localizable strings for the calendar view. It includes settings for AM/PM, 'more' text, weekday abbreviations, and optional number localization and RTL support. ```APIDOC ## Class: CalendarLocalizations ### Description A class that holds all localizable strings for the calendar. ### Constructor ```dart const CalendarLocalizations({ required String am, // AM suffix (e.g., 'am', 'a. m.') required String pm, // PM suffix (e.g., 'pm', 'p. m.') required String more, // "More" text for additional events required List weekdays, // Weekday abbreviations [Mon-Sun] List? numbers, // Localized numbers 0-60 (61 elements) bool isRTL = false, // Right-to-left layout }); ``` - `numbers` defaults to `['0'...'9']` when omitted. - For full numeric localization via `PackageStrings.localizeNumber`, provide values for `0..60`. ### Factory Constructor ```dart factory CalendarLocalizations.fromMap(Map map) ``` ### Built-in English Object ```dart CalendarLocalizations.en // English (default) ``` ``` -------------------------------- ### Display Day View Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Use the DayView widget within a Scaffold to display the calendar in a daily format. ```dart Scaffold( body: DayView(), ); ``` -------------------------------- ### Add Calendar View Dependency to pubspec.yaml Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Add the calendar_view package as a dependency in your project's pubspec.yaml file. Ensure you use the latest version available on pub.dev. ```yaml dependencies: calendar_view: ``` -------------------------------- ### Display Week View Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Use the WeekView widget within a Scaffold to display the calendar in a weekly format. ```dart Scaffold( body: WeekView(), ); ``` -------------------------------- ### Display Month View Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Use the MonthView widget within a Scaffold to display the calendar in a monthly format. ```dart Scaffold( body: MonthView(), ); ``` -------------------------------- ### Synchronize Events with CalendarControllerProvider Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Alternatively, synchronize events across calendar views by using `CalendarControllerProvider`. This is useful when you want to provide a controller to a subtree of widgets, allowing child calendar views to access it. ```dart CalendarControllerProvider( controller: EventController(), child: MaterialApp( home: const CalendarScreen(), ), ); ``` -------------------------------- ### Default Hour Indicator Settings Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Configures the default appearance of hour indicators in the Day view, including height, color, and offset. ```dart HourIndicatorSettings( height: widget.heightPerMinute, // Color of horizontal and vertical lines color: Theme.of(context).colorScheme.surfaceContainerHighest, offset: 5, ); ``` -------------------------------- ### Create New Local Branch Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/CONTRIBUTING.md Create a new local branch from the master branch for your feature or fix. Replace 'my-new-feature' with a descriptive branch name. ```bash git checkout -b my-new-feature ``` -------------------------------- ### Access Built-in Localization Objects Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Retrieve pre-defined localization objects for various languages directly from `PackageStrings`. These can be used for inspection or further customization. ```dart final spanish = PackageStrings.spanish; final arabic = PackageStrings.arabic; final french = PackageStrings.french; final german = PackageStrings.german; final hindi = PackageStrings.hindi; final chinese = PackageStrings.chinese; final japanese = PackageStrings.japanese; ``` -------------------------------- ### Week View Indicator and Divider Settings Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Customizes hour and half-hour indicators, and the divider between days in the Week view. Shows half hours and applies dashed line styles. ```dart hourIndicatorSettings: HourIndicatorSettings( color: Colors.greenAccent, lineStyle: LineStyle.dashed, ), showHalfHours: true, halfHourIndicatorSettings: HourIndicatorSettings( color: Colors.redAccent, lineStyle: LineStyle.dashed, ), dividerSettings: DividerSettings( thickness: 2, height: 2, color: Colors.blueAccent, indent: 10, endIndent: 10, ), ``` -------------------------------- ### CalendarLocalizations Factory Constructor Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md A factory constructor for creating `CalendarLocalizations` objects from a map. ```dart factory CalendarLocalizations.fromMap(Map map) ``` -------------------------------- ### Synchronize Events Across Calendar Views with EventController Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Use a single shared `EventController` instance to keep `DayView`, `WeekView`, `MonthView`, and `MultiDayView` synchronized. This ensures that events displayed in one view are consistent across all other views. ```dart final controller = EventController(); MonthView(controller: controller); WeekView(controller: controller); DayView(controller: controller); MultiDayView(controller: controller); ``` -------------------------------- ### Customize Week View Header and Time Slots Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Configure the header text style, background decoration, safe area, and time slot colors for the week view. The time slot color builder highlights hours outside the 9 AM to 5 PM range. ```dart headerTextStyle: TextStyle(fontSize: 18), decoration: BoxDecoration(color: Colors.blue) ), safeAreaOption: SafeAreaOption.all(), // Time slot color builder for highlighting unavailable hours timeSlotColorBuilder: (date, slotStartTime, slotEndTime, index) => slotStartTime.hour >= 9 && slotStartTime.hour < 17 ? Colors.transparent : Colors.grey.shade200, onPageChange: (date, pageIndex) => print("$date, Page: $pageIndex"), ); ``` -------------------------------- ### Display MultiDay View Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Use the MultiDayView widget within a Scaffold to display the calendar for multiple days. ```dart Scaffold( body: MultiDayView(), ); ``` -------------------------------- ### Add a Single Day Event Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/doc/documentation.md Create a CalendarEventData object and add it to the EventController to display a single-day event. ```dart final event = CalendarEventData( date: DateTime(2021, 8, 10), title: "Project Meeting", description: "Discussing project progress", startTime: DateTime(2021, 8, 10, 10, 0), endTime: DateTime(2021, 8, 10, 11, 0), color: Colors.blue, ); CalendarControllerProvider.of(context).controller.add(event); ``` -------------------------------- ### Add Calendar View Dependency Source: https://github.com/simformsolutionspvtltd/flutter_calendar_view/blob/master/README.md Add this dependency to your pubspec.yaml file to include the calendar_view package in your Flutter project. Pin the exact version for 2.x.x releases to avoid breaking changes. ```yaml dependencies: calendar_view: 2.0.0 ``` ```yaml dependencies: calendar_view: ```