Skip to content

Commit 50e772e

Browse files
committed
chore: adjust header, card padding ui
1 parent 8a8791b commit 50e772e

File tree

9 files changed

+100
-33
lines changed

9 files changed

+100
-33
lines changed

frontend/app_flowy/lib/plugins/board/presentation/board_page.dart

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import 'package:app_flowy/plugins/grid/application/row/row_data_controller.dart'
99
import 'package:app_flowy/plugins/grid/presentation/widgets/cell/cell_builder.dart';
1010
import 'package:app_flowy/plugins/grid/presentation/widgets/row/row_detail.dart';
1111
import 'package:appflowy_board/appflowy_board.dart';
12+
import 'package:flowy_infra/image.dart';
13+
import 'package:flowy_infra/theme.dart';
14+
import 'package:flowy_infra_ui/style_widget/text.dart';
1215
import 'package:flowy_infra_ui/widget/error_page.dart';
1316
import 'package:flowy_sdk/protobuf/flowy-folder/view.pb.dart';
1417
import 'package:flowy_sdk/protobuf/flowy-grid/block_entities.pb.dart';
@@ -81,21 +84,47 @@ class BoardContent extends StatelessWidget {
8184
Widget _buildHeader(
8285
BuildContext context, AFBoardColumnHeaderData headerData) {
8386
return AppFlowyColumnHeader(
84-
icon: const Icon(Icons.lightbulb_circle),
85-
title: Text(headerData.columnName),
86-
addIcon: const Icon(Icons.add, size: 20),
87-
moreIcon: const Icon(Icons.more_horiz, size: 20),
87+
// icon: const Icon(Icons.lightbulb_circle),
88+
title: Flexible(
89+
fit: FlexFit.tight,
90+
child: FlowyText.medium(
91+
headerData.columnName,
92+
fontSize: 14,
93+
overflow: TextOverflow.clip,
94+
color: context.read<AppTheme>().textColor,
95+
),
96+
),
97+
// addIcon: const Icon(Icons.add, size: 20),
98+
moreIcon: SizedBox(
99+
width: 20,
100+
height: 20,
101+
child: svgWidget(
102+
'grid/details',
103+
color: context.read<AppTheme>().iconColor,
104+
),
105+
),
88106
height: 50,
89-
margin: config.columnItemPadding,
107+
margin: config.headerPadding,
90108
);
91109
}
92110

93111
Widget _buildFooter(BuildContext context, AFBoardColumnData columnData) {
94112
return AppFlowyColumnFooter(
95-
icon: const Icon(Icons.add, size: 20),
96-
title: const Text('New'),
113+
icon: SizedBox(
114+
height: 20,
115+
width: 20,
116+
child: svgWidget(
117+
"home/add",
118+
color: context.read<AppTheme>().iconColor,
119+
),
120+
),
121+
title: FlowyText.medium(
122+
"New",
123+
fontSize: 14,
124+
color: context.read<AppTheme>().textColor,
125+
),
97126
height: 50,
98-
margin: config.columnItemPadding,
127+
margin: config.footerPadding,
99128
onAddButtonClick: () {
100129
context.read<BoardBloc>().add(BoardEvent.createRow(columnData.id));
101130
});
@@ -124,6 +153,8 @@ class BoardContent extends StatelessWidget {
124153

125154
return AppFlowyColumnItemCard(
126155
key: ObjectKey(item),
156+
margin: config.cardPadding,
157+
decoration: _makeBoxDecoration(context),
127158
child: BoardCard(
128159
gridId: gridId,
129160
isEditing: isEditing,
@@ -143,6 +174,16 @@ class BoardContent extends StatelessWidget {
143174
);
144175
}
145176

177+
BoxDecoration _makeBoxDecoration(BuildContext context) {
178+
final theme = context.read<AppTheme>();
179+
final borderSide = BorderSide(color: theme.shader6, width: 1.0);
180+
return BoxDecoration(
181+
color: theme.surface,
182+
border: Border.fromBorderSide(borderSide),
183+
borderRadius: const BorderRadius.all(Radius.circular(6)),
184+
);
185+
}
186+
146187
void _openCard(String gridId, GridFieldCache fieldCache, RowPB rowPB,
147188
GridRowCache rowCache, BuildContext context) {
148189
final rowInfo = RowInfo(

frontend/app_flowy/lib/plugins/board/presentation/card/card.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class _CardMoreOption extends StatelessWidget with CardAccessory {
9292

9393
@override
9494
Widget build(BuildContext context) {
95-
return svgWidget('home/details', color: context.read<AppTheme>().iconColor);
95+
return svgWidget('grid/details', color: context.read<AppTheme>().iconColor);
9696
}
9797

9898
@override

frontend/app_flowy/lib/plugins/board/presentation/card/card_container.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class _CardEnterRegion extends StatelessWidget {
116116
.onEnter = false,
117117
child: IntrinsicHeight(
118118
child: Stack(
119-
alignment: AlignmentDirectional.center,
119+
alignment: AlignmentDirectional.topEnd,
120120
fit: StackFit.expand,
121121
children: children,
122122
)),

frontend/app_flowy/packages/appflowy_board/lib/src/widgets/board.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@ class AFBoardConfig {
1212
final double cornerRadius;
1313
final EdgeInsets columnPadding;
1414
final EdgeInsets columnItemPadding;
15+
final EdgeInsets footerPadding;
16+
final EdgeInsets headerPadding;
17+
final EdgeInsets cardPadding;
1518
final Color columnBackgroundColor;
1619

1720
const AFBoardConfig({
1821
this.cornerRadius = 6.0,
1922
this.columnPadding = const EdgeInsets.symmetric(horizontal: 8),
20-
this.columnItemPadding = const EdgeInsets.symmetric(horizontal: 10),
23+
this.columnItemPadding = const EdgeInsets.symmetric(horizontal: 12),
24+
this.footerPadding = const EdgeInsets.symmetric(horizontal: 12),
25+
this.headerPadding = const EdgeInsets.symmetric(horizontal: 16),
26+
this.cardPadding = const EdgeInsets.symmetric(horizontal: 3, vertical: 4),
2127
this.columnBackgroundColor = Colors.transparent,
2228
});
2329
}

frontend/app_flowy/packages/appflowy_board/lib/src/widgets/styled_widgets/card.dart

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ import 'package:flutter/material.dart';
22

33
class AppFlowyColumnItemCard extends StatefulWidget {
44
final Widget? child;
5-
final Color backgroundColor;
6-
final double cornerRadius;
75
final EdgeInsets margin;
86
final BoxConstraints boxConstraints;
7+
final BoxDecoration decoration;
98

109
const AppFlowyColumnItemCard({
1110
this.child,
12-
this.cornerRadius = 0.0,
1311
this.margin = const EdgeInsets.all(4),
14-
this.backgroundColor = Colors.white,
12+
this.decoration = const BoxDecoration(
13+
color: Colors.white,
14+
borderRadius: BorderRadius.zero,
15+
),
1516
this.boxConstraints = const BoxConstraints(minHeight: 40),
1617
Key? key,
1718
}) : super(key: key);
@@ -24,14 +25,11 @@ class _AppFlowyColumnItemCardState extends State<AppFlowyColumnItemCard> {
2425
@override
2526
Widget build(BuildContext context) {
2627
return Padding(
27-
padding: const EdgeInsets.all(4),
28+
padding: widget.margin,
2829
child: Container(
2930
clipBehavior: Clip.hardEdge,
3031
constraints: widget.boxConstraints,
31-
decoration: BoxDecoration(
32-
color: widget.backgroundColor,
33-
borderRadius: BorderRadius.circular(widget.cornerRadius),
34-
),
32+
decoration: widget.decoration,
3533
child: widget.child,
3634
),
3735
);

frontend/app_flowy/packages/appflowy_board/lib/src/widgets/styled_widgets/footer.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AppFlowyColumnFooter extends StatefulWidget {
1212
const AppFlowyColumnFooter({
1313
this.icon,
1414
this.title,
15-
this.margin = EdgeInsets.zero,
15+
this.margin = const EdgeInsets.symmetric(horizontal: 12),
1616
required this.height,
1717
this.onAddButtonClick,
1818
Key? key,
@@ -30,12 +30,13 @@ class _AppFlowyColumnFooterState extends State<AppFlowyColumnFooter> {
3030
child: SizedBox(
3131
height: widget.height,
3232
child: Padding(
33-
padding: const EdgeInsets.symmetric(horizontal: 10),
33+
padding: widget.margin,
3434
child: Row(
3535
mainAxisAlignment: MainAxisAlignment.start,
3636
crossAxisAlignment: CrossAxisAlignment.center,
3737
children: [
3838
if (widget.icon != null) widget.icon!,
39+
const SizedBox(width: 8),
3940
if (widget.title != null) widget.title!,
4041
],
4142
),

frontend/app_flowy/packages/appflowy_board/lib/src/widgets/styled_widgets/header.dart

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,33 @@ class _AppFlowyColumnHeaderState extends State<AppFlowyColumnHeader> {
4545
}
4646

4747
if (widget.moreIcon != null) {
48-
children.add(const Spacer());
48+
// children.add(const Spacer());
4949
children.add(
50-
IconButton(onPressed: widget.onMoreButtonClick, icon: widget.moreIcon!),
50+
IconButton(
51+
onPressed: widget.onMoreButtonClick,
52+
icon: widget.moreIcon!,
53+
padding: const EdgeInsets.all(4),
54+
constraints: const BoxConstraints(),
55+
),
5156
);
5257
}
5358

5459
if (widget.addIcon != null) {
5560
children.add(
56-
IconButton(onPressed: widget.onAddButtonClick, icon: widget.addIcon!),
61+
IconButton(
62+
onPressed: widget.onAddButtonClick,
63+
icon: widget.addIcon!,
64+
padding: const EdgeInsets.all(4),
65+
constraints: const BoxConstraints(),
66+
),
5767
);
5868
}
5969

6070
return SizedBox(
6171
height: widget.height,
6272
child: Padding(
6373
padding: widget.margin,
64-
child: Row(
65-
children: children,
66-
),
74+
child: Row(children: children),
6775
),
6876
);
6977
}

frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/text.dart

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,31 @@ class FlowyText extends StatelessWidget {
2020
}) : super(key: key);
2121

2222
const FlowyText.semibold(this.title,
23-
{Key? key, this.fontSize = 16, TextOverflow? overflow, this.color, this.textAlign})
23+
{Key? key,
24+
this.fontSize = 16,
25+
TextOverflow? overflow,
26+
this.color,
27+
this.textAlign})
2428
: fontWeight = FontWeight.w600,
2529
overflow = overflow ?? TextOverflow.ellipsis,
2630
super(key: key);
2731

28-
const FlowyText.medium(this.title, {Key? key, this.fontSize = 16, TextOverflow? overflow, this.color, this.textAlign})
32+
const FlowyText.medium(this.title,
33+
{Key? key,
34+
this.fontSize = 16,
35+
TextOverflow? overflow,
36+
this.color,
37+
this.textAlign})
2938
: fontWeight = FontWeight.w500,
3039
overflow = overflow ?? TextOverflow.ellipsis,
3140
super(key: key);
3241

3342
const FlowyText.regular(this.title,
34-
{Key? key, this.fontSize = 16, TextOverflow? overflow, this.color, this.textAlign})
43+
{Key? key,
44+
this.fontSize = 16,
45+
TextOverflow? overflow,
46+
this.color,
47+
this.textAlign})
3548
: fontWeight = FontWeight.w400,
3649
overflow = overflow ?? TextOverflow.ellipsis,
3750
super(key: key);
@@ -40,9 +53,9 @@ class FlowyText extends StatelessWidget {
4053
Widget build(BuildContext context) {
4154
final theme = context.watch<AppTheme>();
4255
return Text(title,
43-
overflow: overflow,
4456
softWrap: false,
4557
textAlign: textAlign,
58+
overflow: overflow,
4659
style: TextStyle(
4760
color: color ?? theme.textColor,
4861
fontWeight: fontWeight,

frontend/rust-lib/flowy-grid/tests/grid/group_test/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ async fn group_move_group_test() {
319319
#[tokio::test]
320320
async fn group_update_field_test() {
321321
let mut test = GridGroupTest::new().await;
322-
let mut group = test.group_at_index(0).await;
322+
let group = test.group_at_index(0).await;
323323
let changeset = FieldChangesetParams {
324324
field_id: group.field_id.clone(),
325325
grid_id: test.grid_id.clone(),

0 commit comments

Comments
 (0)