Line data Source code
1 : import 'package:flutter/widgets.dart'; 2 : 3 : import '../day_picker.dart'; 4 : import '../range_picker.dart'; 5 : import '../week_picker.dart'; 6 : 7 : 8 : /// Signature for function which is used to set set specific decoration for 9 : /// some days in [DayPicker], [WeekPicker] and [RangePicker]. 10 : /// 11 : /// See also: 12 : /// * [DayPicker.eventDecorationBuilder] 13 : /// * [WeekPicker.eventDecorationBuilder] 14 : /// * [RangePicker.eventDecorationBuilder] 15 : typedef EventDecorationBuilder = EventDecoration? Function(DateTime date); 16 : 17 : 18 : /// Class to store styles for event (specific day in the date picker). 19 : @immutable 20 : class EventDecoration { 21 : 22 : /// Cell decoration for the specific day in the date picker (event). 23 : final BoxDecoration? boxDecoration; 24 : 25 : /// Style for number of the specific day in the date picker (event). 26 : final TextStyle? textStyle; 27 : 28 : /// Creates decoration for special day. 29 : /// 30 : /// Used for [EventDecorationBuilder] function which is usually passed to 31 : /// [DayPicker.eventDecorationBuilder], [WeekPicker.eventDecorationBuilder] 32 : /// and [RangePicker.eventDecorationBuilder] to set specific decoration for 33 : /// some days. 34 0 : const EventDecoration({this.boxDecoration, this.textStyle}); 35 : }