mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: UI issues in dark mode (#2344)
* fix: date cell UI issue #2301 * chore: update font size toggle button hover effect * chore: update more button background * chore: update NumberTypeOptionWidge hover style * chore: improve the hover color in _SelectOptionColorCell * chore: update User setting UI * fix: delete unused file * fix: remove the hover effect when delete button is disable
This commit is contained in:
parent
3277f179ef
commit
545e57448a
@ -203,6 +203,7 @@ class _DeleteFieldButton extends StatelessWidget {
|
|||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final enable = !state.canDelete && !state.isGroupField;
|
final enable = !state.canDelete && !state.isGroupField;
|
||||||
Widget button = FlowyButton(
|
Widget button = FlowyButton(
|
||||||
|
disable: !enable,
|
||||||
text: FlowyText.medium(
|
text: FlowyText.medium(
|
||||||
LocaleKeys.grid_field_delete.tr(),
|
LocaleKeys.grid_field_delete.tr(),
|
||||||
color: enable ? null : Theme.of(context).disabledColor,
|
color: enable ? null : Theme.of(context).disabledColor,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import 'package:appflowy_popover/appflowy_popover.dart';
|
import 'package:appflowy_popover/appflowy_popover.dart';
|
||||||
import 'package:flowy_infra/image.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:flowy_infra_ui/flowy_infra_ui.dart';
|
||||||
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
|
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -58,15 +57,12 @@ class FieldTypeCell extends StatelessWidget {
|
|||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: GridSize.popoverItemHeight,
|
height: GridSize.popoverItemHeight,
|
||||||
child: FlowyButton(
|
child: FlowyButton(
|
||||||
hoverColor: AFThemeExtension.of(context).lightGreyHover,
|
|
||||||
text: FlowyText.medium(
|
text: FlowyText.medium(
|
||||||
fieldType.title(),
|
fieldType.title(),
|
||||||
color: AFThemeExtension.of(context).textColor,
|
|
||||||
),
|
),
|
||||||
onTap: () => onSelectField(fieldType),
|
onTap: () => onSelectField(fieldType),
|
||||||
leftIcon: svgWidget(
|
leftIcon: FlowySvg(
|
||||||
fieldType.iconName(),
|
name: fieldType.iconName(),
|
||||||
color: Theme.of(context).iconTheme.color,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -4,7 +4,6 @@ import 'package:appflowy/plugins/database_view/application/field/type_option/typ
|
|||||||
import 'package:appflowy_popover/appflowy_popover.dart';
|
import 'package:appflowy_popover/appflowy_popover.dart';
|
||||||
import 'package:dartz/dartz.dart' show Either;
|
import 'package:dartz/dartz.dart' show Either;
|
||||||
import 'package:flowy_infra/image.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:flowy_infra_ui/flowy_infra_ui.dart';
|
||||||
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
|
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
|
||||||
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
|
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
|
||||||
@ -113,20 +112,12 @@ class _SwitchFieldButton extends StatelessWidget {
|
|||||||
Widget _buildMoreButton(BuildContext context) {
|
Widget _buildMoreButton(BuildContext context) {
|
||||||
final bloc = context.read<FieldTypeOptionEditBloc>();
|
final bloc = context.read<FieldTypeOptionEditBloc>();
|
||||||
return FlowyButton(
|
return FlowyButton(
|
||||||
hoverColor: AFThemeExtension.of(context).lightGreyHover,
|
|
||||||
text: FlowyText.medium(
|
text: FlowyText.medium(
|
||||||
bloc.state.field.fieldType.title(),
|
bloc.state.field.fieldType.title(),
|
||||||
color: AFThemeExtension.of(context).textColor,
|
|
||||||
),
|
),
|
||||||
margin: GridSize.typeOptionContentInsets,
|
margin: GridSize.typeOptionContentInsets,
|
||||||
leftIcon: svgWidget(
|
leftIcon: FlowySvg(name: bloc.state.field.fieldType.iconName()),
|
||||||
bloc.state.field.fieldType.iconName(),
|
rightIcon: const FlowySvg(name: 'grid/more'),
|
||||||
color: Theme.of(context).iconTheme.color,
|
|
||||||
),
|
|
||||||
rightIcon: svgWidget(
|
|
||||||
"grid/more",
|
|
||||||
color: Theme.of(context).iconTheme.color,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ class DateFormatCell extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Widget? checkmark;
|
Widget? checkmark;
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
checkmark = svgWidget("grid/checkmark");
|
checkmark = const FlowySvg(name: 'grid/checkmark');
|
||||||
}
|
}
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
@ -317,7 +317,7 @@ class TimeFormatCell extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Widget? checkmark;
|
Widget? checkmark;
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
checkmark = svgWidget("grid/checkmark");
|
checkmark = const FlowySvg(name: 'grid/checkmark');
|
||||||
}
|
}
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
|
@ -3,7 +3,6 @@ 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/plugins/database_view/application/field/type_option/type_option_context.dart';
|
||||||
import 'package:appflowy_popover/appflowy_popover.dart';
|
import 'package:appflowy_popover/appflowy_popover.dart';
|
||||||
import 'package:flowy_infra/image.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:flowy_infra_ui/flowy_infra_ui.dart';
|
||||||
import 'package:appflowy_backend/protobuf/flowy-database/format.pbenum.dart';
|
import 'package:appflowy_backend/protobuf/flowy-database/format.pbenum.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -60,15 +59,10 @@ class NumberTypeOptionWidget extends TypeOptionWidget {
|
|||||||
final selectNumUnitButton = SizedBox(
|
final selectNumUnitButton = SizedBox(
|
||||||
height: GridSize.popoverItemHeight,
|
height: GridSize.popoverItemHeight,
|
||||||
child: FlowyButton(
|
child: FlowyButton(
|
||||||
hoverColor: AFThemeExtension.of(context).lightGreyHover,
|
|
||||||
margin: GridSize.typeOptionContentInsets,
|
margin: GridSize.typeOptionContentInsets,
|
||||||
rightIcon: svgWidget(
|
rightIcon: const FlowySvg(name: 'grid/more'),
|
||||||
"grid/more",
|
|
||||||
color: AFThemeExtension.of(context).textColor,
|
|
||||||
),
|
|
||||||
text: FlowyText.regular(
|
text: FlowyText.regular(
|
||||||
state.typeOption.format.title(),
|
state.typeOption.format.title(),
|
||||||
color: AFThemeExtension.of(context).textColor,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -79,7 +73,6 @@ class NumberTypeOptionWidget extends TypeOptionWidget {
|
|||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: FlowyText.medium(
|
child: FlowyText.medium(
|
||||||
LocaleKeys.grid_field_numberFormat.tr(),
|
LocaleKeys.grid_field_numberFormat.tr(),
|
||||||
color: AFThemeExtension.of(context).textColor,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return Padding(
|
return Padding(
|
||||||
@ -188,7 +181,9 @@ class NumberFormatCell extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Widget? checkmark;
|
Widget? checkmark;
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
checkmark = svgWidget("grid/checkmark");
|
checkmark = const FlowySvg(
|
||||||
|
name: 'grid/checkmark',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
|
@ -105,15 +105,10 @@ class _DeleteTag extends StatelessWidget {
|
|||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: GridSize.popoverItemHeight,
|
height: GridSize.popoverItemHeight,
|
||||||
child: FlowyButton(
|
child: FlowyButton(
|
||||||
hoverColor: AFThemeExtension.of(context).lightGreyHover,
|
|
||||||
text: FlowyText.medium(
|
text: FlowyText.medium(
|
||||||
LocaleKeys.grid_selectOption_deleteTag.tr(),
|
LocaleKeys.grid_selectOption_deleteTag.tr(),
|
||||||
color: AFThemeExtension.of(context).textColor,
|
|
||||||
),
|
|
||||||
leftIcon: svgWidget(
|
|
||||||
"grid/delete",
|
|
||||||
color: Theme.of(context).iconTheme.color,
|
|
||||||
),
|
),
|
||||||
|
leftIcon: const FlowySvg(name: 'grid/delete'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context
|
context
|
||||||
.read<EditSelectOptionBloc>()
|
.read<EditSelectOptionBloc>()
|
||||||
@ -226,7 +221,11 @@ class _SelectOptionColorCell extends StatelessWidget {
|
|||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: GridSize.popoverItemHeight,
|
height: GridSize.popoverItemHeight,
|
||||||
child: FlowyButton(
|
child: FlowyButton(
|
||||||
text: FlowyText.medium(color.optionName()),
|
hoverColor: AFThemeExtension.of(context).lightGreyHover,
|
||||||
|
text: FlowyText.medium(
|
||||||
|
color.optionName(),
|
||||||
|
color: AFThemeExtension.of(context).textColor,
|
||||||
|
),
|
||||||
leftIcon: colorIcon,
|
leftIcon: colorIcon,
|
||||||
rightIcon: checkmark,
|
rightIcon: checkmark,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
@ -20,7 +20,7 @@ class ChecklistProgressBar extends StatelessWidget {
|
|||||||
percent: percent,
|
percent: percent,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
progressColor: Theme.of(context).colorScheme.primary,
|
progressColor: Theme.of(context).colorScheme.primary,
|
||||||
backgroundColor: AFThemeExtension.of(context).progressBarBGcolor,
|
backgroundColor: AFThemeExtension.of(context).progressBarBGColor,
|
||||||
barRadius: const Radius.circular(5),
|
barRadius: const Radius.circular(5),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:appflowy/plugins/document/presentation/more/cubit/document_appearance_cubit.dart';
|
import 'package:appflowy/plugins/document/presentation/more/cubit/document_appearance_cubit.dart';
|
||||||
|
import 'package:flowy_infra/theme_extension.dart';
|
||||||
import 'package:flowy_infra_ui/style_widget/text.dart';
|
import 'package:flowy_infra_ui/style_widget/text.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||||
@ -24,6 +25,8 @@ class _FontSizeSwitcherState extends State<FontSizeSwitcher> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final selectedBgColor = AFThemeExtension.of(context).toggleButtonBGColor;
|
||||||
|
final foregroundColor = Theme.of(context).colorScheme.onBackground;
|
||||||
return BlocBuilder<DocumentAppearanceCubit, DocumentAppearance>(
|
return BlocBuilder<DocumentAppearanceCubit, DocumentAppearance>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return Column(
|
return Column(
|
||||||
@ -43,10 +46,16 @@ class _FontSizeSwitcherState extends State<FontSizeSwitcher> {
|
|||||||
onPressed: (int index) {
|
onPressed: (int index) {
|
||||||
_updateSelectedFontSize(_fontSizes[index].item2);
|
_updateSelectedFontSize(_fontSizes[index].item2);
|
||||||
},
|
},
|
||||||
|
color: foregroundColor,
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
||||||
selectedColor: Theme.of(context).colorScheme.tertiary,
|
borderColor: foregroundColor,
|
||||||
fillColor: Theme.of(context).colorScheme.primary,
|
borderWidth: 0.5,
|
||||||
color: Theme.of(context).hintColor,
|
// when selected
|
||||||
|
selectedColor: foregroundColor,
|
||||||
|
selectedBorderColor: foregroundColor,
|
||||||
|
fillColor: selectedBgColor,
|
||||||
|
// when hover
|
||||||
|
hoverColor: selectedBgColor.withOpacity(0.3),
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
minHeight: 40.0,
|
minHeight: 40.0,
|
||||||
minWidth: 80.0,
|
minWidth: 80.0,
|
||||||
|
@ -12,6 +12,7 @@ class DocumentMoreButton extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return PopupMenuButton<int>(
|
return PopupMenuButton<int>(
|
||||||
|
color: Theme.of(context).colorScheme.surfaceVariant,
|
||||||
offset: const Offset(0, 30),
|
offset: const Offset(0, 30),
|
||||||
itemBuilder: (context) {
|
itemBuilder: (context) {
|
||||||
return [
|
return [
|
||||||
|
@ -250,6 +250,7 @@ class AppearanceSettingsState with _$AppearanceSettingsState {
|
|||||||
|
|
||||||
return ThemeData(
|
return ThemeData(
|
||||||
brightness: brightness,
|
brightness: brightness,
|
||||||
|
dialogBackgroundColor: theme.surface,
|
||||||
textTheme: _getTextTheme(fontFamily: fontFamily, fontColor: theme.text),
|
textTheme: _getTextTheme(fontFamily: fontFamily, fontColor: theme.text),
|
||||||
textSelectionTheme: TextSelectionThemeData(
|
textSelectionTheme: TextSelectionThemeData(
|
||||||
cursorColor: theme.main2,
|
cursorColor: theme.main2,
|
||||||
@ -316,7 +317,8 @@ class AppearanceSettingsState with _$AppearanceSettingsState {
|
|||||||
greySelect: theme.bg3,
|
greySelect: theme.bg3,
|
||||||
lightGreyHover: theme.hoverBG3,
|
lightGreyHover: theme.hoverBG3,
|
||||||
toggleOffFill: theme.shader5,
|
toggleOffFill: theme.shader5,
|
||||||
progressBarBGcolor: theme.progressBarBGcolor,
|
progressBarBGColor: theme.progressBarBGColor,
|
||||||
|
toggleButtonBGColor: theme.toggleButtonBGColor,
|
||||||
code: _getFontStyle(
|
code: _getFontStyle(
|
||||||
fontFamily: monospaceFontFamily,
|
fontFamily: monospaceFontFamily,
|
||||||
fontColor: theme.shader3,
|
fontColor: theme.shader3,
|
||||||
|
@ -35,9 +35,8 @@ class SettingsFileLocationCustomzierState
|
|||||||
child: BlocBuilder<SettingsLocationCubit, SettingsLocation>(
|
child: BlocBuilder<SettingsLocationCubit, SettingsLocation>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: FlowyText.regular(
|
title: FlowyText.medium(
|
||||||
LocaleKeys.settings_files_defaultLocation.tr(),
|
LocaleKeys.settings_files_defaultLocation.tr(),
|
||||||
fontSize: 15.0,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
subtitle: Tooltip(
|
subtitle: Tooltip(
|
||||||
@ -63,7 +62,6 @@ class SettingsFileLocationCustomzierState
|
|||||||
},
|
},
|
||||||
child: FlowyText.regular(
|
child: FlowyText.regular(
|
||||||
state.path ?? '',
|
state.path ?? '',
|
||||||
fontSize: 10.0,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
import 'package:appflowy/startup/startup.dart';
|
|
||||||
import 'package:appflowy/util/debounce.dart';
|
|
||||||
import 'package:flowy_infra/size.dart';
|
|
||||||
import 'package:flowy_infra_ui/style_widget/text.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:appflowy/workspace/application/user/settings_user_bloc.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
||||||
import 'package:flowy_infra_ui/widget/spacing.dart';
|
|
||||||
import 'package:appflowy_backend/protobuf/flowy-user/user_profile.pb.dart';
|
|
||||||
import 'package:flowy_infra/image.dart';
|
|
||||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||||
|
import 'package:appflowy/startup/startup.dart';
|
||||||
|
import 'package:appflowy/util/debounce.dart';
|
||||||
|
import 'package:appflowy/workspace/application/user/settings_user_bloc.dart';
|
||||||
|
import 'package:appflowy_backend/protobuf/flowy-user/user_profile.pb.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flowy_infra/image.dart';
|
||||||
|
import 'package:flowy_infra/size.dart';
|
||||||
|
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
const defaultUserAvatar = '1F600';
|
const defaultUserAvatar = '1F600';
|
||||||
|
const _iconSize = Size(60, 60);
|
||||||
|
|
||||||
class SettingsUserView extends StatelessWidget {
|
class SettingsUserView extends StatelessWidget {
|
||||||
final UserProfilePB user;
|
final UserProfilePB user;
|
||||||
@ -76,6 +76,17 @@ class UserNameInput extends StatelessWidget {
|
|||||||
controller: TextEditingController()..text = name,
|
controller: TextEditingController()..text = name,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: LocaleKeys.settings_user_name.tr(),
|
labelText: LocaleKeys.settings_user_name.tr(),
|
||||||
|
labelStyle: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleMedium!
|
||||||
|
.copyWith(fontWeight: FontWeight.w500),
|
||||||
|
enabledBorder: UnderlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(color: Theme.of(context).colorScheme.onBackground),
|
||||||
|
),
|
||||||
|
focusedBorder: UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Theme.of(context).colorScheme.primary),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
onSubmitted: (val) {
|
onSubmitted: (val) {
|
||||||
context
|
context
|
||||||
@ -115,14 +126,26 @@ class _OpenaiKeyInputState extends State<_OpenaiKeyInput> {
|
|||||||
controller: textEditingController,
|
controller: textEditingController,
|
||||||
obscureText: !visible,
|
obscureText: !visible,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
enabledBorder: UnderlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(color: Theme.of(context).colorScheme.onBackground),
|
||||||
|
),
|
||||||
|
focusedBorder: UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Theme.of(context).colorScheme.primary),
|
||||||
|
),
|
||||||
labelText: 'OpenAI Key',
|
labelText: 'OpenAI Key',
|
||||||
|
labelStyle: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleMedium!
|
||||||
|
.copyWith(fontWeight: FontWeight.w500),
|
||||||
hintText: LocaleKeys.settings_user_pleaseInputYourOpenAIKey.tr(),
|
hintText: LocaleKeys.settings_user_pleaseInputYourOpenAIKey.tr(),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: FlowyIconButton(
|
||||||
iconSize: 15.0,
|
width: 40,
|
||||||
icon: Icon(visible ? Icons.visibility : Icons.visibility_off),
|
height: 40,
|
||||||
padding: EdgeInsets.zero,
|
hoverColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||||
hoverColor: Colors.transparent,
|
icon: Icon(
|
||||||
splashColor: Colors.transparent,
|
visible ? Icons.visibility : Icons.visibility_off,
|
||||||
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
visible = !visible;
|
visible = !visible;
|
||||||
@ -160,15 +183,24 @@ class _CurrentIcon extends StatelessWidget {
|
|||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Material(
|
return Column(
|
||||||
color: Colors.transparent,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: GestureDetector(
|
children: [
|
||||||
|
Text(
|
||||||
|
LocaleKeys.settings_user_icon.tr(),
|
||||||
|
style: Theme.of(context).textTheme.titleSmall!.copyWith(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
borderRadius: Corners.s6Border,
|
||||||
|
hoverColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return SimpleDialog(
|
return SimpleDialog(
|
||||||
backgroundColor: Theme.of(context).canvasColor,
|
|
||||||
title: FlowyText.medium(
|
title: FlowyText.medium(
|
||||||
LocaleKeys.settings_user_selectAnIcon.tr(),
|
LocaleKeys.settings_user_selectAnIcon.tr(),
|
||||||
fontSize: FontSizes.s16,
|
fontSize: FontSizes.s16,
|
||||||
@ -184,27 +216,15 @@ class _CurrentIcon extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.topLeft,
|
|
||||||
child: Text(
|
|
||||||
LocaleKeys.settings_user_icon.tr(),
|
|
||||||
style: const TextStyle(color: Colors.grey),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.all(5.0),
|
margin: const EdgeInsets.fromLTRB(0, 5, 5, 5),
|
||||||
decoration:
|
child: svgWidget(
|
||||||
BoxDecoration(border: Border.all(color: Colors.grey)),
|
'emoji/$iconUrl',
|
||||||
child: svgWidget('emoji/$iconUrl', size: const Size(60, 60)),
|
size: _iconSize,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -262,19 +282,13 @@ class IconOption extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return InkWell(
|
||||||
color: Colors.transparent,
|
borderRadius: Corners.s6Border,
|
||||||
child: IconButton(
|
|
||||||
iconSize: 15.0,
|
|
||||||
icon: svgWidget(
|
|
||||||
'emoji/$iconUrl',
|
|
||||||
),
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
hoverColor: Theme.of(context).colorScheme.tertiaryContainer,
|
hoverColor: Theme.of(context).colorScheme.tertiaryContainer,
|
||||||
onPressed: () {
|
onTap: () {
|
||||||
setIcon(iconUrl);
|
setIcon(iconUrl);
|
||||||
},
|
},
|
||||||
),
|
child: svgWidget('emoji/$iconUrl', size: _iconSize),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,9 +73,10 @@ abstract class FlowyColorScheme {
|
|||||||
//the text color when it is hovered
|
//the text color when it is hovered
|
||||||
final Color hoverFG;
|
final Color hoverFG;
|
||||||
final Color questionBubbleBG;
|
final Color questionBubbleBG;
|
||||||
final Color progressBarBGcolor;
|
final Color progressBarBGColor;
|
||||||
//editor toolbar BG color
|
//editor toolbar BG color
|
||||||
final Color toolbarColor;
|
final Color toolbarColor;
|
||||||
|
final Color toggleButtonBGColor;
|
||||||
|
|
||||||
const FlowyColorScheme({
|
const FlowyColorScheme({
|
||||||
required this.surface,
|
required this.surface,
|
||||||
@ -121,8 +122,9 @@ abstract class FlowyColorScheme {
|
|||||||
required this.hoverBG3,
|
required this.hoverBG3,
|
||||||
required this.hoverFG,
|
required this.hoverFG,
|
||||||
required this.questionBubbleBG,
|
required this.questionBubbleBG,
|
||||||
required this.progressBarBGcolor,
|
required this.progressBarBGColor,
|
||||||
required this.toolbarColor,
|
required this.toolbarColor,
|
||||||
|
required this.toggleButtonBGColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory FlowyColorScheme.builtIn(String themeName, Brightness brightness) {
|
factory FlowyColorScheme.builtIn(String themeName, Brightness brightness) {
|
||||||
|
@ -10,6 +10,7 @@ const _lightBg1 = Color(0xFFFFD13E);
|
|||||||
const _lightBg2 = Color(0xffedeef2);
|
const _lightBg2 = Color(0xffedeef2);
|
||||||
const _lightShader1 = Color(0xff333333);
|
const _lightShader1 = Color(0xff333333);
|
||||||
const _lightShader3 = Color(0xff828282);
|
const _lightShader3 = Color(0xff828282);
|
||||||
|
const _lightShader5 = Color(0xffe0e0e0);
|
||||||
const _lightShader6 = Color(0xfff2f2f2);
|
const _lightShader6 = Color(0xfff2f2f2);
|
||||||
const _lightMain1 = Color(0xffe21f74);
|
const _lightMain1 = Color(0xffe21f74);
|
||||||
const _lightTint9 = Color(0xffe1fbff);
|
const _lightTint9 = Color(0xffe1fbff);
|
||||||
@ -35,7 +36,7 @@ class DandelionColorScheme extends FlowyColorScheme {
|
|||||||
shader2: const Color(0xff4f4f4f),
|
shader2: const Color(0xff4f4f4f),
|
||||||
shader3: const Color(0xff828282),
|
shader3: const Color(0xff828282),
|
||||||
shader4: const Color(0xffbdbdbd),
|
shader4: const Color(0xffbdbdbd),
|
||||||
shader5: const Color(0xffe0e0e0),
|
shader5: _lightShader5,
|
||||||
shader6: const Color(0xfff2f2f2),
|
shader6: const Color(0xfff2f2f2),
|
||||||
shader7: _black,
|
shader7: _black,
|
||||||
bg1: _lightBg1,
|
bg1: _lightBg1,
|
||||||
@ -68,8 +69,9 @@ class DandelionColorScheme extends FlowyColorScheme {
|
|||||||
hoverBG3: _lightShader6,
|
hoverBG3: _lightShader6,
|
||||||
hoverFG: _lightShader1,
|
hoverFG: _lightShader1,
|
||||||
questionBubbleBG: _lightSelector,
|
questionBubbleBG: _lightSelector,
|
||||||
progressBarBGcolor: _lightTint9,
|
progressBarBGColor: _lightTint9,
|
||||||
toolbarColor: _lightShader1,
|
toolbarColor: _lightShader1,
|
||||||
|
toggleButtonBGColor: _lightShader5,
|
||||||
);
|
);
|
||||||
|
|
||||||
const DandelionColorScheme.dark()
|
const DandelionColorScheme.dark()
|
||||||
@ -117,6 +119,8 @@ class DandelionColorScheme extends FlowyColorScheme {
|
|||||||
hoverBG3: _darkShader3,
|
hoverBG3: _darkShader3,
|
||||||
hoverFG: _darkShader1,
|
hoverFG: _darkShader1,
|
||||||
questionBubbleBG: _darkShader3,
|
questionBubbleBG: _darkShader3,
|
||||||
progressBarBGcolor: _darkShader3,
|
progressBarBGColor: _darkShader3,
|
||||||
toolbarColor: _darkInput);
|
toolbarColor: _darkInput,
|
||||||
|
toggleButtonBGColor: _darkShader1,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ const _lightBg1 = Color(0xfff7f8fc);
|
|||||||
const _lightBg2 = Color(0xffedeef2);
|
const _lightBg2 = Color(0xffedeef2);
|
||||||
const _lightShader1 = Color(0xff333333);
|
const _lightShader1 = Color(0xff333333);
|
||||||
const _lightShader3 = Color(0xff828282);
|
const _lightShader3 = Color(0xff828282);
|
||||||
|
const _lightShader5 = Color(0xffe0e0e0);
|
||||||
const _lightShader6 = Color(0xfff2f2f2);
|
const _lightShader6 = Color(0xfff2f2f2);
|
||||||
const _lightMain1 = Color(0xff00bcf0);
|
const _lightMain1 = Color(0xff00bcf0);
|
||||||
const _lightTint9 = Color(0xffe1fbff);
|
const _lightTint9 = Color(0xffe1fbff);
|
||||||
@ -33,7 +34,7 @@ class DefaultColorScheme extends FlowyColorScheme {
|
|||||||
shader2: const Color(0xff4f4f4f),
|
shader2: const Color(0xff4f4f4f),
|
||||||
shader3: _lightShader3,
|
shader3: _lightShader3,
|
||||||
shader4: const Color(0xffbdbdbd),
|
shader4: const Color(0xffbdbdbd),
|
||||||
shader5: const Color(0xffe0e0e0),
|
shader5: _lightShader5,
|
||||||
shader6: _lightShader6,
|
shader6: _lightShader6,
|
||||||
shader7: _lightShader1,
|
shader7: _lightShader1,
|
||||||
bg1: _lightBg1,
|
bg1: _lightBg1,
|
||||||
@ -66,8 +67,9 @@ class DefaultColorScheme extends FlowyColorScheme {
|
|||||||
hoverFG: _lightShader1,
|
hoverFG: _lightShader1,
|
||||||
questionBubbleBG: _lightSelector,
|
questionBubbleBG: _lightSelector,
|
||||||
hoverBG3: _lightShader6,
|
hoverBG3: _lightShader6,
|
||||||
progressBarBGcolor: _lightTint9,
|
progressBarBGColor: _lightTint9,
|
||||||
toolbarColor: _lightShader1,
|
toolbarColor: _lightShader1,
|
||||||
|
toggleButtonBGColor: _lightShader5,
|
||||||
);
|
);
|
||||||
|
|
||||||
const DefaultColorScheme.dark()
|
const DefaultColorScheme.dark()
|
||||||
@ -115,7 +117,8 @@ class DefaultColorScheme extends FlowyColorScheme {
|
|||||||
hoverBG3: _darkShader3,
|
hoverBG3: _darkShader3,
|
||||||
hoverFG: _darkShader1,
|
hoverFG: _darkShader1,
|
||||||
questionBubbleBG: _darkShader3,
|
questionBubbleBG: _darkShader3,
|
||||||
progressBarBGcolor: _darkShader3,
|
progressBarBGColor: _darkShader3,
|
||||||
toolbarColor: _darkInput,
|
toolbarColor: _darkInput,
|
||||||
|
toggleButtonBGColor: _darkShader1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ const _lightBg1 = Color(0xfff7f8fc);
|
|||||||
const _lightBg2 = Color(0xffedeef2);
|
const _lightBg2 = Color(0xffedeef2);
|
||||||
const _lightShader1 = Color(0xff333333);
|
const _lightShader1 = Color(0xff333333);
|
||||||
const _lightShader3 = Color(0xff828282);
|
const _lightShader3 = Color(0xff828282);
|
||||||
|
const _lightShader5 = Color(0xffe0e0e0);
|
||||||
const _lightShader6 = Color(0xfff2f2f2);
|
const _lightShader6 = Color(0xfff2f2f2);
|
||||||
const _lightMain1 = Color(0xffA652FB);
|
const _lightMain1 = Color(0xffA652FB);
|
||||||
const _lightTint9 = Color(0xffe1fbff);
|
const _lightTint9 = Color(0xffe1fbff);
|
||||||
@ -36,7 +37,7 @@ class LavenderColorScheme extends FlowyColorScheme {
|
|||||||
shader2: const Color(0xff4f4f4f),
|
shader2: const Color(0xff4f4f4f),
|
||||||
shader3: const Color(0xff828282),
|
shader3: const Color(0xff828282),
|
||||||
shader4: const Color(0xffbdbdbd),
|
shader4: const Color(0xffbdbdbd),
|
||||||
shader5: const Color(0xffe0e0e0),
|
shader5: _lightShader5,
|
||||||
shader6: const Color(0xfff2f2f2),
|
shader6: const Color(0xfff2f2f2),
|
||||||
shader7: _black,
|
shader7: _black,
|
||||||
bg1: const Color(0xffAC59FF),
|
bg1: const Color(0xffAC59FF),
|
||||||
@ -69,8 +70,9 @@ class LavenderColorScheme extends FlowyColorScheme {
|
|||||||
hoverBG3: _lightShader6,
|
hoverBG3: _lightShader6,
|
||||||
hoverFG: _lightShader1,
|
hoverFG: _lightShader1,
|
||||||
questionBubbleBG: _lightSelector,
|
questionBubbleBG: _lightSelector,
|
||||||
progressBarBGcolor: _lightTint9,
|
progressBarBGColor: _lightTint9,
|
||||||
toolbarColor: _lightShader1,
|
toolbarColor: _lightShader1,
|
||||||
|
toggleButtonBGColor: _lightShader5,
|
||||||
);
|
);
|
||||||
|
|
||||||
const LavenderColorScheme.dark()
|
const LavenderColorScheme.dark()
|
||||||
@ -118,7 +120,8 @@ class LavenderColorScheme extends FlowyColorScheme {
|
|||||||
hoverBG3: _darkShader3,
|
hoverBG3: _darkShader3,
|
||||||
hoverFG: _darkShader1,
|
hoverFG: _darkShader1,
|
||||||
questionBubbleBG: _darkShader3,
|
questionBubbleBG: _darkShader3,
|
||||||
progressBarBGcolor: _darkShader3,
|
progressBarBGColor: _darkShader3,
|
||||||
toolbarColor: _darkInput,
|
toolbarColor: _darkInput,
|
||||||
|
toggleButtonBGColor: _darkShader1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,8 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
|
|||||||
final Color greySelect;
|
final Color greySelect;
|
||||||
final Color lightGreyHover;
|
final Color lightGreyHover;
|
||||||
final Color toggleOffFill;
|
final Color toggleOffFill;
|
||||||
final Color progressBarBGcolor;
|
final Color progressBarBGColor;
|
||||||
|
final Color toggleButtonBGColor;
|
||||||
|
|
||||||
final TextStyle code;
|
final TextStyle code;
|
||||||
final TextStyle callout;
|
final TextStyle callout;
|
||||||
@ -46,7 +47,8 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
|
|||||||
required this.code,
|
required this.code,
|
||||||
required this.callout,
|
required this.callout,
|
||||||
required this.caption,
|
required this.caption,
|
||||||
required this.progressBarBGcolor,
|
required this.progressBarBGColor,
|
||||||
|
required this.toggleButtonBGColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
static AFThemeExtension of(BuildContext context) {
|
static AFThemeExtension of(BuildContext context) {
|
||||||
@ -71,7 +73,8 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
|
|||||||
Color? greySelect,
|
Color? greySelect,
|
||||||
Color? lightGreyHover,
|
Color? lightGreyHover,
|
||||||
Color? toggleOffFill,
|
Color? toggleOffFill,
|
||||||
Color? progressBarBGcolor,
|
Color? progressBarBGColor,
|
||||||
|
Color? toggleButtonBGColor,
|
||||||
TextStyle? code,
|
TextStyle? code,
|
||||||
TextStyle? callout,
|
TextStyle? callout,
|
||||||
TextStyle? caption,
|
TextStyle? caption,
|
||||||
@ -93,7 +96,8 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
|
|||||||
greySelect: greySelect ?? this.greySelect,
|
greySelect: greySelect ?? this.greySelect,
|
||||||
lightGreyHover: lightGreyHover ?? this.lightGreyHover,
|
lightGreyHover: lightGreyHover ?? this.lightGreyHover,
|
||||||
toggleOffFill: toggleOffFill ?? this.toggleOffFill,
|
toggleOffFill: toggleOffFill ?? this.toggleOffFill,
|
||||||
progressBarBGcolor: progressBarBGcolor ?? this.progressBarBGcolor,
|
progressBarBGColor: progressBarBGColor ?? this.progressBarBGColor,
|
||||||
|
toggleButtonBGColor: toggleButtonBGColor ?? this.toggleButtonBGColor,
|
||||||
code: code ?? this.code,
|
code: code ?? this.code,
|
||||||
callout: callout ?? this.callout,
|
callout: callout ?? this.callout,
|
||||||
caption: caption ?? this.caption,
|
caption: caption ?? this.caption,
|
||||||
@ -123,8 +127,10 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
|
|||||||
greySelect: Color.lerp(greySelect, other.greySelect, t)!,
|
greySelect: Color.lerp(greySelect, other.greySelect, t)!,
|
||||||
lightGreyHover: Color.lerp(lightGreyHover, other.lightGreyHover, t)!,
|
lightGreyHover: Color.lerp(lightGreyHover, other.lightGreyHover, t)!,
|
||||||
toggleOffFill: Color.lerp(toggleOffFill, other.toggleOffFill, t)!,
|
toggleOffFill: Color.lerp(toggleOffFill, other.toggleOffFill, t)!,
|
||||||
progressBarBGcolor:
|
progressBarBGColor:
|
||||||
Color.lerp(progressBarBGcolor, other.progressBarBGcolor, t)!,
|
Color.lerp(progressBarBGColor, other.progressBarBGColor, t)!,
|
||||||
|
toggleButtonBGColor:
|
||||||
|
Color.lerp(toggleButtonBGColor, other.toggleButtonBGColor, t)!,
|
||||||
code: other.code,
|
code: other.code,
|
||||||
callout: other.callout,
|
callout: other.callout,
|
||||||
caption: other.caption,
|
caption: other.caption,
|
||||||
|
Loading…
Reference in New Issue
Block a user