From 95378dd73a73ee2af5d21e811db348dcc14485a2 Mon Sep 17 00:00:00 2001 From: Sean RIley Hawkins Date: Mon, 10 Jan 2022 17:26:12 +0200 Subject: [PATCH] Refactored Values --- frontend/app_flowy/lib/workspace/domain/image.dart | 2 +- .../widgets/menu/widget/app/section/disclosure_action.dart | 2 +- .../presentation/widgets/menu/widget/app/section/item.dart | 6 +++--- .../presentation/widgets/menu/widget/menu_trash.dart | 2 +- .../presentation/widgets/menu/widget/menu_user.dart | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/app_flowy/lib/workspace/domain/image.dart b/frontend/app_flowy/lib/workspace/domain/image.dart index 2a41964b7d..c32b884c11 100644 --- a/frontend/app_flowy/lib/workspace/domain/image.dart +++ b/frontend/app_flowy/lib/workspace/domain/image.dart @@ -8,7 +8,7 @@ AssetImage assetImageForViewType(ViewType type) { } extension SvgViewType on View { - Widget thumbnail(Color iconColor) { + Widget thumbnail({Color? iconColor}) { final imageName = _imageNameForViewType(viewType); final Widget widget = svg(imageName, color: iconColor); return widget; diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/disclosure_action.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/disclosure_action.dart index 95bc5bf050..63b79dabe7 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/disclosure_action.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/disclosure_action.dart @@ -33,7 +33,7 @@ class ViewDisclosureButton extends StatelessWidget onTap(); show(context, context); }, - icon: svg("editor/details", color: theme.textColor), + icon: svg("editor/details", color: theme.iconColor), ); } diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/item.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/item.dart index 189ed88ac4..3a18cfbc06 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/item.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/item.dart @@ -44,7 +44,7 @@ class ViewSectionItem extends StatelessWidget { onTap: () => onSelected(context.read().state.view), child: FlowyHover( config: HoverDisplayConfig(hoverColor: theme.bg3), - builder: (_, onHover) => _render(context, onHover, state, theme.textColor), + builder: (_, onHover) => _render(context, onHover, state, theme.iconColor), isOnSelected: () => state.isEditing || isSelected, ), ); @@ -53,9 +53,9 @@ class ViewSectionItem extends StatelessWidget { ); } - Widget _render(BuildContext context, bool onHover, ViewState state, Color icon) { + Widget _render(BuildContext context, bool onHover, ViewState state, Color iconColor) { List children = [ - SizedBox(width: 16, height: 16, child: state.view.thumbnail(icon)), + SizedBox(width: 16, height: 16, child: state.view.thumbnail(iconColor: iconColor)), const HSpace(2), Expanded(child: FlowyText.regular(state.view.name, fontSize: 12, overflow: TextOverflow.clip)), ]; diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/menu_trash.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/menu_trash.dart index e5dd4b3d20..65aca331e9 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/menu_trash.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/menu_trash.dart @@ -31,7 +31,7 @@ class MenuTrash extends StatelessWidget { Widget _render(BuildContext context) { final theme = context.watch(); return Row(children: [ - SizedBox(width: 16, height: 16, child: svg("home/trash", color: theme.textColor)), + SizedBox(width: 16, height: 16, child: svg("home/trash", color: theme.iconColor)), const HSpace(6), FlowyText.medium(LocaleKeys.trash_text.tr(), fontSize: 12), ]); diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/menu_user.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/menu_user.dart index 3ca163efe9..29775a264b 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/menu_user.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/menu/widget/menu_user.dart @@ -65,7 +65,7 @@ class MenuUser extends StatelessWidget { backgroundColor: theme.surface, child: IconButton( icon: Icon(theme.isDark ? Icons.dark_mode : Icons.light_mode), - color: (theme.textColor), + color: (theme.iconColor), onPressed: () { context.read().swapTheme(); }),