mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Refactored Values
This commit is contained in:
@ -8,7 +8,7 @@ AssetImage assetImageForViewType(ViewType type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension SvgViewType on View {
|
extension SvgViewType on View {
|
||||||
Widget thumbnail(Color iconColor) {
|
Widget thumbnail({Color? iconColor}) {
|
||||||
final imageName = _imageNameForViewType(viewType);
|
final imageName = _imageNameForViewType(viewType);
|
||||||
final Widget widget = svg(imageName, color: iconColor);
|
final Widget widget = svg(imageName, color: iconColor);
|
||||||
return widget;
|
return widget;
|
||||||
|
@ -33,7 +33,7 @@ class ViewDisclosureButton extends StatelessWidget
|
|||||||
onTap();
|
onTap();
|
||||||
show(context, context);
|
show(context, context);
|
||||||
},
|
},
|
||||||
icon: svg("editor/details", color: theme.textColor),
|
icon: svg("editor/details", color: theme.iconColor),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class ViewSectionItem extends StatelessWidget {
|
|||||||
onTap: () => onSelected(context.read<ViewBloc>().state.view),
|
onTap: () => onSelected(context.read<ViewBloc>().state.view),
|
||||||
child: FlowyHover(
|
child: FlowyHover(
|
||||||
config: HoverDisplayConfig(hoverColor: theme.bg3),
|
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,
|
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<Widget> children = [
|
List<Widget> 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),
|
const HSpace(2),
|
||||||
Expanded(child: FlowyText.regular(state.view.name, fontSize: 12, overflow: TextOverflow.clip)),
|
Expanded(child: FlowyText.regular(state.view.name, fontSize: 12, overflow: TextOverflow.clip)),
|
||||||
];
|
];
|
||||||
|
@ -31,7 +31,7 @@ class MenuTrash extends StatelessWidget {
|
|||||||
Widget _render(BuildContext context) {
|
Widget _render(BuildContext context) {
|
||||||
final theme = context.watch<AppTheme>();
|
final theme = context.watch<AppTheme>();
|
||||||
return Row(children: [
|
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),
|
const HSpace(6),
|
||||||
FlowyText.medium(LocaleKeys.trash_text.tr(), fontSize: 12),
|
FlowyText.medium(LocaleKeys.trash_text.tr(), fontSize: 12),
|
||||||
]);
|
]);
|
||||||
|
@ -65,7 +65,7 @@ class MenuUser extends StatelessWidget {
|
|||||||
backgroundColor: theme.surface,
|
backgroundColor: theme.surface,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: Icon(theme.isDark ? Icons.dark_mode : Icons.light_mode),
|
icon: Icon(theme.isDark ? Icons.dark_mode : Icons.light_mode),
|
||||||
color: (theme.textColor),
|
color: (theme.iconColor),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.read<ThemeModel>().swapTheme();
|
context.read<ThemeModel>().swapTheme();
|
||||||
}),
|
}),
|
||||||
|
Reference in New Issue
Block a user