flutter_mmcalendar library

Myanmar calendar widgets for Flutter, built on myanmar_calendar_dart.

Every widget renders as Material 3, Cupertino or Liquid Glass (MmVisualStyle) and reads its client, language and theme from a MyanmarCalendarScope:

The core library is re-exported, so one import gives both.

Classes

AIPromptAction
Builds a horoscope, fortune or divination prompt for a day with AIPromptService, shows the start of it, and hands the full text to onPrompt when the user taps the button.
AIPromptService
Service to generate structured AI prompts for astrological information
AstroBadges
A day's astrological marks as chips: Sabbath or Sabbath Eve, Yatyaza, Pyathada, and optionally the named astrological days.
AstroInfo
Contains astronomical and astrological information for a Myanmar date
AstrologyCard
A day's astrology: the Sabbath, Yatyaza and Pyathada badges and the named days, then mahabote, nakhat, the year name and nagahle, with the core library's descriptions.
CacheBucketStatistics
Typed statistics for a single cache bucket.
CacheConfig
Cache configuration options
CalendarCache
Centralized cache manager for Myanmar Calendar
CalendarCacheStatistics
Typed statistics snapshot for all caches managed by CalendarCache.
CalendarConfig
Configuration class for the Myanmar Calendar
CalendarLayout
Date arithmetic shared by the calendars. Days are local, date-only.
CalendarSelection
What is selected in a calendar. Days are always date-only.
ChronicleCard
The era a date falls in, from the core library's dynasties, and the dated records nearest to it.
ChronicleEntryData
Chronicle entry data.
ChronicleRecord
A dated record from the core library's chronicles.
CompleteDate
Complete date information combining all calendars and calculations
CustomHoliday
Represents a custom holiday rule defined by the consumer.
CustomHolidayContext
Evaluation context for custom holiday rules.
DateDifferenceCard
Date arithmetic: the days between two dates, and a date plus a number of days or Myanmar months.
DefaultWesternHolidayProvider
Default provider with built-in lookup tables for approximate holidays.
DynastyData
Dynasty data.
Holiday
One holiday or anniversary on a date: what it is (id or customId), its type and its display name in the requested language.
HolidayBadge
A holiday as a small chip coloured by its type. Custom holidays get an outline instead of a fill.
HolidayInfo
Contains holiday information for a given date
HolidayList
The holidays coming up from a day, each with its date, its Myanmar date and how many days away it is.
HolidayOccurrence
One holiday on one day, as listed by HolidayList.
MmButton
A button that is a FilledButton/TextButton in Material, a CupertinoButton in Cupertino, and a glass capsule in Glass.
MmCalendarThemeData
Colours, type and shape for the calendar widgets.
MmChip
A small coloured label, such as a holiday or Sabbath badge.
MmGlass
A Liquid Glass panel: what is behind it bends at the rim, a tint and a bright edge sit on top, and child is drawn inside.
MmIconButton
An icon-only button: IconButton in Material, CupertinoButton in Cupertino, a round glass button in Glass. Always has a tooltip, which is also its accessible label.
MmListGroup
A titled group of MmListRows: a tonal card in Material, an inset grouped section in Cupertino, a glass panel in Glass.
MmListRow
One row in an MmListGroup: a title, an optional subtitle, and leading and trailing widgets.
MmPressable
A tap target for the glass controls: keyboard focus and activation, button semantics, a focus ring, and a slight press-down scale.
MmSegmented<T extends Object>
A choice of one option from a few: SegmentedButton in Material, CupertinoSlidingSegmentedControl in Cupertino, and a glass capsule with a sliding thumb in Glass.
MmStrings
The words the calendar widgets show or read out that the core library doesn't translate: button tooltips and screen-reader states.
MmSurface
A card for calendar content: a tonal card in Material, a hairline-edged panel in Cupertino, and a glass panel in Glass.
MoonGlyph
A drawn moon for a Myanmar day: lit fraction from the day of the fortnight, with the terminator drawn as an ellipse.
MoonPainter
Paints a moon illumination lit, on the right when waxing, turned down by tiltDegrees.
MoonPhaseStrip
A Myanmar month's four Sabbath days, which are its quarter moons: waxing 8, the full moon, waning 8 and the new moon, each with its Western date.
MultiSelection
Any number of separate days.
MyanmarAgenda
A scrolling list of the days that have holidays, Sabbath, moon days or events, with a pinned header per month.
MyanmarAgendaSliver
The days from from to to that have something on them, as a sliver with a pinned header per month. Put it in a CustomScrollView, or use MyanmarAgenda for a ready-made list.
MyanmarCalendar
Main Myanmar Calendar class providing static access to all package functionality
MyanmarCalendarClient
The complete Myanmar calendar API, bound to one CalendarConfig.
MyanmarCalendarController
Holds the month a calendar shows and what is selected in it.
MyanmarCalendarHeader
A calendar's title row: a title, a subtitle under it (the Myanmar months it spans), previous and next buttons, and an optional trailing widget.
MyanmarCalendarScope
Provides the calendar client, language, style and theme to every calendar widget below it.
MyanmarCalendarScopeData
Calendar settings shared by every widget below a MyanmarCalendarScope.
MyanmarDate
Represents a Myanmar calendar date with all relevant properties
MyanmarDateConverter
Converts between the Western and Myanmar calendars. Each side opens the picker that suits it (the calendar for Western, the wheels for Myanmar); the swap button puts the other calendar on top.
MyanmarDateFormField
A form field for a date. Once chosen it shows the Myanmar date and the Western date under it; tapping opens showMyanmarDatePicker.
MyanmarDatePicker
A date picker's content, for use inline or inside your own dialog: a summary of the selection, then a month calendar, the Myanmar wheels, or a month-year grid.
MyanmarDateRange
A chosen range of days, both ends included.
MyanmarDateText
A date as text, formatted with the core library's patterns in the scope's language.
MyanmarDateTime
Myanmar DateTime class that provides a convenient interface for Myanmar calendar operations
MyanmarDateWheelPicker
Picks a Myanmar date the way it is said: year, month, then the day of the waxing or waning fortnight.
MyanmarDayCell
One day in a calendar grid, drawn from data in cellStyle.
MyanmarDayData
Everything a day cell or builder needs about one day: its dates, holidays and astrology, plus how it sits in the calendar right now.
MyanmarDayDetails
Everything about one day, in grouped sections you can reorder or leave out. Each date row has a copy button.
MyanmarLunarMonthCalendar
A Myanmar month laid out the way it is counted: the waxing fortnight, 1 to 15 ending on the full moon, then the waning fortnight to the new moon. Watat years show First and Second Waso; late Tagu and late Kason appear where the year has them.
MyanmarMiniMonth
A compact month for side panels, the year view and the desktop sidebar: today filled, full moons tinted, public holidays coloured.
MyanmarMonthCalendar
A month grid that shows Western and Myanmar dates together, pages by swiping, and selects one day, a range or several days.
MyanmarMonthYearPicker
Jumps to a month: a year with previous and next buttons over a grid of its twelve months. The header shows the Myanmar years the Western year spans.
MyanmarTodayCard
A day at a glance: the Western day large, the Myanmar date, the Myanmar and Sasana years, the moon, and the day's holidays and Sabbath, Yatyaza and Pyathada badges.
MyanmarWeekStrip
One week in a row that pages by swiping, for app headers and agenda pages. Each day shows its weekday, Western day, and Myanmar day or moon.
MyanmarYearCalendar
A Western year as twelve MyanmarMiniMonths, with public holidays and full moons marked. Tapping a month calls onMonthTapped.
MyanmarYearInfo
Typed metadata for a Myanmar calendar year.
NagahleCompass
Which way the dragon's head (nagahle) turns in a day's month, drawn as a compass with the dragon pointing that way.
NextMoonCountdown
Days until the next full moon, new moon and Sabbath, counted from from or from today. A bar fills as the full moon nears.
RangeSelection
A run of days from start to end, inclusive.
RulerData
Ruler data.
ShanDate
Represents a date in the Shan calendar system
SingleSelection
One day, or none.
TableWesternHolidayProvider
Table-driven holiday provider for easy consumer overrides.
TodayBuilder
Builds with today's date and rebuilds at local midnight, and when the app comes back to the foreground, so "today" stays right in long-running apps.
TranslationService
Service for translating text between different languages
ValidationResult
Result of validation operations for Myanmar calendar dates and components
WesternDate
Represents a Western (Gregorian/Julian) calendar date
WesternHolidayDate
Western calendar date holder for fixed holiday lookup.
WesternHolidayProvider
Provider contract for western-calendar holiday rules that are not derived from the Myanmar calendar itself.

