|
@@ -3,9 +3,9 @@ import 'package:app_flowy/plugins/grid/presentation/widgets/header/field_editor.
|
|
|
import 'package:app_flowy/startup/startup.dart';
|
|
|
import 'package:app_flowy/plugins/grid/application/prelude.dart';
|
|
|
import 'package:app_flowy/workspace/presentation/widgets/dialogs.dart';
|
|
|
+import 'package:appflowy_popover/popover.dart';
|
|
|
import 'package:flowy_infra/image.dart';
|
|
|
import 'package:flowy_infra/theme.dart';
|
|
|
-import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
|
|
import 'package:flowy_infra_ui/style_widget/button.dart';
|
|
|
import 'package:flowy_infra_ui/style_widget/text.dart';
|
|
|
import 'package:flowy_infra_ui/widget/spacing.dart';
|
|
@@ -32,38 +32,32 @@ class _GridFieldCellActionSheetState extends State<GridFieldCellActionSheet> {
|
|
|
Widget build(BuildContext context) {
|
|
|
if (_showFieldEditor) {
|
|
|
final field = widget.cellContext.field;
|
|
|
- return OverlayContainer(
|
|
|
- constraints: BoxConstraints.loose(const Size(240, 200)),
|
|
|
- child: FieldEditor(
|
|
|
+ return FieldEditor(
|
|
|
+ gridId: widget.cellContext.gridId,
|
|
|
+ fieldName: field.name,
|
|
|
+ typeOptionLoader: FieldTypeOptionLoader(
|
|
|
gridId: widget.cellContext.gridId,
|
|
|
- fieldName: field.name,
|
|
|
- typeOptionLoader: FieldTypeOptionLoader(
|
|
|
- gridId: widget.cellContext.gridId,
|
|
|
- field: field,
|
|
|
- ),
|
|
|
+ field: field,
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
return BlocProvider(
|
|
|
create: (context) =>
|
|
|
getIt<FieldActionSheetBloc>(param1: widget.cellContext),
|
|
|
- child: OverlayContainer(
|
|
|
- constraints: BoxConstraints.loose(const Size(240, 200)),
|
|
|
- child: SingleChildScrollView(
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- _EditFieldButton(
|
|
|
- cellContext: widget.cellContext,
|
|
|
- onTap: () {
|
|
|
- setState(() {
|
|
|
- _showFieldEditor = true;
|
|
|
- });
|
|
|
- },
|
|
|
- ),
|
|
|
- const VSpace(6),
|
|
|
- _FieldOperationList(widget.cellContext, () {}),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ child: SingleChildScrollView(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ _EditFieldButton(
|
|
|
+ cellContext: widget.cellContext,
|
|
|
+ onTap: () {
|
|
|
+ setState(() {
|
|
|
+ _showFieldEditor = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ const VSpace(6),
|
|
|
+ _FieldOperationList(widget.cellContext, () {}),
|
|
|
+ ],
|
|
|
),
|
|
|
),
|
|
|
);
|
|
@@ -159,8 +153,11 @@ class FieldActionCell extends StatelessWidget {
|
|
|
Widget build(BuildContext context) {
|
|
|
final theme = context.watch<AppTheme>();
|
|
|
return FlowyButton(
|
|
|
- text: FlowyText.medium(action.title(),
|
|
|
- fontSize: 12, color: enable ? null : theme.shader4),
|
|
|
+ text: FlowyText.medium(
|
|
|
+ action.title(),
|
|
|
+ fontSize: 12,
|
|
|
+ color: enable ? null : theme.shader4,
|
|
|
+ ),
|
|
|
hoverColor: theme.hover,
|
|
|
onTap: () {
|
|
|
if (enable) {
|
|
@@ -168,8 +165,10 @@ class FieldActionCell extends StatelessWidget {
|
|
|
onTap();
|
|
|
}
|
|
|
},
|
|
|
- leftIcon: svgWidget(action.iconName(),
|
|
|
- color: enable ? theme.iconColor : theme.disableIconColor),
|
|
|
+ leftIcon: svgWidget(
|
|
|
+ action.iconName(),
|
|
|
+ color: enable ? theme.iconColor : theme.disableIconColor,
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
}
|
|
@@ -216,6 +215,7 @@ extension _FieldActionExtension on FieldAction {
|
|
|
.add(const FieldActionSheetEvent.duplicateField());
|
|
|
break;
|
|
|
case FieldAction.delete:
|
|
|
+ PopoverContainer.of(context).close();
|
|
|
NavigatorAlertDialog(
|
|
|
title: LocaleKeys.grid_field_deleteFieldPromptMessage.tr(),
|
|
|
confirm: () {
|