mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: upgrade to Flutter 3.22.0 (#5395)
* chore: upgrade flutter to 3.22.0 * chore: upgrade editor version * chore: upgrade CI files * fix: failed tests
This commit is contained in:
@ -92,7 +92,7 @@ class FlowyIconPicker extends StatelessWidget {
|
||||
child: TabBar(
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
isScrollable: true,
|
||||
overlayColor: MaterialStatePropertyAll(
|
||||
overlayColor: WidgetStatePropertyAll(
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
padding: EdgeInsets.zero,
|
||||
|
@ -20,6 +20,7 @@ import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
||||
import 'package:appflowy_board/appflowy_board.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flowy_infra_ui/style_widget/hover.dart';
|
||||
import 'package:flowy_infra_ui/widget/error_page.dart';
|
||||
@ -671,7 +672,7 @@ class _BoardCardState extends State<_BoardCard> {
|
||||
? const Color(0x0F1F2329)
|
||||
: const Color(0x0FEFF4FB),
|
||||
foregroundColorOnHover:
|
||||
Theme.of(context).colorScheme.onBackground,
|
||||
AFThemeExtension.of(context).onBackground,
|
||||
),
|
||||
),
|
||||
onStartEditing: () =>
|
||||
|
@ -238,7 +238,7 @@ class NewEventButton extends StatelessWidget {
|
||||
child: FlowyIconButton(
|
||||
onPressed: onCreate,
|
||||
icon: const FlowySvg(FlowySvgs.add_s),
|
||||
fillColor: Theme.of(context).colorScheme.background,
|
||||
fillColor: Theme.of(context).colorScheme.surface,
|
||||
hoverColor: AFThemeExtension.of(context).lightGreyHover,
|
||||
width: 22,
|
||||
tooltipText: LocaleKeys.calendar_newEventButtonTooltip.tr(),
|
||||
@ -289,8 +289,8 @@ class _DayBadge extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Color dayTextColor = Theme.of(context).colorScheme.onBackground;
|
||||
Color monthTextColor = Theme.of(context).colorScheme.onBackground;
|
||||
Color dayTextColor = AFThemeExtension.of(context).onBackground;
|
||||
Color monthTextColor = AFThemeExtension.of(context).onBackground;
|
||||
final String monthString =
|
||||
DateFormat("MMM ", context.locale.toLanguageTag()).format(date);
|
||||
final String dayString = date.day.toString();
|
||||
|
@ -8,6 +8,7 @@ import 'package:appflowy/workspace/application/view/view_bloc.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:appflowy_popover/appflowy_popover.dart';
|
||||
import 'package:flowy_infra/size.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flowy_infra_ui/style_widget/hover.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -15,7 +16,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../application/calendar_bloc.dart';
|
||||
|
||||
import 'calendar_event_editor.dart';
|
||||
|
||||
class EventCard extends StatefulWidget {
|
||||
@ -102,7 +102,7 @@ class _EventCardState extends State<EventCard> {
|
||||
hoverColor: Theme.of(context).brightness == Brightness.light
|
||||
? const Color(0x0F1F2329)
|
||||
: const Color(0x0FEFF4FB),
|
||||
foregroundColorOnHover: Theme.of(context).colorScheme.onBackground,
|
||||
foregroundColorOnHover: AFThemeExtension.of(context).onBackground,
|
||||
),
|
||||
),
|
||||
onStartEditing: () {},
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
|
||||
@ -21,12 +19,12 @@ import 'package:flowy_infra/size.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../../application/row/row_controller.dart';
|
||||
import '../../widgets/row/row_detail.dart';
|
||||
|
||||
import 'calendar_day.dart';
|
||||
import 'layout/sizes.dart';
|
||||
import 'toolbar/calendar_setting_bar.dart';
|
||||
|
@ -43,7 +43,7 @@ Widget getGridFabs(BuildContext context) {
|
||||
.read<GridBloc>()
|
||||
.add(const GridEvent.createRow(openRowDetail: true));
|
||||
},
|
||||
overlayColor: const MaterialStatePropertyAll<Color>(Color(0xFF009FD1)),
|
||||
overlayColor: const WidgetStatePropertyAll<Color>(Color(0xFF009FD1)),
|
||||
boxShadow: const BoxShadow(
|
||||
offset: Offset(0, 8),
|
||||
color: Color(0x6612BFEF),
|
||||
@ -75,7 +75,7 @@ class MobileGridFab extends StatelessWidget {
|
||||
final VoidCallback onTap;
|
||||
final FlowySvgData icon;
|
||||
final Size iconSize;
|
||||
final MaterialStateProperty<Color?>? overlayColor;
|
||||
final WidgetStateProperty<Color?>? overlayColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -77,22 +77,22 @@ class _DatabaseViewSelectorButton extends StatelessWidget {
|
||||
|
||||
return TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: const MaterialStatePropertyAll(
|
||||
padding: const WidgetStatePropertyAll(
|
||||
EdgeInsets.fromLTRB(12, 8, 8, 8),
|
||||
),
|
||||
maximumSize: const MaterialStatePropertyAll(Size(200, 48)),
|
||||
minimumSize: const MaterialStatePropertyAll(Size(48, 0)),
|
||||
shape: const MaterialStatePropertyAll(
|
||||
maximumSize: const WidgetStatePropertyAll(Size(200, 48)),
|
||||
minimumSize: const WidgetStatePropertyAll(Size(48, 0)),
|
||||
shape: const WidgetStatePropertyAll(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
),
|
||||
backgroundColor: MaterialStatePropertyAll(
|
||||
backgroundColor: WidgetStatePropertyAll(
|
||||
Theme.of(context).brightness == Brightness.light
|
||||
? const Color(0x0F212729)
|
||||
: const Color(0x0FFFFFFF),
|
||||
),
|
||||
overlayColor: MaterialStatePropertyAll(
|
||||
overlayColor: WidgetStatePropertyAll(
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
@ -119,7 +119,6 @@ class _DatabaseViewSelectorButton extends StatelessWidget {
|
||||
showTransitionMobileBottomSheet(
|
||||
context,
|
||||
showDivider: false,
|
||||
initialStop: 1.0,
|
||||
builder: (_) {
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
|
@ -42,7 +42,6 @@ class MobileGridRelationCellSkin extends IEditableRelationCellSkin {
|
||||
onTap: () {
|
||||
showMobileBottomSheet(
|
||||
context,
|
||||
padding: EdgeInsets.zero,
|
||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||
builder: (context) {
|
||||
return const FlowyText("Coming soon");
|
||||
|
@ -2,6 +2,7 @@ import 'package:appflowy/mobile/presentation/bottom_sheet/show_mobile_bottom_she
|
||||
import 'package:appflowy/plugins/database/application/cell/bloc/url_cell_bloc.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/row/accessory/cell_accessory.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
@ -51,7 +52,7 @@ class MobileGridURLCellSkin extends IEditableURLCellSkin {
|
||||
showMobileBottomSheet(
|
||||
context,
|
||||
showDragHandle: true,
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
backgroundColor: AFThemeExtension.of(context).background,
|
||||
builder: (context) => BlocProvider.value(
|
||||
value: bloc,
|
||||
child: MobileURLEditor(
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.dart';
|
||||
import 'package:appflowy/plugins/database/application/cell/bloc/checkbox_cell_bloc.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../editable_cell_skeleton/checkbox.dart';
|
||||
@ -31,7 +32,7 @@ class MobileRowDetailCheckboxCellSkin extends IEditableCheckboxCellSkin {
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: FlowySvg(
|
||||
state.isSelected ? FlowySvgs.check_filled_s : FlowySvgs.uncheck_s,
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
color: AFThemeExtension.of(context).onBackground,
|
||||
blendMode: BlendMode.dst,
|
||||
size: const Size.square(24),
|
||||
),
|
||||
|
@ -1,11 +1,12 @@
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.dart';
|
||||
import 'package:appflowy/plugins/database/application/cell/bloc/checklist_cell_bloc.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/cell_editor/checklist_progress_bar.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/cell_editor/mobile_checklist_cell_editor.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.dart';
|
||||
import 'package:appflowy_popover/appflowy_popover.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
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';
|
||||
@ -25,7 +26,7 @@ class MobileRowDetailChecklistCellSkin extends IEditableChecklistCellSkin {
|
||||
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
||||
onTap: () => showMobileBottomSheet(
|
||||
context,
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
backgroundColor: AFThemeExtension.of(context).background,
|
||||
builder: (context) {
|
||||
return BlocProvider.value(
|
||||
value: bloc,
|
||||
|
@ -19,7 +19,6 @@ class MobileRowDetailRelationCellSkin extends IEditableRelationCellSkin {
|
||||
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
||||
onTap: () => showMobileBottomSheet(
|
||||
context,
|
||||
padding: EdgeInsets.zero,
|
||||
builder: (context) {
|
||||
return const FlowyText("Coming soon");
|
||||
},
|
||||
|
@ -1,12 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart';
|
||||
import 'package:appflowy/plugins/database/application/cell/bloc/url_cell_bloc.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/row/accessory/cell_accessory.dart';
|
||||
import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
|
||||
import '../editable_cell_skeleton/url.dart';
|
||||
|
||||
@ -28,7 +28,7 @@ class MobileRowDetailURLCellSkin extends IEditableURLCellSkin {
|
||||
onTap: () => showMobileBottomSheet(
|
||||
context,
|
||||
showDragHandle: true,
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
backgroundColor: AFThemeExtension.of(context).background,
|
||||
builder: (_) {
|
||||
return BlocProvider.value(
|
||||
value: bloc,
|
||||
|
@ -423,7 +423,7 @@ class _DeleteTaskButton extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DeleteTaskButtonState extends State<_DeleteTaskButton> {
|
||||
final _materialStatesController = MaterialStatesController();
|
||||
final _materialStatesController = WidgetStatesController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@ -438,16 +438,16 @@ class _DeleteTaskButtonState extends State<_DeleteTaskButton> {
|
||||
onHover: (_) => setState(() {}),
|
||||
onFocusChange: (_) => setState(() {}),
|
||||
style: ButtonStyle(
|
||||
fixedSize: const MaterialStatePropertyAll(Size.square(32)),
|
||||
minimumSize: const MaterialStatePropertyAll(Size.square(32)),
|
||||
maximumSize: const MaterialStatePropertyAll(Size.square(32)),
|
||||
overlayColor: MaterialStateProperty.resolveWith((state) {
|
||||
if (state.contains(MaterialState.focused)) {
|
||||
fixedSize: const WidgetStatePropertyAll(Size.square(32)),
|
||||
minimumSize: const WidgetStatePropertyAll(Size.square(32)),
|
||||
maximumSize: const WidgetStatePropertyAll(Size.square(32)),
|
||||
overlayColor: WidgetStateProperty.resolveWith((state) {
|
||||
if (state.contains(WidgetState.focused)) {
|
||||
return AFThemeExtension.of(context).greyHover;
|
||||
}
|
||||
return Colors.transparent;
|
||||
}),
|
||||
shape: const MaterialStatePropertyAll(
|
||||
shape: const WidgetStatePropertyAll(
|
||||
RoundedRectangleBorder(borderRadius: Corners.s6Border),
|
||||
),
|
||||
),
|
||||
@ -455,8 +455,8 @@ class _DeleteTaskButtonState extends State<_DeleteTaskButton> {
|
||||
child: FlowySvg(
|
||||
FlowySvgs.delete_s,
|
||||
color: _materialStatesController.value
|
||||
.contains(MaterialState.hovered) ||
|
||||
_materialStatesController.value.contains(MaterialState.focused)
|
||||
.contains(WidgetState.hovered) ||
|
||||
_materialStatesController.value.contains(WidgetState.focused)
|
||||
? Theme.of(context).colorScheme.error
|
||||
: null,
|
||||
),
|
||||
|
@ -422,7 +422,7 @@ class _UnselectRowButton extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _UnselectRowButtonState extends State<_UnselectRowButton> {
|
||||
final _materialStatesController = MaterialStatesController();
|
||||
final _materialStatesController = WidgetStatesController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@ -437,26 +437,25 @@ class _UnselectRowButtonState extends State<_UnselectRowButton> {
|
||||
onHover: (_) => setState(() {}),
|
||||
onFocusChange: (_) => setState(() {}),
|
||||
style: ButtonStyle(
|
||||
fixedSize: const MaterialStatePropertyAll(Size.square(32)),
|
||||
minimumSize: const MaterialStatePropertyAll(Size.square(32)),
|
||||
maximumSize: const MaterialStatePropertyAll(Size.square(32)),
|
||||
overlayColor: MaterialStateProperty.resolveWith((state) {
|
||||
if (state.contains(MaterialState.focused)) {
|
||||
fixedSize: const WidgetStatePropertyAll(Size.square(32)),
|
||||
minimumSize: const WidgetStatePropertyAll(Size.square(32)),
|
||||
maximumSize: const WidgetStatePropertyAll(Size.square(32)),
|
||||
overlayColor: WidgetStateProperty.resolveWith((state) {
|
||||
if (state.contains(WidgetState.focused)) {
|
||||
return AFThemeExtension.of(context).greyHover;
|
||||
}
|
||||
return Colors.transparent;
|
||||
}),
|
||||
shape: const MaterialStatePropertyAll(
|
||||
shape: const WidgetStatePropertyAll(
|
||||
RoundedRectangleBorder(borderRadius: Corners.s6Border),
|
||||
),
|
||||
),
|
||||
statesController: _materialStatesController,
|
||||
child: Container(
|
||||
color: _materialStatesController.value
|
||||
.contains(MaterialState.hovered) ||
|
||||
_materialStatesController.value.contains(MaterialState.focused)
|
||||
color: _materialStatesController.value.contains(WidgetState.hovered) ||
|
||||
_materialStatesController.value.contains(WidgetState.focused)
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.onBackground,
|
||||
: AFThemeExtension.of(context).onBackground,
|
||||
width: 12,
|
||||
height: 1,
|
||||
),
|
||||
|
@ -380,7 +380,7 @@ class _SelectOptionCellState extends State<_SelectOptionCell> {
|
||||
icon: FlowySvg(
|
||||
FlowySvgs.three_dots_s,
|
||||
size: const Size.square(16),
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
color: AFThemeExtension.of(context).onBackground,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -462,7 +462,7 @@ class SelectOptionTagCell extends StatelessWidget {
|
||||
child: FlowySvg(
|
||||
FlowySvgs.drag_element_s,
|
||||
size: const Size.square(14),
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
color: AFThemeExtension.of(context).onBackground,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -314,17 +314,17 @@ class ToggleHiddenFieldsVisibilityButton extends StatelessWidget {
|
||||
constraints: const BoxConstraints(minWidth: double.infinity),
|
||||
child: TextButton.icon(
|
||||
style: Theme.of(context).textButtonTheme.style?.copyWith(
|
||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all<Color>(
|
||||
overlayColor: WidgetStateProperty.all<Color>(
|
||||
Theme.of(context).hoverColor,
|
||||
),
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
splashFactory: NoSplash.splashFactory,
|
||||
padding: const MaterialStatePropertyAll(
|
||||
padding: const WidgetStatePropertyAll(
|
||||
EdgeInsets.symmetric(vertical: 14, horizontal: 6),
|
||||
),
|
||||
),
|
||||
|
@ -9,6 +9,7 @@ import 'package:appflowy/plugins/database/grid/application/sort/sort_editor_bloc
|
||||
import 'package:appflowy/plugins/database/grid/presentation/grid_page.dart';
|
||||
import 'package:appflowy/workspace/application/view/view_bloc.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
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';
|
||||
@ -128,7 +129,6 @@ void _showDatabaseFieldListFromToolbar(
|
||||
showHeader: true,
|
||||
showBackButton: true,
|
||||
title: LocaleKeys.grid_settings_properties.tr(),
|
||||
showDivider: true,
|
||||
builder: (_) {
|
||||
return BlocProvider.value(
|
||||
value: context.read<ViewBloc>(),
|
||||
@ -150,7 +150,7 @@ void _showEditSortPanelFromToolbar(
|
||||
showDragHandle: true,
|
||||
showDivider: false,
|
||||
useSafeArea: false,
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
backgroundColor: AFThemeExtension.of(context).background,
|
||||
builder: (_) {
|
||||
return BlocProvider.value(
|
||||
value: context.read<SortEditorBloc>(),
|
||||
|
@ -23,7 +23,7 @@ class DocumentBanner extends StatelessWidget {
|
||||
constraints: const BoxConstraints(minHeight: 60),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
color: colorScheme.surfaceVariant,
|
||||
color: colorScheme.surfaceContainerHighest,
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Row(
|
||||
|
@ -437,7 +437,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
|
||||
Material(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceVariant,
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: FindAndReplaceMenuWidget(
|
||||
|
@ -74,7 +74,6 @@ class MobileBlockActionButtons extends StatelessWidget {
|
||||
context,
|
||||
showHeader: true,
|
||||
showCloseButton: true,
|
||||
showDivider: true,
|
||||
showDragHandle: true,
|
||||
title: LocaleKeys.document_plugins_action.tr(),
|
||||
builder: (context) {
|
||||
|
@ -300,7 +300,7 @@ class ColorOptionAction extends PopoverActionCell {
|
||||
colors: colors,
|
||||
selected: selectedColor,
|
||||
border: Border.all(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
color: AFThemeExtension.of(context).onBackground,
|
||||
),
|
||||
onTap: (option, index) async {
|
||||
final transaction = editorState.transaction;
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/base/selectable_item_list_menu.dart';
|
||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/base/string_extension.dart';
|
||||
@ -8,7 +6,9 @@ import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:appflowy_editor_plugins/appflowy_editor_plugins.dart';
|
||||
import 'package:appflowy_popover/appflowy_popover.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
CodeBlockLanguagePickerBuilder codeBlockLanguagePickerBuilder = (
|
||||
@ -70,7 +70,7 @@ class _CodeBlockLanguageSelectorState
|
||||
widget.language?.capitalize() ??
|
||||
LocaleKeys.document_codeBlock_language_auto.tr(),
|
||||
constraints: const BoxConstraints(minWidth: 50),
|
||||
fontColor: Theme.of(context).colorScheme.onBackground,
|
||||
fontColor: AFThemeExtension.of(context).onBackground,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6.0, vertical: 4),
|
||||
fillColor: Colors.transparent,
|
||||
hoverColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||
|
@ -61,7 +61,7 @@ class _ErrorBlockComponentWidgetState extends State<ErrorBlockComponentWidget>
|
||||
Widget build(BuildContext context) {
|
||||
Widget child = DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceVariant,
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: FlowyButton(
|
||||
|
@ -49,7 +49,7 @@ class ImagePlaceholderState extends State<ImagePlaceholder> {
|
||||
Widget build(BuildContext context) {
|
||||
final Widget child = DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceVariant,
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: FlowyHover(
|
||||
|
@ -14,7 +14,7 @@ class UnSupportImageWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceVariant,
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: FlowyHover(
|
||||
|
@ -107,7 +107,7 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
|
||||
}),
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
isScrollable: true,
|
||||
overlayColor: MaterialStatePropertyAll(
|
||||
overlayColor: WidgetStatePropertyAll(
|
||||
PlatformExtension.isDesktop
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: Colors.transparent,
|
||||
|
@ -77,7 +77,7 @@ class _InlineMathEquationState extends State<InlineMathEquation> {
|
||||
),
|
||||
fontSize: 14.0,
|
||||
color: widget.textStyle?.color ??
|
||||
theme.colorScheme.onBackground,
|
||||
theme.colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
const HSpace(2),
|
||||
|
@ -124,7 +124,7 @@ class MathEquationBlockComponentWidgetState
|
||||
decoration: BoxDecoration(
|
||||
color: formula.isNotEmpty
|
||||
? Colors.transparent
|
||||
: Theme.of(context).colorScheme.surfaceVariant,
|
||||
: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: FlowyHover(
|
||||
|
@ -10,8 +10,6 @@ Future<T?> showEditLinkBottomSheet<T>(
|
||||
) {
|
||||
return showMobileBottomSheet(
|
||||
context,
|
||||
showHeader: false,
|
||||
showCloseButton: false,
|
||||
showDragHandle: true,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
builder: (context) {
|
||||
|
@ -22,8 +22,6 @@ Future<void> showTextColorAndBackgroundColorPicker(
|
||||
await showMobileBottomSheet(
|
||||
context,
|
||||
showHeader: true,
|
||||
showCloseButton: false,
|
||||
showDivider: true,
|
||||
showDragHandle: true,
|
||||
showDoneButton: true,
|
||||
barrierColor: Colors.transparent,
|
||||
|
@ -26,6 +26,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
|
||||
class PageStyleCoverImage extends StatelessWidget {
|
||||
PageStyleCoverImage({
|
||||
@ -188,7 +189,7 @@ class PageStyleCoverImage extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
title: LocaleKeys.pageStyle_presets.tr(),
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
backgroundColor: AFThemeExtension.of(context).background,
|
||||
builder: (_) {
|
||||
return BlocProvider.value(
|
||||
value: pageStyleBloc,
|
||||
@ -266,7 +267,7 @@ class PageStyleCoverImage extends StatelessWidget {
|
||||
showHeader: true,
|
||||
showRemoveButton: true,
|
||||
title: LocaleKeys.pageStyle_unsplash.tr(),
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
backgroundColor: AFThemeExtension.of(context).background,
|
||||
onRemove: () {
|
||||
pageStyleBloc.add(
|
||||
DocumentPageStyleEvent.updateCoverImage(
|
||||
|
@ -7,6 +7,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/page_style
|
||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/page_style/_page_style_util.dart';
|
||||
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
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';
|
||||
@ -77,8 +78,7 @@ class _PageStyleIconState extends State<PageStyleIcon> {
|
||||
showDoneButton: true,
|
||||
showHeader: true,
|
||||
title: LocaleKeys.titleBar_pageIcon.tr(),
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: AFThemeExtension.of(context).background,
|
||||
enableDraggableScrollable: true,
|
||||
minChildSize: 0.6,
|
||||
initialChildSize: 0.61,
|
||||
|
@ -8,6 +8,7 @@ import 'package:appflowy/shared/feedback_gesture_detector.dart';
|
||||
import 'package:appflowy/util/font_family_extension.dart';
|
||||
import 'package:appflowy/workspace/application/settings/appearance/base_appearance.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
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';
|
||||
@ -208,8 +209,7 @@ class _FontButton extends StatelessWidget {
|
||||
showDoneButton: true,
|
||||
showHeader: true,
|
||||
title: LocaleKeys.titleBar_font.tr(),
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: AFThemeExtension.of(context).background,
|
||||
enableDraggableScrollable: true,
|
||||
minChildSize: 0.6,
|
||||
initialChildSize: 0.61,
|
||||
|
@ -137,7 +137,7 @@ class TableColorOptionAction extends PopoverActionCell {
|
||||
colors: colors,
|
||||
selected: selectedColor,
|
||||
border: Border.all(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
color: AFThemeExtension.of(context).onBackground,
|
||||
),
|
||||
onTap: (option, index) async {
|
||||
final backgroundColor =
|
||||
|
@ -15,6 +15,7 @@ import 'package:appflowy/workspace/application/settings/appearance/appearance_cu
|
||||
import 'package:appflowy/workspace/application/settings/appearance/base_appearance.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart' hide Log;
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
@ -42,6 +43,7 @@ class EditorStyleCustomizer {
|
||||
|
||||
EditorStyle desktop() {
|
||||
final theme = Theme.of(context);
|
||||
final afThemeExtension = AFThemeExtension.of(context);
|
||||
final appearanceFont = context.read<AppearanceSettingsCubit>().state.font;
|
||||
final appearance = context.read<DocumentAppearanceCubit>().state;
|
||||
final fontSize = appearance.fontSize;
|
||||
@ -60,8 +62,7 @@ class EditorStyleCustomizer {
|
||||
textStyleConfiguration: TextStyleConfiguration(
|
||||
text: baseTextStyle(fontFamily).copyWith(
|
||||
fontSize: fontSize,
|
||||
color: theme.colorScheme.onBackground,
|
||||
height: 1.5,
|
||||
color: afThemeExtension.onBackground,
|
||||
),
|
||||
bold: baseTextStyle(fontFamily, fontWeight: FontWeight.bold).copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
@ -93,6 +94,7 @@ class EditorStyleCustomizer {
|
||||
}
|
||||
|
||||
EditorStyle mobile() {
|
||||
final afThemeExtension = AFThemeExtension.of(context);
|
||||
final pageStyle = context.read<DocumentPageStyleBloc>().state;
|
||||
final theme = Theme.of(context);
|
||||
final fontSize = pageStyle.fontLayout.fontSize;
|
||||
@ -108,10 +110,10 @@ class EditorStyleCustomizer {
|
||||
padding: padding,
|
||||
defaultTextDirection: defaultTextDirection,
|
||||
textStyleConfiguration: TextStyleConfiguration(
|
||||
lineHeight: lineHeight,
|
||||
text: baseTextStyle.copyWith(
|
||||
fontSize: fontSize,
|
||||
color: theme.colorScheme.onBackground,
|
||||
height: lineHeight,
|
||||
color: afThemeExtension.onBackground,
|
||||
),
|
||||
bold: baseTextStyle.copyWith(fontWeight: FontWeight.w600),
|
||||
italic: baseTextStyle.copyWith(fontStyle: FontStyle.italic),
|
||||
@ -177,7 +179,7 @@ class EditorStyleCustomizer {
|
||||
return baseTextStyle(fontFamily).copyWith(
|
||||
fontSize: fontSize,
|
||||
height: 1.5,
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
color: AFThemeExtension.of(context).onBackground,
|
||||
);
|
||||
}
|
||||
|
||||
@ -187,16 +189,17 @@ class EditorStyleCustomizer {
|
||||
fontFamily: defaultFontFamily,
|
||||
fontSize: fontSize,
|
||||
height: 1.5,
|
||||
color: Theme.of(context).colorScheme.onBackground.withOpacity(0.6),
|
||||
color: AFThemeExtension.of(context).onBackground.withOpacity(0.6),
|
||||
);
|
||||
}
|
||||
|
||||
SelectionMenuStyle selectionMenuStyleBuilder() {
|
||||
final theme = Theme.of(context);
|
||||
final afThemeExtension = AFThemeExtension.of(context);
|
||||
return SelectionMenuStyle(
|
||||
selectionMenuBackgroundColor: theme.cardColor,
|
||||
selectionMenuItemTextColor: theme.colorScheme.onBackground,
|
||||
selectionMenuItemIconColor: theme.colorScheme.onBackground,
|
||||
selectionMenuItemTextColor: afThemeExtension.onBackground,
|
||||
selectionMenuItemIconColor: afThemeExtension.onBackground,
|
||||
selectionMenuItemSelectedIconColor: theme.colorScheme.onSurface,
|
||||
selectionMenuItemSelectedTextColor: theme.colorScheme.onSurface,
|
||||
selectionMenuItemSelectedColor: theme.hoverColor,
|
||||
@ -205,10 +208,11 @@ class EditorStyleCustomizer {
|
||||
|
||||
InlineActionsMenuStyle inlineActionsMenuStyleBuilder() {
|
||||
final theme = Theme.of(context);
|
||||
final afThemeExtension = AFThemeExtension.of(context);
|
||||
return InlineActionsMenuStyle(
|
||||
backgroundColor: theme.cardColor,
|
||||
groupTextColor: theme.colorScheme.onBackground.withOpacity(.8),
|
||||
menuItemTextColor: theme.colorScheme.onBackground,
|
||||
groupTextColor: afThemeExtension.onBackground.withOpacity(.8),
|
||||
menuItemTextColor: afThemeExtension.onBackground,
|
||||
menuItemSelectedColor: theme.colorScheme.secondary,
|
||||
menuItemSelectedTextColor: theme.colorScheme.onSurface,
|
||||
);
|
||||
|
Reference in New Issue
Block a user