Enums

AIPromptType
Types of AI prompts that can be generated
CalendarSystem
The Western calendar system (the int CalendarConfig.calendarType).
DateStep
What DateDifferenceCard adds to a date.
DaySection
A section of MyanmarDayDetails.
HolidayId
Unique identifiers for built-in holidays and anniversaries
HolidayType
Type of holiday
Language
Supported languages for the Myanmar Calendar
MmButtonVariant
How prominent an MmButton is.
MmGlassThickness
How much a glass panel blurs what is behind it.
MmVisualStyle
The look the calendar widgets draw with.
MoonCountdown
What a NextMoonCountdown counts down to.
MoonPhase
The phase of the moon on a Myanmar day (the int moonPhase codes).
MoonTilt
Which way a MoonGlyph's lit side faces.
MyanmarAgendaItem
What earns a day a place in a MyanmarAgenda.
MyanmarDayCellStyle
What a day cell shows.
MyanmarPickerInput
How a date picker takes input.
MyanmarYearType
The kind of Myanmar year (the int yearType codes).
RangePosition
Where a day sits in a range selection.
SabbathType
Whether a day is a Buddhist sabbath (ဥပုသ်).
SasanaYearType
How the Sasana (Buddhist era) year is counted (the int CalendarConfig.sasanaYearType).
ValidationSeverity
Enumeration of validation severity levels

