Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: revert some date picker code and fix notification issue (#7861)
Morn64dff44ce1b8
diff --git a/frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/date_cell_editor_bloc.dart b/frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/date_cell_editor_bloc.dartindex 8f0c37fb0d..e3187e67cc 100644--- a/frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/date_cell_editor_bloc.dart+++ b/frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/date_cell_editor_bloc.dart@@ -55,10 +55,11 @@ class DateCellEditorBlocdidReceiveCellUpdate: (DateCellDataPB? cellData) {final dateCellData = DateCellData.fromPB(cellData);- ReminderOption reminderOption = ReminderOption.none;+ ReminderOption reminderOption = state.reminderOption;if (dateCellData.reminderId.isNotEmpty &&- dateCellData.dateTime != null) {+ dateCellData.dateTime != null &&+ reminderOption != ReminderOption.none) {final reminder = _reminderBloc.state.reminders.firstWhereOrNull((r) => r.id == dateCellData.reminderId);if (reminder != null) {@@ -119,6 +120,7 @@ class DateCellEditorBlocawait _clearDate();},setReminderOption: (ReminderOption option) async {+ emit(state.copyWith(reminderOption: option));await _setReminderOption(option);},);@@ -246,9 +248,7 @@ class DateCellEditorBlocvoid _updateReminderIfNecessary(DateTime? dateTime,) {- if (state.reminderId.isEmpty ||- state.reminderOption == ReminderOption.none ||- dateTime == null) {+ if (state.reminderId.isEmpty || dateTime == null) {return;}@@ -400,7 +400,7 @@ class DateCellEditorState with _$DateCellEditorState {ReminderOption reminderOption = ReminderOption.none;if (dateCellData.reminderId.isNotEmpty && dateCellData.dateTime != null) {- final reminder = reminderBloc.state.reminders+ final reminder = reminderBloc.state.allReminders.firstWhereOrNull((r) => r.id == dateCellData.reminderId);if (reminder != null) {final eventDate = dateCellData.includeTimediff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_search_text_field.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_search_text_field.dartindex 6154e68000..f23869ae02 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_search_text_field.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/desktop_toolbar/link/link_search_text_field.dart@@ -78,11 +78,12 @@ class LinkSearchTextField {focusNode: focusNode,textAlign: TextAlign.left,controller: textEditingController,- style: textStyle ?? TextStyle(- fontSize: 14,- height: 20 / 14,- fontWeight: FontWeight.w400,- ),+ style: textStyle ??+ TextStyle(+ fontSize: 14,+ height: 20 / 14,+ fontWeight: FontWeight.w400,+ ),onChanged: (text) {if (text.isEmpty) {searchedViews.clear();diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_date_block.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_date_block.dartindex ba58d2d31f..fa376296bf 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_date_block.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_date_block.dart@@ -63,11 +63,12 @@ class _MentionDateBlockState extends State<MentionDateBlock> {late bool _includeTime = widget.includeTime;late DateTime? parsedDate = DateTime.tryParse(widget.date);late String? _reminderId = widget.reminderId;+ late ReminderOption _reminderOption = widget.reminderOption;ReminderPB? getReminder(BuildContext context) {- if (!context.mounted) return null;+ if (!context.mounted || _reminderId == null) return null;final reminderBloc = context.read<ReminderBloc?>();- return reminderBloc?.state.serverReminders+ return reminderBloc?.state.allReminders.firstWhereOrNull((r) => r.id == _reminderId);}@@ -115,11 +116,11 @@ class _MentionDateBlockState extends State<MentionDateBlock> {includeTime: _includeTime,dateFormat: appearance.dateFormat,timeFormat: appearance.timeFormat,- selectedReminderOption: widget.reminderOption,+ selectedReminderOption: _reminderOption,onIncludeTimeChanged: (includeTime, dateTime, _) {_includeTime = includeTime;- if (widget.reminderOption != ReminderOption.none) {+ if (_reminderOption != ReminderOption.none) {_updateReminder(widget.reminderOption,context,@@ -136,18 +137,26 @@ class _MentionDateBlockState extends State<MentionDateBlock> {onDaySelected: (selectedDay) {parsedDate = selectedDay;- if (widget.reminderOption != ReminderOption.none) {+ if (_reminderOption != ReminderOption.none) {_updateReminder(- widget.reminderOption,+ _reminderOption,context,_includeTime,);} else {+ final rootContext = widget.editorState.document.root.context;+ if (rootContext != null && _reminderId != null) {+ rootContext+ .read<ReminderBloc?>()+ ?.add(ReminderEvent.remove(reminderId: _reminderId!));+ }_updateBlock(selectedDay, includeTime: _includeTime);}},- onReminderSelected: (reminderOption) =>- _updateReminder(reminderOption, context, _includeTime),+ onReminderSelected: (reminderOption) {+ _reminderOption = reminderOption;+ _updateReminder(reminderOption, context, _includeTime);+ },);Color? color;@@ -245,7 +254,7 @@ class _MentionDateBlockState extends State<MentionDateBlock> {if (parsedDate == null || rootContext == null) {return;}- final reminder = getReminder(context);+ final reminder = getReminder(rootContext);if (reminder != null) {_updateBlock(parsedDate!,@@ -273,8 +282,8 @@ class _MentionDateBlockState extends State<MentionDateBlock> {);}- final reminderId = nanoid();- _reminderId = reminderId;+ _reminderId ??= nanoid();+ final reminderId = _reminderId;_updateBlock(parsedDate!,includeTime: includeTime,diff --git a/frontend/appflowy_flutter/lib/user/application/reminder/reminder_bloc.dart b/frontend/appflowy_flutter/lib/user/application/reminder/reminder_bloc.dartindex 1623b26af3..b64379d566 100644--- a/frontend/appflowy_flutter/lib/user/application/reminder/reminder_bloc.dart+++ b/frontend/appflowy_flutter/lib/user/application/reminder/reminder_bloc.dart@@ -11,6 +11,7 @@ import 'package:appflowy/user/application/reminder/reminder_service.dart';import 'package:appflowy/util/int64_extension.dart';import 'package:appflowy/workspace/application/action_navigation/action_navigation_bloc.dart';import 'package:appflowy/workspace/application/action_navigation/navigation_action.dart';+import 'package:appflowy/workspace/application/view/view_ext.dart';import 'package:appflowy/workspace/application/view/view_service.dart';import 'package:appflowy_backend/log.dart';import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';@@ -50,6 +51,9 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {Timer? timer;late final AppLifecycleListener _listener;+ bool hasReminder(String reminderId) =>+ state.allReminders.where((e) => e.id == reminderId).firstOrNull != null;+void _dispatch() {on<ReminderEvent>((event, emit) async {@@ -59,8 +63,10 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {final result = await _reminderService.fetchReminders();await result.fold((reminders) async {- final availableReminders =- await filterAvailableReminders(reminders);+ final availableReminders = await filterAvailableReminders(+ reminders,+ removeUnavailableReminder: true,+ );Log.info('Fetched reminders on startup: ${availableReminders.length}',);@@ -86,7 +92,13 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {result.fold((_) {Log.info('Removed reminder: $reminderId');- if (!isClosed) add(ReminderEvent.refresh());+ final reminders = List.of(state.reminders);+ final index = reminders+ .indexWhere((reminder) => reminder.id == reminderId);+ if (index != -1) {+ reminders.removeAt(index);+ emit(state.copyWith(reminders: reminders));+ }},(error) => Log.error('Failed to remove reminder($reminderId): $error',@@ -102,13 +114,7 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {DateTime.now().millisecondsSinceEpoch.toString();});}-- final containReminder = [- ...state.serverReminders,- ...state.reminders,- ].where((e) => e.id == reminder.id).firstOrNull !=- null;- if (containReminder) {+ if (hasReminder(reminder.id)) {Log.error('Reminder: ${reminder.id} failed to be added again');return;}@@ -121,15 +127,11 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {(_) async {Log.info('Added reminder: ${reminder.id}');Log.info('Before adding reminder: ${state.reminders.length}');- final reminderIds = [- ...state.serverReminders,- ...state.reminders,- ].map((e) => e.id).toSet();final showRightNow = !DateTime.now().isBefore(reminder.scheduledAt.toDateTime()) &&!reminder.isRead;- if (!reminderIds.contains(reminder.id) && showRightNow) {+ if (showRightNow) {final reminders = [...state.reminders, reminder];Log.info('After adding reminder: ${reminders.length}');emit(state.copyWith(reminders: reminders));@@ -154,7 +156,7 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {),),update: (updateObject) async {- final reminder = state.reminders.firstWhereOrNull(+ final reminder = state.allReminders.firstWhereOrNull((r) => r.id == updateObject.id,);@@ -167,19 +169,28 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {reminder: newReminder,);- Log.info('Updating reminder: ${reminder.id}');+ Log.info('Updating reminder: ${newReminder.id}');await failureOrUnit.fold((_) async {- Log.info('Updated reminder: ${reminder.id}');+ Log.info('Updated reminder: ${newReminder.id}');final index =- state.reminders.indexWhere((r) => r.id == reminder.id);- if (index == -1) return;+ state.reminders.indexWhere((r) => r.id == newReminder.id);+ if (index == -1) {+ if (await checkReminderAvailable(+ newReminder,+ state.allReminders.map((e) => e.id).toSet(),+ )) {+ emit(+ state+ .copyWith(reminders: [...state.reminders, newReminder]),+ );+ }+ return;+ }final reminders = [...state.reminders];if (await checkReminderAvailable(- reminder,- [...state.serverReminders, ...state.reminders]- .map((e) => e.id)- .toSet(),+ newReminder,+ state.allReminders.map((e) => e.id).toSet(),)) {reminders.replaceRange(index, index + 1, [newReminder]);emit(state.copyWith(reminders: reminders));@@ -189,7 +200,7 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {}}, (error) {Log.error(- 'Failed to update reminder(${reminder.id}): $error',+ 'Failed to update reminder(${newReminder.id}): $error',);});},@@ -436,12 +447,9 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {Future<bool> checkReminderAvailable(ReminderPB reminder,- Set<String> reminderIds,- ) async {- /// blockId is null means no node- final blockId = reminder.meta[ReminderMetaKeys.blockId];- if (blockId == null) return false;-+ Set<String> reminderIds, {+ Set<String> removeIds = const {},+ }) async {/// check if schedule time is commingfinal scheduledAt = reminder.scheduledAt.toDateTime();if (!DateTime.now().isAfter(scheduledAt) && !reminder.isRead) {@@ -452,55 +460,84 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {final viewId = reminder.objectId;final view =await ViewBackendService.getView(viewId).fold((s) => s, (_) => null);- if (view == null) return false;-- /// check if document is not null- final document = await DocumentService()- .openDocument(documentId: viewId)- .fold((s) => s.toDocument(), (_) => null);- if (document == null) return false;- Node? searchById(Node current, String id) {- if (current.id == id) {- return current;+ if (view == null) {+ removeIds.add(reminder.id);+ return false;+ }++ if (view.isDatabase) {+ return true;+ } else {+ /// blockId is null means no node+ final blockId = reminder.meta[ReminderMetaKeys.blockId];+ if (blockId == null) {+ removeIds.add(reminder.id);+ return false;}- if (current.children.isNotEmpty) {- for (final child in current.children) {- final node = searchById(child, id);- if (node != null) {- return node;+ /// check if document is not null+ final document = await DocumentService()+ .openDocument(documentId: viewId)+ .fold((s) => s.toDocument(), (_) => null);+ if (document == null) {+ removeIds.add(reminder.id);+ return false;+ }+ Node? searchById(Node current, String id) {+ if (current.id == id) {+ return current;+ }+ if (current.children.isNotEmpty) {+ for (final child in current.children) {+ final node = searchById(child, id);++ if (node != null) {+ return node;+ }}}+ return null;}- return null;- }- /// check if node is not null- final node = searchById(document.root, blockId);- if (node == null) return false;- final textInserts = node.delta?.whereType<TextInsert>();- if (textInserts == null) return false;- for (final text in textInserts) {- final mention =- text.attributes?[MentionBlockKeys.mention] as Map<String, dynamic>?;- final reminderId = mention?[MentionBlockKeys.reminderId] as String?;- if (reminderIds.contains(reminderId)) {- return true;+ /// check if node is not null+ final node = searchById(document.root, blockId);+ if (node == null) {+ removeIds.add(reminder.id);+ return false;+ }+ final textInserts = node.delta?.whereType<TextInsert>();+ if (textInserts == null) return false;+ for (final text in textInserts) {+ final mention =+ text.attributes?[MentionBlockKeys.mention] as Map<String, dynamic>?;+ final reminderId = mention?[MentionBlockKeys.reminderId] as String?;+ if (reminderIds.contains(reminderId)) {+ return true;+ }}+ removeIds.add(reminder.id);+ return false;}- return false;}Future<List<ReminderPB>> filterAvailableReminders(- List<ReminderPB> reminders,- ) async {+ List<ReminderPB> reminders, {+ bool removeUnavailableReminder = false,+ }) async {final List<ReminderPB> availableReminders = [];final reminderIds = reminders.map((e) => e.id).toSet();+ final removeIds = <String>{};for (final r in reminders) {- if (await checkReminderAvailable(r, reminderIds)) {+ if (await checkReminderAvailable(r, reminderIds, removeIds: removeIds)) {availableReminders.add(r);}}+ if (removeUnavailableReminder) {+ for (final id in removeIds) {+ Log.warn('Remove unavailable reminder: $id');+ if (!isClosed) add(ReminderEvent.remove(reminderId: id));+ }+ }return availableReminders;}}@@ -643,6 +680,8 @@ class ReminderState {late final List<ReminderPB> _reminders;List<ReminderPB> get reminders => _reminders.unique((e) => e.id);+ List<ReminderPB> get allReminders =>+ [...serverReminders, ..._reminders].unique((e) => e.id);late final List<ReminderPB> pastReminders;late final List<ReminderPB> upcomingReminders;diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/home_stack.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/home_stack.dartindex 6024ff8a98..18f56d4e8b 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/home_stack.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/home_stack.dart@@ -147,9 +147,9 @@ class _HomeStackState extends State<HomeStack> with WindowListener {child: Listener(behavior: HitTestBehavior.translucent,onPointerDown: (_) {- final isMenuExpanded =- context.read<HomeSettingBloc>().isMenuExpanded;- final status = isMenuExpanded ? MenuStatus.hidden : MenuStatus.expanded;+ final isMenuExpanded = context.read<HomeSettingBloc>().isMenuExpanded;+ final status =+ isMenuExpanded ? MenuStatus.hidden : MenuStatus.expanded;context.read<HomeSettingBloc>().add(HomeSettingEvent.changeMenuStatus(status));diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/appflowy_date_picker_base.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/appflowy_date_picker_base.dartindex d965670f77..8bfc187422 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/appflowy_date_picker_base.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/appflowy_date_picker_base.dart@@ -23,7 +23,6 @@ abstract class AppFlowyDatePicker extends StatefulWidget {this.onIncludeTimeChanged,this.onIsRangeChanged,this.onReminderSelected,- this.enableDidUpdate = true,});final DateTime? dateTime;@@ -56,7 +55,6 @@ abstract class AppFlowyDatePicker extends StatefulWidget {final ReminderOption reminderOption;final OnReminderSelected? onReminderSelected;- final bool enableDidUpdate;}abstract class AppFlowyDatePickerState<T extends AppFlowyDatePicker>@@ -77,31 +75,34 @@ abstract class AppFlowyDatePickerState<T extends AppFlowyDatePicker>@overridevoid initState() {super.initState();- initData();++ dateTime = widget.dateTime;+ startDateTime = widget.isRange ? widget.dateTime : null;+ endDateTime = widget.isRange ? widget.endDateTime : null;+ includeTime = widget.includeTime;+ isRange = widget.isRange;+ reminderOption = widget.reminderOption;focusedDateTime = widget.dateTime ?? DateTime.now();}@overridevoid didUpdateWidget(covariant oldWidget) {- if (widget.enableDidUpdate) {- initData();+ dateTime = widget.dateTime;+ if (widget.isRange) {+ startDateTime = widget.dateTime;+ endDateTime = widget.endDateTime;+ } else {+ startDateTime = endDateTime = null;}+ includeTime = widget.includeTime;+ isRange = widget.isRange;if (oldWidget.reminderOption != widget.reminderOption) {reminderOption = widget.reminderOption;}super.didUpdateWidget(oldWidget);}- void initData() {- dateTime = widget.dateTime;- startDateTime = widget.isRange ? widget.dateTime : null;- endDateTime = widget.isRange ? widget.endDateTime : null;- includeTime = widget.includeTime;- isRange = widget.isRange;- reminderOption = widget.reminderOption;- }-void onDateSelectedFromDatePicker(DateTime? newStartDateTime,DateTime? newEndDateTime,diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/desktop_date_picker.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/desktop_date_picker.dartindex cf239467a4..f9557e12cb 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/desktop_date_picker.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/desktop_date_picker.dart@@ -32,7 +32,6 @@ class DesktopAppFlowyDatePicker extends AppFlowyDatePicker {super.onIncludeTimeChanged,super.onIsRangeChanged,super.onReminderSelected,- super.enableDidUpdate,this.popoverMutex,this.options = const [],});diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/widgets/date_picker_dialog.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/widgets/date_picker_dialog.dartindex 54fc2fac2a..2c4161b86e 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/widgets/date_picker_dialog.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/date_picker/widgets/date_picker_dialog.dart@@ -23,8 +23,8 @@ class DatePickerOptions {this.timeFormat = UserTimeFormatPB.TwentyFourHour,this.selectedReminderOption,this.onDaySelected,- this.onIncludeTimeChanged,this.onRangeSelected,+ this.onIncludeTimeChanged,this.onIsRangeChanged,this.onReminderSelected,}) : focusedDay = focusedDay ?? DateTime.now();@@ -42,6 +42,37 @@ class DatePickerOptions {final IncludeTimeChangedCallback? onIncludeTimeChanged;final IsRangeChangedCallback? onIsRangeChanged;final OnReminderSelected? onReminderSelected;++ DatePickerOptions copyWith({+ DateTime? focusedDay,+ DateTime? selectedDay,+ bool? includeTime,+ bool? isRange,+ UserDateFormatPB? dateFormat,+ UserTimeFormatPB? timeFormat,+ ReminderOption? selectedReminderOption,+ DaySelectedCallback? onDaySelected,+ RangeSelectedCallback? onRangeSelected,+ IncludeTimeChangedCallback? onIncludeTimeChanged,+ IsRangeChangedCallback? onIsRangeChanged,+ OnReminderSelected? onReminderSelected,+ }) {+ return DatePickerOptions(+ focusedDay: focusedDay ?? this.focusedDay,+ selectedDay: selectedDay ?? this.selectedDay,+ includeTime: includeTime ?? this.includeTime,+ isRange: isRange ?? this.isRange,+ dateFormat: dateFormat ?? this.dateFormat,+ timeFormat: timeFormat ?? this.timeFormat,+ selectedReminderOption:+ selectedReminderOption ?? this.selectedReminderOption,+ onDaySelected: onDaySelected ?? this.onDaySelected,+ onRangeSelected: onRangeSelected ?? this.onRangeSelected,+ onIncludeTimeChanged: onIncludeTimeChanged ?? this.onIncludeTimeChanged,+ onIsRangeChanged: onIsRangeChanged ?? this.onIsRangeChanged,+ onReminderSelected: onReminderSelected ?? this.onReminderSelected,+ );+ }}abstract class DatePickerService {@@ -137,7 +168,7 @@ class DatePickerMenu extends DatePickerService {}}-class _AnimatedDatePicker extends StatelessWidget {+class _AnimatedDatePicker extends StatefulWidget {const _AnimatedDatePicker({required this.offset,required this.showBelow,@@ -150,14 +181,21 @@ class _AnimatedDatePicker extends StatelessWidget {final DatePickerOptions options;final PopoverMutex? popoverMutex;+ @override+ State<_AnimatedDatePicker> createState() => _AnimatedDatePickerState();+}++class _AnimatedDatePickerState extends State<_AnimatedDatePicker> {+ late DatePickerOptions options = widget.options;+@overrideWidget build(BuildContext context) {- final dy = offset.dy + (showBelow ? _ySpacing : -_ySpacing);+ final dy = widget.offset.dy + (widget.showBelow ? _ySpacing : -_ySpacing);return AnimatedPositioned(duration: const Duration(milliseconds: 200),top: dy,- left: offset.dx,+ left: widget.offset.dx,child: Container(decoration: FlowyDecoration.decoration(Theme.of(context).cardColor,@@ -166,18 +204,47 @@ class _AnimatedDatePicker extends StatelessWidget {constraints: BoxConstraints.loose(const Size(_datePickerWidth, 465)),child: DesktopAppFlowyDatePicker(includeTime: options.includeTime,- onIncludeTimeChanged: options.onIncludeTimeChanged,isRange: options.isRange,- onIsRangeChanged: options.onIsRangeChanged,dateFormat: options.dateFormat.simplified,timeFormat: options.timeFormat.simplified,dateTime: options.selectedDay,- popoverMutex: popoverMutex,+ popoverMutex: widget.popoverMutex,reminderOption: options.selectedReminderOption ?? ReminderOption.none,- onDaySelected: options.onDaySelected,- onRangeSelected: options.onRangeSelected,- onReminderSelected: options.onReminderSelected,- enableDidUpdate: false,+ onDaySelected: options.onDaySelected == null+ ? null+ : (d) {+ options.onDaySelected?.call(d);+ setState(() {+ options = options.copyWith(selectedDay: d);+ });+ },+ onIsRangeChanged: options.onIsRangeChanged == null+ ? null+ : (isRange, s, e) {+ options.onIsRangeChanged?.call(isRange, s, e);+ },+ onIncludeTimeChanged: options.onIncludeTimeChanged == null+ ? null+ : (include, s, e) {+ options.onIncludeTimeChanged?.call(include, s, e);+ setState(() {+ options =+ options.copyWith(includeTime: include, selectedDay: s);+ });+ },+ onRangeSelected: options.onRangeSelected == null+ ? null+ : (s, e) {+ options.onRangeSelected?.call(s, e);+ },+ onReminderSelected: options.onReminderSelected == null+ ? null+ : (o) {+ options.onReminderSelected?.call(o);+ setState(() {+ options = options.copyWith(selectedReminderOption: o);+ });+ },),),);