mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: switch format style of the date after creating
This commit is contained in:
@ -149,18 +149,13 @@ class IGridCellController<T, D> extends Equatable {
|
|||||||
_cellDataPersistence = cellDataPersistence,
|
_cellDataPersistence = cellDataPersistence,
|
||||||
_fieldNotifier = fieldNotifier,
|
_fieldNotifier = fieldNotifier,
|
||||||
_fieldService = FieldService(
|
_fieldService = FieldService(
|
||||||
gridId: cellId.gridId, fieldId: cellId.fieldContext.id),
|
gridId: cellId.gridId,
|
||||||
|
fieldId: cellId.fieldContext.id,
|
||||||
|
),
|
||||||
_cacheKey = GridCellCacheKey(
|
_cacheKey = GridCellCacheKey(
|
||||||
rowId: cellId.rowId, fieldId: cellId.fieldContext.id);
|
rowId: cellId.rowId,
|
||||||
|
fieldId: cellId.fieldContext.id,
|
||||||
IGridCellController<T, D> clone() {
|
);
|
||||||
return IGridCellController(
|
|
||||||
cellId: cellId,
|
|
||||||
cellDataLoader: _cellDataLoader,
|
|
||||||
cellCache: _cellsCache,
|
|
||||||
fieldNotifier: _fieldNotifier,
|
|
||||||
cellDataPersistence: _cellDataPersistence);
|
|
||||||
}
|
|
||||||
|
|
||||||
String get gridId => cellId.gridId;
|
String get gridId => cellId.gridId;
|
||||||
|
|
||||||
@ -172,9 +167,10 @@ class IGridCellController<T, D> extends Equatable {
|
|||||||
|
|
||||||
FieldType get fieldType => cellId.fieldContext.fieldType;
|
FieldType get fieldType => cellId.fieldContext.fieldType;
|
||||||
|
|
||||||
VoidCallback? startListening(
|
VoidCallback? startListening({
|
||||||
{required void Function(T?) onCellChanged,
|
required void Function(T?) onCellChanged,
|
||||||
VoidCallback? onCellFieldChanged}) {
|
VoidCallback? onCellFieldChanged,
|
||||||
|
}) {
|
||||||
if (isListening) {
|
if (isListening) {
|
||||||
Log.error("Already started. It seems like you should call clone first");
|
Log.error("Already started. It seems like you should call clone first");
|
||||||
return null;
|
return null;
|
||||||
|
@ -80,9 +80,9 @@ class _DateCellState extends GridCellState<GridDateCell> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
popupBuilder: (BuildContext popoverContent) {
|
popupBuilder: (BuildContext popoverContent) {
|
||||||
final bloc = context.read<DateCellBloc>();
|
|
||||||
return DateCellEditor(
|
return DateCellEditor(
|
||||||
cellController: bloc.cellController.clone(),
|
cellController: widget.cellControllerBuilder.build()
|
||||||
|
as GridDateCellController,
|
||||||
onDismissed: () => widget.onCellEditing.value = false,
|
onDismissed: () => widget.onCellEditing.value = false,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -54,13 +54,11 @@ class GridURLCell extends GridCellWidget {
|
|||||||
GridURLCellAccessoryType ty, GridCellAccessoryBuildContext buildContext) {
|
GridURLCellAccessoryType ty, GridCellAccessoryBuildContext buildContext) {
|
||||||
switch (ty) {
|
switch (ty) {
|
||||||
case GridURLCellAccessoryType.edit:
|
case GridURLCellAccessoryType.edit:
|
||||||
final cellController =
|
|
||||||
cellControllerBuilder.build() as GridURLCellController;
|
|
||||||
return GridCellAccessoryBuilder(
|
return GridCellAccessoryBuilder(
|
||||||
builder: (Key key) => _EditURLAccessory(
|
builder: (Key key) => _EditURLAccessory(
|
||||||
key: key,
|
key: key,
|
||||||
cellContext: cellController,
|
|
||||||
anchorContext: buildContext.anchorContext,
|
anchorContext: buildContext.anchorContext,
|
||||||
|
cellControllerBuilder: cellControllerBuilder,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -191,10 +189,10 @@ class _GridURLCellState extends GridCellState<GridURLCell> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _EditURLAccessory extends StatefulWidget {
|
class _EditURLAccessory extends StatefulWidget {
|
||||||
final GridURLCellController cellContext;
|
final GridCellControllerBuilder cellControllerBuilder;
|
||||||
final BuildContext anchorContext;
|
final BuildContext anchorContext;
|
||||||
const _EditURLAccessory({
|
const _EditURLAccessory({
|
||||||
required this.cellContext,
|
required this.cellControllerBuilder,
|
||||||
required this.anchorContext,
|
required this.anchorContext,
|
||||||
Key? key,
|
Key? key,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
@ -224,7 +222,8 @@ class _EditURLAccessoryState extends State<_EditURLAccessory>
|
|||||||
child: svgWidget("editor/edit", color: theme.iconColor),
|
child: svgWidget("editor/edit", color: theme.iconColor),
|
||||||
popupBuilder: (BuildContext popoverContext) {
|
popupBuilder: (BuildContext popoverContext) {
|
||||||
return URLEditorPopover(
|
return URLEditorPopover(
|
||||||
cellController: widget.cellContext.clone(),
|
cellController:
|
||||||
|
widget.cellControllerBuilder.build() as GridURLCellController,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user