MonthRangePicker constructor

const MonthRangePicker({
  1. Key? key,
  2. DateTime? initialDate,
  3. DateTime? firstDate,
  4. DateTime? lastDate,
  5. int selectedTab = 0,
  6. dynamic onConfirm(
    1. DateTime
    )?,
  7. DateTimeRange<DateTime>? initialDateTimeRange,
  8. bool showTabs = true,
  9. bool showOnlyCustomRange = false,
  10. String headerText = 'Select month and year',
  11. bool showAllMonths = false,
  12. Color? primaryColor,
  13. Color? unselectedTextColor,
  14. String? fontFamily,
  15. TextStyle? tabTextStyle,
  16. TextStyle? headerTextStyle,
  17. TextStyle? pickerTextStyle,
  18. TextStyle? dateTextStyle,
  19. TextStyle? buttonTextStyle,
  20. TextStyle? errorTextStyle,
  21. TextStyle? labelTextStyle,
  22. int? maxRangeMonths,
  23. int? maxRangeYears,
  24. Widget confirmButtonBuilder(
    1. VoidCallback onConfirm
    )?,
  25. void onValidationError(
    1. BuildContext context,
    2. String message
    )?,
})

Implementation

const MonthRangePicker({
  super.key,
  this.initialDate,
  this.firstDate,
  this.lastDate,
  this.selectedTab = 0,
  this.onConfirm,
  this.initialDateTimeRange,
  this.showTabs = true,
  this.showOnlyCustomRange = false,
  this.headerText = 'Select month and year',
  this.showAllMonths = false,
  this.primaryColor,
  this.unselectedTextColor,
  this.fontFamily,
  this.tabTextStyle,
  this.headerTextStyle,
  this.pickerTextStyle,
  this.dateTextStyle,
  this.buttonTextStyle,
  this.errorTextStyle,
  this.labelTextStyle,
  this.maxRangeMonths,
  this.maxRangeYears,
  this.confirmButtonBuilder,
  this.onValidationError,
}) : assert(
        !(initialDate != null && initialDateTimeRange != null),
        'Both initialDate and initialDateTimeRange cannot be provided',
      );