Skip to content

Commit 228695d

Browse files
committed
chore: add close button on row detail page
1 parent 2f2b69d commit 228695d

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/row/row_detail.dart

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.d
66
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/cell/prelude.dart';
77
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/header/field_cell.dart';
88
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/header/field_editor.dart';
9+
import 'package:flowy_infra/image.dart';
910
import 'package:flowy_infra/theme.dart';
1011
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
1112
import 'package:flowy_infra_ui/style_widget/hover.dart';
13+
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
1214
import 'package:flowy_infra_ui/style_widget/scrolling/styled_scroll_bar.dart';
1315
import 'package:flowy_infra_ui/widget/spacing.dart';
1416
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' show FieldType;
@@ -66,12 +68,36 @@ class _RowDetailPageState extends State<RowDetailPage> {
6668
},
6769
child: Padding(
6870
padding: const EdgeInsets.symmetric(horizontal: 80, vertical: 40),
69-
child: _PropertyList(cellCache: widget.cellCache),
71+
child: Column(
72+
children: [
73+
SizedBox(
74+
height: 40,
75+
child: Row(
76+
children: const [Spacer(), _CloseButton()],
77+
)),
78+
Expanded(child: _PropertyList(cellCache: widget.cellCache)),
79+
],
80+
),
7081
),
7182
);
7283
}
7384
}
7485

86+
class _CloseButton extends StatelessWidget {
87+
const _CloseButton({Key? key}) : super(key: key);
88+
89+
@override
90+
Widget build(BuildContext context) {
91+
final theme = context.watch<AppTheme>();
92+
return FlowyIconButton(
93+
width: 24,
94+
onPressed: () => FlowyOverlay.of(context).remove(RowDetailPage.identifier()),
95+
iconPadding: const EdgeInsets.fromLTRB(2, 2, 2, 2),
96+
icon: svgWidget("home/close", color: theme.iconColor),
97+
);
98+
}
99+
}
100+
75101
class _PropertyList extends StatelessWidget {
76102
final GridCellCache cellCache;
77103
final ScrollController _scrollController;

frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ class FlowyOverlayState extends State<FlowyOverlay> {
176176
FlowyOverlayStyle? style,
177177
Offset? anchorOffset,
178178
}) {
179-
debugPrint("Show overlay: $identifier");
180179
this.style = style ?? FlowyOverlayStyle();
181180

182181
_showOverlay(
@@ -245,6 +244,7 @@ class FlowyOverlayState extends State<FlowyOverlay> {
245244
OverlapBehaviour? overlapBehaviour,
246245
FlowyOverlayDelegate? delegate,
247246
}) {
247+
debugPrint("Show overlay: $identifier");
248248
Widget overlay = widget;
249249
final offset = anchorOffset ?? Offset.zero;
250250

0 commit comments

Comments
 (0)