Extensions

MmLanguageDigits on Language
Number formatting in the calendar's languages.
ValidationSeverityExtension on ValidationSeverity
Extension methods for ValidationSeverity

Functions

dartWeekdayFromMyanmar(int weekday) → int
Converts the package's weekday codes (0 Saturday … 6 Friday) to DateTime.weekday (1 Monday … 7 Sunday).
languageForLocale(Locale locale) → Language?
The calendar Language for an app locale, or null when the calendar has none for it.
showMmPopover<T>({required BuildContext context, required WidgetBuilder builder, Rect? anchor, double width = 280, MmVisualStyle? style}) → Future<T?>
Shows a small panel next to anchor (by default the box of context), below it when there is room and above it otherwise.
showMmSheet<T>({required BuildContext context, required WidgetBuilder builder, MmVisualStyle? style, bool isDismissible = true, bool useRootNavigator = false}) → Future<T?>
Shows a bottom sheet in the calendar's style: Material's with a drag handle, a Cupertino sheet with a grabber, or a floating glass sheet.
showMyanmarDatePicker({required BuildContext context, DateTime? initialDate, DateTime? firstDate, DateTime? lastDate, SelectableDayPredicate? selectableDayPredicate, MyanmarPickerInput inputMode = MyanmarPickerInput.calendar, bool allowInputSwitch = true, MyanmarDayCellStyle cellStyle = MyanmarDayCellStyle.westernFirst, String? title, MmVisualStyle? style, DateTime clock()?, MyanmarDateParser? dateParser}) → Future<CompleteDate?>
Shows a date picker and returns the chosen day, or null if the user cancels.
showMyanmarDateRangePicker({required BuildContext context, DateTime? initialMonth, DateTime? initialStart, DateTime? initialEnd, DateTime? firstDate, DateTime? lastDate, SelectableDayPredicate? selectableDayPredicate, MyanmarDayCellStyle cellStyle = MyanmarDayCellStyle.westernFirst, String? title, MmVisualStyle? style, DateTime clock()?}) → Future<MyanmarDateRange?>
Shows a range picker and returns the chosen range, or null if the user cancels. Done is enabled once both ends are chosen.
showMyanmarMultiDatePicker({required BuildContext context, DateTime? initialMonth, Iterable<DateTime> initialDates = const [], DateTime? firstDate, DateTime? lastDate, SelectableDayPredicate? selectableDayPredicate, MyanmarDayCellStyle cellStyle = MyanmarDayCellStyle.westernFirst, String? title, MmVisualStyle? style, DateTime clock()?, MyanmarDateParser? dateParser}) → Future<List<CompleteDate>?>
Shows a picker for any number of days and returns them earliest first, or null if the user cancels.

Typedefs

CompleteDateResolver = CompleteDate Function(DateTime dateTime)
Typed callback contract used to warm up complete-date cache entries.
CustomHolidayMatcher = bool Function(CustomHolidayContext context)
Predicate function evaluated against a typed holiday context.
MyanmarDateParser = DateTime? Function(String text)
Reads a typed date, e.g. "13 Apr 2027" or "Tabaung full moon 1388"; null when text isn't one.
MyanmarDayBuilder = Widget Function(BuildContext context, MyanmarDayData day, Widget cell)
Wraps or replaces a day cell. cell is the default cell for day.
MyanmarEventBuilder = Widget Function(BuildContext context, Object? event)
Builds the row for one of the app's events.
MyanmarEventLoader = List<Object?> Function(DateTime day)
Loads the app's events for a day, for event dots and the agenda.

Exceptions / Errors

DateParseException
A date string that couldn't be parsed. It is also a FormatException, like the errors from DateTime.parse.
InvalidConfigurationException
A configuration value outside its allowed range.
InvalidMyanmarDateException
A Myanmar date that doesn't exist, or is outside the supported range.
InvalidWesternDateException
A Western date or time that doesn't exist, or is outside the supported range.
MyanmarCalendarException
Base class for the package's exceptions.