fix: calendar event card not displaying as intended (#3731)

This commit is contained in:
Richard Shiue 2023-10-19 18:19:50 +08:00 committed by GitHub
parent e565d0ee32
commit 1793a28cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -26,7 +26,12 @@ class CalendarEventEditorBloc
final cells = rowController
.loadData()
.values
.where((cellContext) => cellContext.isVisible())
.where(
(cellContext) =>
cellContext.isVisible() ||
cellContext.fieldId == layoutSettings.fieldId ||
cellContext.fieldInfo.isPrimary,
)
.toList();
if (!isClosed) {
add(
@ -50,7 +55,12 @@ class CalendarEventEditorBloc
onRowChanged: (cells, reason) {
if (!isClosed) {
final cellData = cells.values
.where((cellContext) => cellContext.isVisible())
.where(
(cellContext) =>
cellContext.isVisible() ||
cellContext.fieldId == layoutSettings.fieldId ||
cellContext.fieldInfo.isPrimary,
)
.toList();
add(
CalendarEventEditorEvent.didReceiveCellDatas(cellData),

View File

@ -126,9 +126,11 @@ class EventPropertyList extends StatelessWidget {
state.cells.firstWhereOrNull((cell) => cell.fieldInfo.isPrimary);
final dateFieldIndex =
reorderedList.indexWhere((cell) => cell.fieldId == dateFieldId);
if (primaryCellContext == null || dateFieldIndex == -1) {
return const SizedBox.shrink();
}
reorderedList.insert(0, reorderedList.removeAt(dateFieldIndex));
final children = <Widget>[