feat: Improve dark mode in board page (#2193)

* chore: update board UI in dark mode

1. Update BoardSettingList&BoardToolbar UI
2. Update item detail dailogue UI

* chore: update URL cell UI

* chore: update checkList pop up UI and shadow color

* chore: fix flutter analyze issue

* chore: update URL popup textfield and change new property text

* chore: Update NumberTypeOptionWidget and options title UI

* chore: make color value more readable

* chore: flutter analyze

* chore: update sort button style
This commit is contained in:
Yijing Huang
2023-04-10 21:18:36 -05:00
committed by GitHub
parent 28ae193002
commit 1cbedb3277
26 changed files with 118 additions and 90 deletions

View File

@ -7,6 +7,7 @@ import 'package:appflowy/plugins/database_view/grid/presentation/widgets/toolbar
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
@ -104,8 +105,12 @@ class _SettingItem extends StatelessWidget {
return SizedBox(
height: 30,
child: FlowyButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
isSelected: isSelected,
text: FlowyText.medium(action.title()),
text: FlowyText.medium(
action.title(),
color: AFThemeExtension.of(context).textColor,
),
onTap: () {
context
.read<BoardSettingBloc>()

View File

@ -71,6 +71,7 @@ class _SettingButtonState extends State<_SettingButton> {
margin: EdgeInsets.zero,
child: FlowyTextButton(
LocaleKeys.settings_title.tr(),
fontColor: AFThemeExtension.of(context).textColor,
fillColor: Colors.transparent,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
padding: GridSize.typeOptionContentInsets,

View File

@ -28,10 +28,7 @@ class GridSize {
vertical: GridSize.cellVPadding,
);
static EdgeInsets get typeOptionContentInsets => const EdgeInsets.symmetric(
horizontal: 6,
vertical: 2,
);
static EdgeInsets get typeOptionContentInsets => const EdgeInsets.all(4);
static EdgeInsets get footerContentInsets => EdgeInsets.fromLTRB(
GridSize.leadingHeaderPadding,

View File

@ -172,7 +172,7 @@ class FieldCellButton extends StatelessWidget {
leftIcon: FlowySvg(
name: field.fieldType.iconName(),
),
radius: BorderRadius.zero,
radius: BorderRadius.circular(6),
text: FlowyText.medium(
text,
maxLines: maxLines,

View File

@ -189,7 +189,7 @@ class CreateFieldButton extends StatelessWidget {
constraints: BoxConstraints.loose(const Size(240, 600)),
child: FlowyButton(
radius: BorderRadius.zero,
text: FlowyText.medium(LocaleKeys.grid_field_newColumn.tr()),
text: FlowyText.medium(LocaleKeys.grid_field_newProperty.tr()),
hoverColor: AFThemeExtension.of(context).greyHover,
onTap: () {},
leftIcon: const FlowySvg(name: 'home/add'),

View File

@ -3,6 +3,7 @@ import 'package:appflowy/plugins/database_view/application/field/type_option/num
import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_context.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/format.pbenum.dart';
import 'package:flutter/material.dart';
@ -31,6 +32,7 @@ class NumberTypeOptionWidgetBuilder extends TypeOptionWidgetBuilder {
return Column(
children: [
VSpace(GridSize.typeOptionSeparatorHeight),
const TypeOptionSeparator(),
_widget,
],
);
@ -51,55 +53,65 @@ class NumberTypeOptionWidget extends TypeOptionWidget {
return BlocProvider(
create: (context) =>
NumberTypeOptionBloc(typeOptionContext: typeOptionContext),
child: SizedBox(
height: GridSize.popoverItemHeight,
child: BlocConsumer<NumberTypeOptionBloc, NumberTypeOptionState>(
listener: (context, state) =>
typeOptionContext.typeOption = state.typeOption,
builder: (context, state) {
final button = SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
margin: GridSize.typeOptionContentInsets,
rightIcon: svgWidget(
"grid/more",
color: Theme.of(context).iconTheme.color,
),
text: Row(
children: [
FlowyText.medium(LocaleKeys.grid_field_numberFormat.tr()),
const Spacer(),
FlowyText.regular(state.typeOption.format.title()),
],
),
child: BlocConsumer<NumberTypeOptionBloc, NumberTypeOptionState>(
listener: (context, state) =>
typeOptionContext.typeOption = state.typeOption,
builder: (context, state) {
final selectNumUnitButton = SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
margin: GridSize.typeOptionContentInsets,
rightIcon: svgWidget(
"grid/more",
color: AFThemeExtension.of(context).textColor,
),
);
text: FlowyText.regular(
state.typeOption.format.title(),
color: AFThemeExtension.of(context).textColor,
),
),
);
return AppFlowyPopover(
mutex: popoverMutex,
triggerActions:
PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
offset: const Offset(8, 0),
constraints: BoxConstraints.loose(const Size(460, 440)),
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: button,
),
popupBuilder: (BuildContext popoverContext) {
return NumberFormatList(
onSelected: (format) {
context
.read<NumberTypeOptionBloc>()
.add(NumberTypeOptionEvent.didSelectFormat(format));
PopoverContainer.of(popoverContext).close();
final numFormatTitle = Container(
padding: const EdgeInsets.only(left: 6),
height: GridSize.popoverItemHeight,
alignment: Alignment.centerLeft,
child: FlowyText.medium(
LocaleKeys.grid_field_numberFormat.tr(),
color: AFThemeExtension.of(context).textColor,
),
);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
numFormatTitle,
AppFlowyPopover(
mutex: popoverMutex,
triggerActions:
PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
offset: const Offset(8, 0),
constraints: BoxConstraints.loose(const Size(460, 440)),
margin: EdgeInsets.zero,
child: selectNumUnitButton,
popupBuilder: (BuildContext popoverContext) {
return NumberFormatList(
onSelected: (format) {
context
.read<NumberTypeOptionBloc>()
.add(NumberTypeOptionEvent.didSelectFormat(format));
PopoverContainer.of(popoverContext).close();
},
selectedFormat: state.typeOption.format,
);
},
selectedFormat: state.typeOption.format,
);
},
);
},
),
),
],
),
);
},
),
);
}

View File

@ -71,9 +71,11 @@ class OptionTitle extends StatelessWidget {
return BlocBuilder<SelectOptionTypeOptionBloc, SelectOptionTypeOptionState>(
builder: (context, state) {
List<Widget> children = [
FlowyText.medium(
LocaleKeys.grid_field_optionTitle.tr(),
color: Theme.of(context).hintColor,
Padding(
padding: const EdgeInsets.only(left: 9),
child: FlowyText.medium(
LocaleKeys.grid_field_optionTitle.tr(),
),
)
];
if (state.options.isNotEmpty && !state.isEditingOption) {

View File

@ -3,6 +3,7 @@ import 'package:appflowy/plugins/database_view/application/setting/group_bloc.da
import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/field_type_extension.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.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';
@ -79,7 +80,11 @@ class _GridGroupCell extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
text: FlowyText.medium(fieldInfo.name),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
fieldInfo.name,
color: AFThemeExtension.of(context).textColor,
),
leftIcon: svgWidget(
fieldInfo.fieldType.iconName(),
color: Theme.of(context).iconTheme.color,

View File

@ -6,6 +6,7 @@ import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart';
import '../sort/create_sort_list.dart';
@ -33,11 +34,10 @@ class _SortButtonState extends State<SortButton> {
height: 26,
child: FlowyTextButton(
LocaleKeys.grid_settings_sort.tr(),
fontSize: 13,
fontColor: textColor,
fillColor: Colors.transparent,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 2),
padding: GridSize.typeOptionContentInsets,
onPressed: () {
final bloc = context.read<SortMenuBloc>();
if (bloc.state.sortInfos.isEmpty) {

View File

@ -38,6 +38,7 @@ class GridChecklistCellState extends GridCellState<GridChecklistCell> {
return BlocProvider.value(
value: _cellBloc,
child: AppFlowyPopover(
margin: EdgeInsets.zero,
controller: _popover,
constraints: BoxConstraints.loose(const Size(260, 400)),
direction: PopoverDirection.bottomWithLeftAligned,

View File

@ -52,8 +52,7 @@ class _SliverChecklistProgressBarDelegate
) {
return BlocBuilder<ChecklistCellEditorBloc, ChecklistCellEditorState>(
builder: (context, state) {
return Container(
color: Theme.of(context).colorScheme.background,
return Padding(
padding: GridSize.typeOptionContentInsets,
child: Column(
children: [

View File

@ -90,14 +90,15 @@ class URLEditorPopover extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
width: 200,
child: Padding(
padding: const EdgeInsets.all(6),
child: URLCellEditor(
cellController: cellController,
onExit: onExit,
),
return Container(
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(4),
),
padding: const EdgeInsets.all(12),
child: URLCellEditor(
cellController: cellController,
onExit: onExit,
),
);
}

View File

@ -132,6 +132,7 @@ class _GridURLCellState extends GridCellState<GridURLCell> {
);
return AppFlowyPopover(
margin: EdgeInsets.zero,
controller: _popoverController,
constraints: BoxConstraints.loose(const Size(300, 160)),
direction: PopoverDirection.bottomWithLeftAligned,
@ -216,6 +217,7 @@ class _EditURLAccessoryState extends State<_EditURLAccessory>
@override
Widget build(BuildContext context) {
return AppFlowyPopover(
margin: EdgeInsets.zero,
constraints: BoxConstraints.loose(const Size(300, 160)),
controller: _popoverController,
direction: PopoverDirection.bottomWithLeftAligned,
@ -255,7 +257,7 @@ class _CopyURLAccessoryState extends State<_CopyURLAccessory>
Widget build(BuildContext context) {
return svgWidget(
"editor/copy",
color: Theme.of(context).iconTheme.color,
color: AFThemeExtension.of(context).textColor,
);
}

View File

@ -98,6 +98,7 @@ class _CloseButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlowyIconButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
width: 24,
onPressed: () => FlowyOverlay.pop(context),
iconPadding: const EdgeInsets.fromLTRB(2, 2, 2, 2),
@ -210,10 +211,16 @@ class _CreatePropertyButtonState extends State<_CreatePropertyButton> {
height: 40,
decoration: _makeBoxDecoration(context),
child: FlowyButton(
text: FlowyText.medium(LocaleKeys.grid_field_newColumn.tr()),
text: FlowyText.medium(
LocaleKeys.grid_field_newProperty.tr(),
color: AFThemeExtension.of(context).textColor,
),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
onTap: () {},
leftIcon: svgWidget("home/add"),
leftIcon: svgWidget(
"home/add",
color: AFThemeExtension.of(context).textColor,
),
),
),
popupBuilder: (BuildContext popOverContext) {
@ -241,7 +248,6 @@ class _CreatePropertyButtonState extends State<_CreatePropertyButton> {
final borderSide =
BorderSide(color: Theme.of(context).dividerColor, width: 1.0);
return BoxDecoration(
color: Theme.of(context).colorScheme.surface,
border: Border(top: borderSide),
);
}
@ -293,7 +299,6 @@ class _PropertyCellState extends State<_PropertyCell> {
child: SizedBox(
width: 150,
child: FieldCellButton(
maxLines: null,
field: widget.cellId.fieldInfo.field,
onTap: () => popover.show(),
),