copyWith method

  1. @useResult
FCalendarStyle copyWith({
  1. FCalendarHeaderStyle headerStyle(
    1. FCalendarHeaderStyle
    )?,
  2. FCalendarDayPickerStyle dayPickerStyle(
    1. FCalendarDayPickerStyle
    )?,
  3. FCalendarEntryStyle yearMonthPickerStyle(
    1. FCalendarEntryStyle
    )?,
  4. BoxDecoration? decoration,
  5. EdgeInsetsGeometry? padding,
  6. Duration? pageAnimationDuration,
})

Returns a copy of this FCalendarStyle with the given properties replaced.

Where possible, it is strongly recommended to use the CLI to generate a style and directly modify the style.

headerStyle

The header's style.

dayPickerStyle

The day picker's style.

yearMonthPickerStyle

The year/month picker's style.

decoration

The decoration surrounding the header & picker.

padding

The padding surrounding the header & picker. Defaults to EdgeInsets.symmetric(horizontal: 12, vertical: 16).

pageAnimationDuration

The duration of the page switch animation. Defaults to 200 milliseconds.

Implementation

@useResult
FCalendarStyle copyWith({
  FCalendarHeaderStyle Function(FCalendarHeaderStyle)? headerStyle,
  FCalendarDayPickerStyle Function(FCalendarDayPickerStyle)? dayPickerStyle,
  FCalendarEntryStyle Function(FCalendarEntryStyle)? yearMonthPickerStyle,
  BoxDecoration? decoration,
  EdgeInsetsGeometry? padding,
  Duration? pageAnimationDuration,
}) => FCalendarStyle(
  headerStyle: headerStyle != null ? headerStyle(this.headerStyle) : this.headerStyle,
  dayPickerStyle: dayPickerStyle != null ? dayPickerStyle(this.dayPickerStyle) : this.dayPickerStyle,
  yearMonthPickerStyle: yearMonthPickerStyle != null
      ? yearMonthPickerStyle(this.yearMonthPickerStyle)
      : this.yearMonthPickerStyle,
  decoration: decoration ?? this.decoration,
  padding: padding ?? this.padding,
  pageAnimationDuration: pageAnimationDuration ?? this.pageAnimationDuration,
);