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:
Lucas.Xu 2024-05-23 11:07:09 +08:00 committed by GitHub
parent acae34836e
commit 9a5dbbb3ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
104 changed files with 340 additions and 309 deletions

View File

@ -19,7 +19,7 @@
# env: # env:
# CARGO_TERM_COLOR: always # CARGO_TERM_COLOR: always
# FLUTTER_VERSION: "3.19.0" # FLUTTER_VERSION: "3.22.0"
# RUST_TOOLCHAIN: "1.77.2" # RUST_TOOLCHAIN: "1.77.2"
# CARGO_MAKE_VERSION: "0.36.6" # CARGO_MAKE_VERSION: "0.36.6"

View File

@ -25,7 +25,7 @@ on:
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.19.0" FLUTTER_VERSION: "3.22.0"
RUST_TOOLCHAIN: "1.77.2" RUST_TOOLCHAIN: "1.77.2"
CARGO_MAKE_VERSION: "0.36.6" CARGO_MAKE_VERSION: "0.36.6"

View File

@ -20,7 +20,7 @@ on:
- "!frontend/appflowy_web_app/**" - "!frontend/appflowy_web_app/**"
env: env:
FLUTTER_VERSION: "3.19.0" FLUTTER_VERSION: "3.22.0"
RUST_TOOLCHAIN: "1.77.2" RUST_TOOLCHAIN: "1.77.2"
concurrency: concurrency:

View File

@ -6,7 +6,7 @@ on:
- "*" - "*"
env: env:
FLUTTER_VERSION: "3.19.0" FLUTTER_VERSION: "3.22.0"
RUST_TOOLCHAIN: "1.77.2" RUST_TOOLCHAIN: "1.77.2"
jobs: jobs:

View File

@ -10,7 +10,7 @@ on:
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.19.0" FLUTTER_VERSION: "3.22.0"
RUST_TOOLCHAIN: "1.77.2" RUST_TOOLCHAIN: "1.77.2"
jobs: jobs:

View File

@ -105,7 +105,7 @@
- Fixed a bug where newly created rows were not being automatically sorted. - Fixed a bug where newly created rows were not being automatically sorted.
- Fixed issues related to deleting a sorting field or sort not removing existing sorts properly. - Fixed issues related to deleting a sorting field or sort not removing existing sorts properly.
### Notes ### Notes
- Windows 7, Windows 8, and iOS 11 are not yet supported due to the upgrade to Flutter 3.19.0. - Windows 7, Windows 8, and iOS 11 are not yet supported due to the upgrade to Flutter 3.22.0.
## Version 0.4.9 - 02/17/2024 ## Version 0.4.9 - 02/17/2024
### Bug Fixes ### Bug Fixes

View File

@ -66,6 +66,7 @@ void main() {
LogicalKeyboardKey.keyR, LogicalKeyboardKey.keyR,
], ],
tester: tester, tester: tester,
withKeyUp: true,
); );
expect(first.attributes[blockComponentAlign], rightAlignmentKey); expect(first.attributes[blockComponentAlign], rightAlignmentKey);
@ -77,6 +78,7 @@ void main() {
LogicalKeyboardKey.keyE, LogicalKeyboardKey.keyE,
], ],
tester: tester, tester: tester,
withKeyUp: true,
); );
expect(first.attributes[blockComponentAlign], centerAlignmentKey); expect(first.attributes[blockComponentAlign], centerAlignmentKey);
@ -88,6 +90,7 @@ void main() {
LogicalKeyboardKey.keyL, LogicalKeyboardKey.keyL,
], ],
tester: tester, tester: tester,
withKeyUp: true,
); );
expect(first.attributes[blockComponentAlign], leftAlignmentKey); expect(first.attributes[blockComponentAlign], leftAlignmentKey);
}); });

View File

@ -111,6 +111,7 @@ Future<void> triggerReferenceDocumentBySlashMenu(WidgetTester tester) async {
LogicalKeyboardKey.enter, LogicalKeyboardKey.enter,
], ],
tester: tester, tester: tester,
withKeyUp: true,
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
@ -129,6 +130,7 @@ Future<void> enterDocumentText(WidgetTester tester) async {
LogicalKeyboardKey.keyT, LogicalKeyboardKey.keyT,
], ],
tester: tester, tester: tester,
withKeyUp: true,
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
} }

View File

@ -5,10 +5,18 @@ class FlowyTestKeyboard {
static Future<void> simulateKeyDownEvent( static Future<void> simulateKeyDownEvent(
List<LogicalKeyboardKey> keys, { List<LogicalKeyboardKey> keys, {
required flutter_test.WidgetTester tester, required flutter_test.WidgetTester tester,
bool withKeyUp = false,
}) async { }) async {
for (final LogicalKeyboardKey key in keys) { for (final LogicalKeyboardKey key in keys) {
await flutter_test.simulateKeyDownEvent(key); await flutter_test.simulateKeyDownEvent(key);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
} }
if (withKeyUp) {
for (final LogicalKeyboardKey key in keys) {
await flutter_test.simulateKeyUpEvent(key);
await tester.pumpAndSettle();
}
}
} }
} }

View File

@ -173,7 +173,7 @@ SPEC CHECKSUMS:
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425 image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
integration_test: 13825b8a9334a850581300559b8839134b124670 integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
irondash_engine_context: 3458bf979b90d616ffb8ae03a150bafe2e860cc9 irondash_engine_context: 3458bf979b90d616ffb8ae03a150bafe2e860cc9
keyboard_height_plugin: 43fa8bba20fd5c4fdeed5076466b8b9d43cc6b86 keyboard_height_plugin: 43fa8bba20fd5c4fdeed5076466b8b9d43cc6b86
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c

View File

@ -481,7 +481,7 @@ class _AFDropdownMenuState<T> extends State<AFDropdownMenu<T>> {
ButtonStyle effectiveStyle = entry.style ?? defaultStyle; ButtonStyle effectiveStyle = entry.style ?? defaultStyle;
final Color focusedBackgroundColor = effectiveStyle.foregroundColor final Color focusedBackgroundColor = effectiveStyle.foregroundColor
?.resolve(<MaterialState>{MaterialState.focused}) ?? ?.resolve(<WidgetState>{WidgetState.focused}) ??
Theme.of(context).colorScheme.onSurface; Theme.of(context).colorScheme.onSurface;
Widget label = entry.labelWidget ?? Text(entry.label); Widget label = entry.labelWidget ?? Text(entry.label);
@ -499,7 +499,7 @@ class _AFDropdownMenuState<T> extends State<AFDropdownMenu<T>> {
// color will also change to foregroundColor.withOpacity(0.12). // color will also change to foregroundColor.withOpacity(0.12).
effectiveStyle = entry.enabled && i == focusedIndex effectiveStyle = entry.enabled && i == focusedIndex
? effectiveStyle.copyWith( ? effectiveStyle.copyWith(
backgroundColor: MaterialStatePropertyAll<Color>( backgroundColor: WidgetStatePropertyAll<Color>(
focusedBackgroundColor.withOpacity(0.12), focusedBackgroundColor.withOpacity(0.12),
), ),
) )
@ -628,17 +628,17 @@ class _AFDropdownMenuState<T> extends State<AFDropdownMenu<T>> {
final double? anchorWidth = getWidth(_anchorKey); final double? anchorWidth = getWidth(_anchorKey);
if (widget.width != null) { if (widget.width != null) {
effectiveMenuStyle = effectiveMenuStyle.copyWith( effectiveMenuStyle = effectiveMenuStyle.copyWith(
minimumSize: MaterialStatePropertyAll<Size?>(Size(widget.width!, 0.0)), minimumSize: WidgetStatePropertyAll<Size?>(Size(widget.width!, 0.0)),
); );
} else if (anchorWidth != null) { } else if (anchorWidth != null) {
effectiveMenuStyle = effectiveMenuStyle.copyWith( effectiveMenuStyle = effectiveMenuStyle.copyWith(
minimumSize: MaterialStatePropertyAll<Size?>(Size(anchorWidth, 0.0)), minimumSize: WidgetStatePropertyAll<Size?>(Size(anchorWidth, 0.0)),
); );
} }
if (widget.menuHeight != null) { if (widget.menuHeight != null) {
effectiveMenuStyle = effectiveMenuStyle.copyWith( effectiveMenuStyle = effectiveMenuStyle.copyWith(
maximumSize: MaterialStatePropertyAll<Size>( maximumSize: WidgetStatePropertyAll<Size>(
Size(double.infinity, widget.menuHeight!), Size(double.infinity, widget.menuHeight!),
), ),
); );
@ -1029,8 +1029,8 @@ class _DropdownMenuDefaultsM3 extends DropdownMenuThemeData {
@override @override
MenuStyle get menuStyle { MenuStyle get menuStyle {
return const MenuStyle( return const MenuStyle(
minimumSize: MaterialStatePropertyAll<Size>(Size(_kMinimumWidth, 0.0)), minimumSize: WidgetStatePropertyAll<Size>(Size(_kMinimumWidth, 0.0)),
maximumSize: MaterialStatePropertyAll<Size>(Size.infinite), maximumSize: WidgetStatePropertyAll<Size>(Size.infinite),
visualDensity: VisualDensity.standard, visualDensity: VisualDensity.standard,
); );
} }

View File

@ -12,6 +12,7 @@ import 'package:appflowy/workspace/application/favorite/favorite_bloc.dart';
import 'package:appflowy/workspace/application/view/prelude.dart'; import 'package:appflowy/workspace/application/view/prelude.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -92,7 +93,7 @@ class MobileViewPageMoreButton extends StatelessWidget {
context, context,
showDragHandle: true, showDragHandle: true,
showDivider: false, showDivider: false,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
builder: (_) => MultiBlocProvider( builder: (_) => MultiBlocProvider(
providers: [ providers: [
BlocProvider.value(value: context.read<ViewBloc>()), BlocProvider.value(value: context.read<ViewBloc>()),
@ -144,7 +145,7 @@ class MobileViewPageLayoutButton extends StatelessWidget {
showDoneButton: true, showDoneButton: true,
showHeader: true, showHeader: true,
title: LocaleKeys.pageStyle_title.tr(), title: LocaleKeys.pageStyle_title.tr(),
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
builder: (_) => MultiBlocProvider( builder: (_) => MultiBlocProvider(
providers: [ providers: [
BlocProvider.value(value: context.read<DocumentPageStyleBloc>()), BlocProvider.value(value: context.read<DocumentPageStyleBloc>()),

View File

@ -1,4 +1,5 @@
import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/flowy_svgs.g.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:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,7 +20,7 @@ class BottomSheetActionWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final iconColor = final iconColor =
this.iconColor ?? Theme.of(context).colorScheme.onBackground; this.iconColor ?? AFThemeExtension.of(context).onBackground;
if (svg == null) { if (svg == null) {
return OutlinedButton( return OutlinedButton(

View File

@ -3,6 +3,7 @@ import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
import 'package:appflowy/mobile/presentation/page_item/mobile_slide_action_button.dart'; import 'package:appflowy/mobile/presentation/page_item/mobile_slide_action_button.dart';
import 'package:appflowy/workspace/application/favorite/favorite_bloc.dart'; import 'package:appflowy/workspace/application/favorite/favorite_bloc.dart';
import 'package:appflowy/workspace/application/view/view_bloc.dart'; import 'package:appflowy/workspace/application/view/view_bloc.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_slidable/flutter_slidable.dart';
@ -54,7 +55,7 @@ enum MobilePaneActionType {
context, context,
showDragHandle: true, showDragHandle: true,
showDivider: false, showDivider: false,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
useRootNavigator: true, useRootNavigator: true,
builder: (context) { builder: (context) {
return MultiBlocProvider( return MultiBlocProvider(

View File

@ -15,6 +15,7 @@ import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:appflowy_board/appflowy_board.dart'; import 'package:appflowy_board/appflowy_board.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -265,7 +266,7 @@ class _BoardContentState extends State<_BoardContent> {
BoxDecoration _makeBoxDecoration(BuildContext context) { BoxDecoration _makeBoxDecoration(BuildContext context) {
final themeMode = context.read<AppearanceSettingsCubit>().state.themeMode; final themeMode = context.read<AppearanceSettingsCubit>().state.themeMode;
return BoxDecoration( return BoxDecoration(
color: Theme.of(context).colorScheme.background, color: AFThemeExtension.of(context).background,
borderRadius: const BorderRadius.all(Radius.circular(8)), borderRadius: const BorderRadius.all(Radius.circular(8)),
border: themeMode == ThemeMode.light border: themeMode == ThemeMode.light
? Border.fromBorderSide( ? Border.fromBorderSide(

View File

@ -60,7 +60,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
Icons.close, Icons.close,
color: style.colorScheme.onBackground, color: style.colorScheme.onSurface,
), ),
onPressed: () => onPressed: () =>
setState(() => _textController.clear()), setState(() => _textController.clear()),
@ -86,7 +86,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
child: Text( child: Text(
LocaleKeys.button_cancel.tr(), LocaleKeys.button_cancel.tr(),
style: style.textTheme.titleSmall?.copyWith( style: style.textTheme.titleSmall?.copyWith(
color: style.colorScheme.onBackground, color: style.colorScheme.onSurface,
), ),
), ),
onPressed: () => setState(() => isEditing = false), onPressed: () => setState(() => isEditing = false),
@ -96,7 +96,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
LocaleKeys.button_add.tr(), LocaleKeys.button_add.tr(),
style: style.textTheme.titleSmall?.copyWith( style: style.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: style.colorScheme.onBackground, color: style.colorScheme.onSurface,
), ),
), ),
onPressed: () { onPressed: () {
@ -117,14 +117,14 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
) )
: ElevatedButton.icon( : ElevatedButton.icon(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
foregroundColor: style.colorScheme.onBackground, foregroundColor: style.colorScheme.onSurface,
backgroundColor: style.colorScheme.secondary, backgroundColor: style.colorScheme.secondary,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
).copyWith( ).copyWith(
overlayColor: overlayColor:
MaterialStateProperty.all(Theme.of(context).hoverColor), WidgetStateProperty.all(Theme.of(context).hoverColor),
), ),
icon: const Icon(Icons.add), icon: const Icon(Icons.add),
label: Text( label: Text(

View File

@ -9,6 +9,7 @@ import 'package:appflowy/plugins/database/widgets/cell/card_cell_skeleton/text_c
import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -168,7 +169,7 @@ class MobileHiddenGroup extends StatelessWidget {
return TextButton( return TextButton(
style: TextButton.styleFrom( style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.bodyMedium, textStyle: Theme.of(context).textTheme.bodyMedium,
foregroundColor: Theme.of(context).colorScheme.onBackground, foregroundColor: AFThemeExtension.of(context).onBackground,
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
), ),
child: CardCellBuilder( child: CardCellBuilder(

View File

@ -20,6 +20,7 @@ import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.dart'
import 'package:appflowy/plugins/database/widgets/row/row_property.dart'; import 'package:appflowy/plugins/database/widgets/row/row_property.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -131,7 +132,7 @@ class _MobileRowDetailPageState extends State<MobileRowDetailPage> {
void _showCardActions(BuildContext context) { void _showCardActions(BuildContext context) {
showMobileBottomSheet( showMobileBottomSheet(
context, context,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
showDragHandle: true, showDragHandle: true,
builder: (_) => Column( builder: (_) => Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

View File

@ -22,17 +22,17 @@ class MobileRowDetailCreateFieldButton extends StatelessWidget {
constraints: const BoxConstraints(minWidth: double.infinity), constraints: const BoxConstraints(minWidth: double.infinity),
child: TextButton.icon( child: TextButton.icon(
style: Theme.of(context).textButtonTheme.style?.copyWith( style: Theme.of(context).textButtonTheme.style?.copyWith(
shape: MaterialStateProperty.all<RoundedRectangleBorder>( shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
), ),
overlayColor: MaterialStateProperty.all<Color>( overlayColor: WidgetStateProperty.all<Color>(
Theme.of(context).hoverColor, Theme.of(context).hoverColor,
), ),
alignment: AlignmentDirectional.centerStart, alignment: AlignmentDirectional.centerStart,
splashFactory: NoSplash.splashFactory, splashFactory: NoSplash.splashFactory,
padding: const MaterialStatePropertyAll( padding: const WidgetStatePropertyAll(
EdgeInsets.symmetric(vertical: 14, horizontal: 6), EdgeInsets.symmetric(vertical: 14, horizontal: 6),
), ),
), ),

View File

@ -7,6 +7,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.da
import 'package:appflowy/util/field_type_extension.dart'; import 'package:appflowy/util/field_type_extension.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
@ -40,7 +41,7 @@ Future<FieldType?> showFieldTypeGridBottomSheet(
showCloseButton: true, showCloseButton: true,
elevation: 20, elevation: 20,
title: title, title: title,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
enableDraggableScrollable: true, enableDraggableScrollable: true,
builder: (context) { builder: (context) {
final typeOptionMenuItemValue = mobileSupportedFieldTypes final typeOptionMenuItemValue = mobileSupportedFieldTypes

View File

@ -438,7 +438,7 @@ class _SortDetailContent extends StatelessWidget {
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
), ),
splashFactory: NoSplash.splashFactory, splashFactory: NoSplash.splashFactory,
overlayColor: const MaterialStatePropertyAll( overlayColor: const WidgetStatePropertyAll(
Colors.transparent, Colors.transparent,
), ),
onTap: (index) { onTap: (index) {

View File

@ -11,6 +11,7 @@ import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -183,7 +184,7 @@ class MobileDatabaseViewListButton extends StatelessWidget {
showMobileBottomSheet( showMobileBottomSheet(
context, context,
showDragHandle: true, showDragHandle: true,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
builder: (_) { builder: (_) {
return BlocProvider<ViewBloc>( return BlocProvider<ViewBloc>(
create: (_) => create: (_) =>

View File

@ -234,7 +234,6 @@ class DatabaseViewSettingTile extends StatelessWidget {
showHeader: true, showHeader: true,
showBackButton: true, showBackButton: true,
title: LocaleKeys.grid_settings_properties.tr(), title: LocaleKeys.grid_settings_properties.tr(),
showDivider: true,
builder: (_) { builder: (_) {
return BlocProvider.value( return BlocProvider.value(
value: context.read<ViewBloc>(), value: context.read<ViewBloc>(),

View File

@ -178,7 +178,7 @@ class _DeletedFilesListView extends StatelessWidget {
title: Text( title: Text(
deletedFile.name, deletedFile.name,
style: theme.textTheme.labelMedium style: theme.textTheme.labelMedium
?.copyWith(color: theme.colorScheme.onBackground), ?.copyWith(color: theme.colorScheme.onSurface),
), ),
horizontalTitleGap: 0, horizontalTitleGap: 0,
tileColor: theme.colorScheme.onSurface.withOpacity(0.1), tileColor: theme.colorScheme.onSurface.withOpacity(0.1),

View File

@ -1,5 +1,3 @@
import 'package:flutter/material.dart';
import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart'; import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
@ -9,7 +7,9 @@ import 'package:appflowy/workspace/application/recent/prelude.dart';
import 'package:appflowy/workspace/application/user/user_workspace_bloc.dart'; import 'package:appflowy/workspace/application/user/user_workspace_bloc.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
@ -91,7 +91,7 @@ class _RecentViews extends StatelessWidget {
context, context,
showDivider: false, showDivider: false,
showDragHandle: true, showDragHandle: true,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
builder: (_) { builder: (_) {
return Column( return Column(
children: [ children: [

View File

@ -37,7 +37,6 @@ class RTLSetting extends StatelessWidget {
showHeader: true, showHeader: true,
showDragHandle: true, showDragHandle: true,
showDivider: false, showDivider: false,
showCloseButton: false,
title: LocaleKeys.settings_appearance_textDirection_label.tr(), title: LocaleKeys.settings_appearance_textDirection_label.tr(),
builder: (context) { builder: (context) {
final layoutDirection = final layoutDirection =

View File

@ -45,7 +45,6 @@ class TextScaleSetting extends StatelessWidget {
showHeader: true, showHeader: true,
showDragHandle: true, showDragHandle: true,
showDivider: false, showDivider: false,
showCloseButton: false,
title: LocaleKeys.settings_appearance_fontScaleFactor.tr(), title: LocaleKeys.settings_appearance_fontScaleFactor.tr(),
builder: (context) { builder: (context) {
return FontSizeStepper( return FontSizeStepper(

View File

@ -38,7 +38,6 @@ class ThemeSetting extends StatelessWidget {
showHeader: true, showHeader: true,
showDragHandle: true, showDragHandle: true,
showDivider: false, showDivider: false,
showCloseButton: false,
title: LocaleKeys.settings_appearance_themeMode_label.tr(), title: LocaleKeys.settings_appearance_themeMode_label.tr(),
builder: (context) { builder: (context) {
final themeMode = final themeMode =

View File

@ -29,7 +29,7 @@ class MobileQuickActionButton extends StatelessWidget {
onTap: enable ? onTap : null, onTap: enable ? onTap : null,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
overlayColor: overlayColor:
enable ? null : const MaterialStatePropertyAll(Colors.transparent), enable ? null : const WidgetStatePropertyAll(Colors.transparent),
splashColor: Colors.transparent, splashColor: Colors.transparent,
child: Container( child: Container(
height: 44, height: 44,

View File

@ -92,7 +92,7 @@ class FlowyIconPicker extends StatelessWidget {
child: TabBar( child: TabBar(
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
isScrollable: true, isScrollable: true,
overlayColor: MaterialStatePropertyAll( overlayColor: WidgetStatePropertyAll(
Theme.of(context).colorScheme.secondary, Theme.of(context).colorScheme.secondary,
), ),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,

View File

@ -20,6 +20,7 @@ import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_board/appflowy_board.dart'; import 'package:appflowy_board/appflowy_board.dart';
import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart';
import 'package:flowy_infra_ui/widget/error_page.dart'; import 'package:flowy_infra_ui/widget/error_page.dart';
@ -671,7 +672,7 @@ class _BoardCardState extends State<_BoardCard> {
? const Color(0x0F1F2329) ? const Color(0x0F1F2329)
: const Color(0x0FEFF4FB), : const Color(0x0FEFF4FB),
foregroundColorOnHover: foregroundColorOnHover:
Theme.of(context).colorScheme.onBackground, AFThemeExtension.of(context).onBackground,
), ),
), ),
onStartEditing: () => onStartEditing: () =>

View File

@ -238,7 +238,7 @@ class NewEventButton extends StatelessWidget {
child: FlowyIconButton( child: FlowyIconButton(
onPressed: onCreate, onPressed: onCreate,
icon: const FlowySvg(FlowySvgs.add_s), icon: const FlowySvg(FlowySvgs.add_s),
fillColor: Theme.of(context).colorScheme.background, fillColor: Theme.of(context).colorScheme.surface,
hoverColor: AFThemeExtension.of(context).lightGreyHover, hoverColor: AFThemeExtension.of(context).lightGreyHover,
width: 22, width: 22,
tooltipText: LocaleKeys.calendar_newEventButtonTooltip.tr(), tooltipText: LocaleKeys.calendar_newEventButtonTooltip.tr(),
@ -289,8 +289,8 @@ class _DayBadge extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Color dayTextColor = Theme.of(context).colorScheme.onBackground; Color dayTextColor = AFThemeExtension.of(context).onBackground;
Color monthTextColor = Theme.of(context).colorScheme.onBackground; Color monthTextColor = AFThemeExtension.of(context).onBackground;
final String monthString = final String monthString =
DateFormat("MMM ", context.locale.toLanguageTag()).format(date); DateFormat("MMM ", context.locale.toLanguageTag()).format(date);
final String dayString = date.day.toString(); final String dayString = date.day.toString();

View File

@ -8,6 +8,7 @@ import 'package:appflowy/workspace/application/view/view_bloc.dart';
import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/size.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/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart';
import 'package:flutter/material.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 'package:go_router/go_router.dart';
import '../application/calendar_bloc.dart'; import '../application/calendar_bloc.dart';
import 'calendar_event_editor.dart'; import 'calendar_event_editor.dart';
class EventCard extends StatefulWidget { class EventCard extends StatefulWidget {
@ -102,7 +102,7 @@ class _EventCardState extends State<EventCard> {
hoverColor: Theme.of(context).brightness == Brightness.light hoverColor: Theme.of(context).brightness == Brightness.light
? const Color(0x0F1F2329) ? const Color(0x0F1F2329)
: const Color(0x0FEFF4FB), : const Color(0x0FEFF4FB),
foregroundColorOnHover: Theme.of(context).colorScheme.onBackground, foregroundColorOnHover: AFThemeExtension.of(context).onBackground,
), ),
), ),
onStartEditing: () {}, onStartEditing: () {},

View File

@ -1,5 +1,3 @@
import 'package:flutter/material.dart';
import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.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/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import '../../application/row/row_controller.dart'; import '../../application/row/row_controller.dart';
import '../../widgets/row/row_detail.dart'; import '../../widgets/row/row_detail.dart';
import 'calendar_day.dart'; import 'calendar_day.dart';
import 'layout/sizes.dart'; import 'layout/sizes.dart';
import 'toolbar/calendar_setting_bar.dart'; import 'toolbar/calendar_setting_bar.dart';

View File

@ -43,7 +43,7 @@ Widget getGridFabs(BuildContext context) {
.read<GridBloc>() .read<GridBloc>()
.add(const GridEvent.createRow(openRowDetail: true)); .add(const GridEvent.createRow(openRowDetail: true));
}, },
overlayColor: const MaterialStatePropertyAll<Color>(Color(0xFF009FD1)), overlayColor: const WidgetStatePropertyAll<Color>(Color(0xFF009FD1)),
boxShadow: const BoxShadow( boxShadow: const BoxShadow(
offset: Offset(0, 8), offset: Offset(0, 8),
color: Color(0x6612BFEF), color: Color(0x6612BFEF),
@ -75,7 +75,7 @@ class MobileGridFab extends StatelessWidget {
final VoidCallback onTap; final VoidCallback onTap;
final FlowySvgData icon; final FlowySvgData icon;
final Size iconSize; final Size iconSize;
final MaterialStateProperty<Color?>? overlayColor; final WidgetStateProperty<Color?>? overlayColor;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

@ -77,22 +77,22 @@ class _DatabaseViewSelectorButton extends StatelessWidget {
return TextButton( return TextButton(
style: ButtonStyle( style: ButtonStyle(
padding: const MaterialStatePropertyAll( padding: const WidgetStatePropertyAll(
EdgeInsets.fromLTRB(12, 8, 8, 8), EdgeInsets.fromLTRB(12, 8, 8, 8),
), ),
maximumSize: const MaterialStatePropertyAll(Size(200, 48)), maximumSize: const WidgetStatePropertyAll(Size(200, 48)),
minimumSize: const MaterialStatePropertyAll(Size(48, 0)), minimumSize: const WidgetStatePropertyAll(Size(48, 0)),
shape: const MaterialStatePropertyAll( shape: const WidgetStatePropertyAll(
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(12)), borderRadius: BorderRadius.all(Radius.circular(12)),
), ),
), ),
backgroundColor: MaterialStatePropertyAll( backgroundColor: WidgetStatePropertyAll(
Theme.of(context).brightness == Brightness.light Theme.of(context).brightness == Brightness.light
? const Color(0x0F212729) ? const Color(0x0F212729)
: const Color(0x0FFFFFFF), : const Color(0x0FFFFFFF),
), ),
overlayColor: MaterialStatePropertyAll( overlayColor: WidgetStatePropertyAll(
Theme.of(context).colorScheme.secondary, Theme.of(context).colorScheme.secondary,
), ),
), ),
@ -119,7 +119,6 @@ class _DatabaseViewSelectorButton extends StatelessWidget {
showTransitionMobileBottomSheet( showTransitionMobileBottomSheet(
context, context,
showDivider: false, showDivider: false,
initialStop: 1.0,
builder: (_) { builder: (_) {
return MultiBlocProvider( return MultiBlocProvider(
providers: [ providers: [

View File

@ -42,7 +42,6 @@ class MobileGridRelationCellSkin extends IEditableRelationCellSkin {
onTap: () { onTap: () {
showMobileBottomSheet( showMobileBottomSheet(
context, context,
padding: EdgeInsets.zero,
backgroundColor: Theme.of(context).colorScheme.secondaryContainer, backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
builder: (context) { builder: (context) {
return const FlowyText("Coming soon"); return const FlowyText("Coming soon");

View File

@ -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/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/accessory/cell_accessory.dart';
import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.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/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -51,7 +52,7 @@ class MobileGridURLCellSkin extends IEditableURLCellSkin {
showMobileBottomSheet( showMobileBottomSheet(
context, context,
showDragHandle: true, showDragHandle: true,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
builder: (context) => BlocProvider.value( builder: (context) => BlocProvider.value(
value: bloc, value: bloc,
child: MobileURLEditor( child: MobileURLEditor(

View File

@ -1,6 +1,7 @@
import 'package:appflowy/generated/flowy_svgs.g.dart'; 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/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 'package:flutter/material.dart';
import '../editable_cell_skeleton/checkbox.dart'; import '../editable_cell_skeleton/checkbox.dart';
@ -31,7 +32,7 @@ class MobileRowDetailCheckboxCellSkin extends IEditableCheckboxCellSkin {
alignment: AlignmentDirectional.centerStart, alignment: AlignmentDirectional.centerStart,
child: FlowySvg( child: FlowySvg(
state.isSelected ? FlowySvgs.check_filled_s : FlowySvgs.uncheck_s, state.isSelected ? FlowySvgs.check_filled_s : FlowySvgs.uncheck_s,
color: Theme.of(context).colorScheme.onBackground, color: AFThemeExtension.of(context).onBackground,
blendMode: BlendMode.dst, blendMode: BlendMode.dst,
size: const Size.square(24), size: const Size.square(24),
), ),

View File

@ -1,11 +1,12 @@
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.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/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/checklist_progress_bar.dart';
import 'package:appflowy/plugins/database/widgets/cell_editor/mobile_checklist_cell_editor.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:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -25,7 +26,7 @@ class MobileRowDetailChecklistCellSkin extends IEditableChecklistCellSkin {
borderRadius: const BorderRadius.all(Radius.circular(14)), borderRadius: const BorderRadius.all(Radius.circular(14)),
onTap: () => showMobileBottomSheet( onTap: () => showMobileBottomSheet(
context, context,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
builder: (context) { builder: (context) {
return BlocProvider.value( return BlocProvider.value(
value: bloc, value: bloc,

View File

@ -19,7 +19,6 @@ class MobileRowDetailRelationCellSkin extends IEditableRelationCellSkin {
borderRadius: const BorderRadius.all(Radius.circular(14)), borderRadius: const BorderRadius.all(Radius.circular(14)),
onTap: () => showMobileBottomSheet( onTap: () => showMobileBottomSheet(
context, context,
padding: EdgeInsets.zero,
builder: (context) { builder: (context) {
return const FlowyText("Coming soon"); return const FlowyText("Coming soon");
}, },

View File

@ -1,12 +1,12 @@
import 'package:flutter/material.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.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/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/accessory/cell_accessory.dart';
import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.dart'; import 'package:appflowy/plugins/database/widgets/row/cells/cell_container.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flowy_infra/theme_extension.dart';
import '../editable_cell_skeleton/url.dart'; import '../editable_cell_skeleton/url.dart';
@ -28,7 +28,7 @@ class MobileRowDetailURLCellSkin extends IEditableURLCellSkin {
onTap: () => showMobileBottomSheet( onTap: () => showMobileBottomSheet(
context, context,
showDragHandle: true, showDragHandle: true,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
builder: (_) { builder: (_) {
return BlocProvider.value( return BlocProvider.value(
value: bloc, value: bloc,

View File

@ -423,7 +423,7 @@ class _DeleteTaskButton extends StatefulWidget {
} }
class _DeleteTaskButtonState extends State<_DeleteTaskButton> { class _DeleteTaskButtonState extends State<_DeleteTaskButton> {
final _materialStatesController = MaterialStatesController(); final _materialStatesController = WidgetStatesController();
@override @override
void dispose() { void dispose() {
@ -438,16 +438,16 @@ class _DeleteTaskButtonState extends State<_DeleteTaskButton> {
onHover: (_) => setState(() {}), onHover: (_) => setState(() {}),
onFocusChange: (_) => setState(() {}), onFocusChange: (_) => setState(() {}),
style: ButtonStyle( style: ButtonStyle(
fixedSize: const MaterialStatePropertyAll(Size.square(32)), fixedSize: const WidgetStatePropertyAll(Size.square(32)),
minimumSize: const MaterialStatePropertyAll(Size.square(32)), minimumSize: const WidgetStatePropertyAll(Size.square(32)),
maximumSize: const MaterialStatePropertyAll(Size.square(32)), maximumSize: const WidgetStatePropertyAll(Size.square(32)),
overlayColor: MaterialStateProperty.resolveWith((state) { overlayColor: WidgetStateProperty.resolveWith((state) {
if (state.contains(MaterialState.focused)) { if (state.contains(WidgetState.focused)) {
return AFThemeExtension.of(context).greyHover; return AFThemeExtension.of(context).greyHover;
} }
return Colors.transparent; return Colors.transparent;
}), }),
shape: const MaterialStatePropertyAll( shape: const WidgetStatePropertyAll(
RoundedRectangleBorder(borderRadius: Corners.s6Border), RoundedRectangleBorder(borderRadius: Corners.s6Border),
), ),
), ),
@ -455,8 +455,8 @@ class _DeleteTaskButtonState extends State<_DeleteTaskButton> {
child: FlowySvg( child: FlowySvg(
FlowySvgs.delete_s, FlowySvgs.delete_s,
color: _materialStatesController.value color: _materialStatesController.value
.contains(MaterialState.hovered) || .contains(WidgetState.hovered) ||
_materialStatesController.value.contains(MaterialState.focused) _materialStatesController.value.contains(WidgetState.focused)
? Theme.of(context).colorScheme.error ? Theme.of(context).colorScheme.error
: null, : null,
), ),

View File

@ -422,7 +422,7 @@ class _UnselectRowButton extends StatefulWidget {
} }
class _UnselectRowButtonState extends State<_UnselectRowButton> { class _UnselectRowButtonState extends State<_UnselectRowButton> {
final _materialStatesController = MaterialStatesController(); final _materialStatesController = WidgetStatesController();
@override @override
void dispose() { void dispose() {
@ -437,26 +437,25 @@ class _UnselectRowButtonState extends State<_UnselectRowButton> {
onHover: (_) => setState(() {}), onHover: (_) => setState(() {}),
onFocusChange: (_) => setState(() {}), onFocusChange: (_) => setState(() {}),
style: ButtonStyle( style: ButtonStyle(
fixedSize: const MaterialStatePropertyAll(Size.square(32)), fixedSize: const WidgetStatePropertyAll(Size.square(32)),
minimumSize: const MaterialStatePropertyAll(Size.square(32)), minimumSize: const WidgetStatePropertyAll(Size.square(32)),
maximumSize: const MaterialStatePropertyAll(Size.square(32)), maximumSize: const WidgetStatePropertyAll(Size.square(32)),
overlayColor: MaterialStateProperty.resolveWith((state) { overlayColor: WidgetStateProperty.resolveWith((state) {
if (state.contains(MaterialState.focused)) { if (state.contains(WidgetState.focused)) {
return AFThemeExtension.of(context).greyHover; return AFThemeExtension.of(context).greyHover;
} }
return Colors.transparent; return Colors.transparent;
}), }),
shape: const MaterialStatePropertyAll( shape: const WidgetStatePropertyAll(
RoundedRectangleBorder(borderRadius: Corners.s6Border), RoundedRectangleBorder(borderRadius: Corners.s6Border),
), ),
), ),
statesController: _materialStatesController, statesController: _materialStatesController,
child: Container( child: Container(
color: _materialStatesController.value color: _materialStatesController.value.contains(WidgetState.hovered) ||
.contains(MaterialState.hovered) || _materialStatesController.value.contains(WidgetState.focused)
_materialStatesController.value.contains(MaterialState.focused)
? Theme.of(context).colorScheme.primary ? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.onBackground, : AFThemeExtension.of(context).onBackground,
width: 12, width: 12,
height: 1, height: 1,
), ),

View File

@ -380,7 +380,7 @@ class _SelectOptionCellState extends State<_SelectOptionCell> {
icon: FlowySvg( icon: FlowySvg(
FlowySvgs.three_dots_s, FlowySvgs.three_dots_s,
size: const Size.square(16), 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( child: FlowySvg(
FlowySvgs.drag_element_s, FlowySvgs.drag_element_s,
size: const Size.square(14), size: const Size.square(14),
color: Theme.of(context).colorScheme.onBackground, color: AFThemeExtension.of(context).onBackground,
), ),
), ),
), ),

View File

@ -314,17 +314,17 @@ class ToggleHiddenFieldsVisibilityButton extends StatelessWidget {
constraints: const BoxConstraints(minWidth: double.infinity), constraints: const BoxConstraints(minWidth: double.infinity),
child: TextButton.icon( child: TextButton.icon(
style: Theme.of(context).textButtonTheme.style?.copyWith( style: Theme.of(context).textButtonTheme.style?.copyWith(
shape: MaterialStateProperty.all<RoundedRectangleBorder>( shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
), ),
overlayColor: MaterialStateProperty.all<Color>( overlayColor: WidgetStateProperty.all<Color>(
Theme.of(context).hoverColor, Theme.of(context).hoverColor,
), ),
alignment: AlignmentDirectional.centerStart, alignment: AlignmentDirectional.centerStart,
splashFactory: NoSplash.splashFactory, splashFactory: NoSplash.splashFactory,
padding: const MaterialStatePropertyAll( padding: const WidgetStatePropertyAll(
EdgeInsets.symmetric(vertical: 14, horizontal: 6), EdgeInsets.symmetric(vertical: 14, horizontal: 6),
), ),
), ),

View File

@ -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/plugins/database/grid/presentation/grid_page.dart';
import 'package:appflowy/workspace/application/view/view_bloc.dart'; import 'package:appflowy/workspace/application/view/view_bloc.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -128,7 +129,6 @@ void _showDatabaseFieldListFromToolbar(
showHeader: true, showHeader: true,
showBackButton: true, showBackButton: true,
title: LocaleKeys.grid_settings_properties.tr(), title: LocaleKeys.grid_settings_properties.tr(),
showDivider: true,
builder: (_) { builder: (_) {
return BlocProvider.value( return BlocProvider.value(
value: context.read<ViewBloc>(), value: context.read<ViewBloc>(),
@ -150,7 +150,7 @@ void _showEditSortPanelFromToolbar(
showDragHandle: true, showDragHandle: true,
showDivider: false, showDivider: false,
useSafeArea: false, useSafeArea: false,
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
builder: (_) { builder: (_) {
return BlocProvider.value( return BlocProvider.value(
value: context.read<SortEditorBloc>(), value: context.read<SortEditorBloc>(),

View File

@ -23,7 +23,7 @@ class DocumentBanner extends StatelessWidget {
constraints: const BoxConstraints(minHeight: 60), constraints: const BoxConstraints(minHeight: 60),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
color: colorScheme.surfaceVariant, color: colorScheme.surfaceContainerHighest,
child: FittedBox( child: FittedBox(
fit: BoxFit.scaleDown, fit: BoxFit.scaleDown,
child: Row( child: Row(

View File

@ -437,7 +437,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
Material( Material(
child: DecoratedBox( child: DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
child: FindAndReplaceMenuWidget( child: FindAndReplaceMenuWidget(

View File

@ -74,7 +74,6 @@ class MobileBlockActionButtons extends StatelessWidget {
context, context,
showHeader: true, showHeader: true,
showCloseButton: true, showCloseButton: true,
showDivider: true,
showDragHandle: true, showDragHandle: true,
title: LocaleKeys.document_plugins_action.tr(), title: LocaleKeys.document_plugins_action.tr(),
builder: (context) { builder: (context) {

View File

@ -300,7 +300,7 @@ class ColorOptionAction extends PopoverActionCell {
colors: colors, colors: colors,
selected: selectedColor, selected: selectedColor,
border: Border.all( border: Border.all(
color: Theme.of(context).colorScheme.onBackground, color: AFThemeExtension.of(context).onBackground,
), ),
onTap: (option, index) async { onTap: (option, index) async {
final transaction = editorState.transaction; final transaction = editorState.transaction;

View File

@ -1,5 +1,3 @@
import 'package:flutter/material.dart';
import 'package:appflowy/generated/locale_keys.g.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/selectable_item_list_menu.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/base/string_extension.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_editor_plugins/appflowy_editor_plugins.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
CodeBlockLanguagePickerBuilder codeBlockLanguagePickerBuilder = ( CodeBlockLanguagePickerBuilder codeBlockLanguagePickerBuilder = (
@ -70,7 +70,7 @@ class _CodeBlockLanguageSelectorState
widget.language?.capitalize() ?? widget.language?.capitalize() ??
LocaleKeys.document_codeBlock_language_auto.tr(), LocaleKeys.document_codeBlock_language_auto.tr(),
constraints: const BoxConstraints(minWidth: 50), 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), padding: const EdgeInsets.symmetric(horizontal: 6.0, vertical: 4),
fillColor: Colors.transparent, fillColor: Colors.transparent,
hoverColor: Theme.of(context).colorScheme.secondaryContainer, hoverColor: Theme.of(context).colorScheme.secondaryContainer,

View File

@ -61,7 +61,7 @@ class _ErrorBlockComponentWidgetState extends State<ErrorBlockComponentWidget>
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget child = DecoratedBox( Widget child = DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
child: FlowyButton( child: FlowyButton(

View File

@ -49,7 +49,7 @@ class ImagePlaceholderState extends State<ImagePlaceholder> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Widget child = DecoratedBox( final Widget child = DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
child: FlowyHover( child: FlowyHover(

View File

@ -14,7 +14,7 @@ class UnSupportImageWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DecoratedBox( return DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
child: FlowyHover( child: FlowyHover(

View File

@ -107,7 +107,7 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
}), }),
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
isScrollable: true, isScrollable: true,
overlayColor: MaterialStatePropertyAll( overlayColor: WidgetStatePropertyAll(
PlatformExtension.isDesktop PlatformExtension.isDesktop
? Theme.of(context).colorScheme.secondary ? Theme.of(context).colorScheme.secondary
: Colors.transparent, : Colors.transparent,

View File

@ -77,7 +77,7 @@ class _InlineMathEquationState extends State<InlineMathEquation> {
), ),
fontSize: 14.0, fontSize: 14.0,
color: widget.textStyle?.color ?? color: widget.textStyle?.color ??
theme.colorScheme.onBackground, theme.colorScheme.onSurface,
), ),
), ),
const HSpace(2), const HSpace(2),

View File

@ -124,7 +124,7 @@ class MathEquationBlockComponentWidgetState
decoration: BoxDecoration( decoration: BoxDecoration(
color: formula.isNotEmpty color: formula.isNotEmpty
? Colors.transparent ? Colors.transparent
: Theme.of(context).colorScheme.surfaceVariant, : Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
child: FlowyHover( child: FlowyHover(

View File

@ -10,8 +10,6 @@ Future<T?> showEditLinkBottomSheet<T>(
) { ) {
return showMobileBottomSheet( return showMobileBottomSheet(
context, context,
showHeader: false,
showCloseButton: false,
showDragHandle: true, showDragHandle: true,
padding: const EdgeInsets.symmetric(horizontal: 16), padding: const EdgeInsets.symmetric(horizontal: 16),
builder: (context) { builder: (context) {

View File

@ -22,8 +22,6 @@ Future<void> showTextColorAndBackgroundColorPicker(
await showMobileBottomSheet( await showMobileBottomSheet(
context, context,
showHeader: true, showHeader: true,
showCloseButton: false,
showDivider: true,
showDragHandle: true, showDragHandle: true,
showDoneButton: true, showDoneButton: true,
barrierColor: Colors.transparent, barrierColor: Colors.transparent,

View File

@ -26,6 +26,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:flowy_infra/theme_extension.dart';
class PageStyleCoverImage extends StatelessWidget { class PageStyleCoverImage extends StatelessWidget {
PageStyleCoverImage({ PageStyleCoverImage({
@ -188,7 +189,7 @@ class PageStyleCoverImage extends StatelessWidget {
); );
}, },
title: LocaleKeys.pageStyle_presets.tr(), title: LocaleKeys.pageStyle_presets.tr(),
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
builder: (_) { builder: (_) {
return BlocProvider.value( return BlocProvider.value(
value: pageStyleBloc, value: pageStyleBloc,
@ -266,7 +267,7 @@ class PageStyleCoverImage extends StatelessWidget {
showHeader: true, showHeader: true,
showRemoveButton: true, showRemoveButton: true,
title: LocaleKeys.pageStyle_unsplash.tr(), title: LocaleKeys.pageStyle_unsplash.tr(),
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
onRemove: () { onRemove: () {
pageStyleBloc.add( pageStyleBloc.add(
DocumentPageStyleEvent.updateCoverImage( DocumentPageStyleEvent.updateCoverImage(

View File

@ -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/plugins/document/presentation/editor_plugins/page_style/_page_style_util.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -77,8 +78,7 @@ class _PageStyleIconState extends State<PageStyleIcon> {
showDoneButton: true, showDoneButton: true,
showHeader: true, showHeader: true,
title: LocaleKeys.titleBar_pageIcon.tr(), title: LocaleKeys.titleBar_pageIcon.tr(),
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
isScrollControlled: true,
enableDraggableScrollable: true, enableDraggableScrollable: true,
minChildSize: 0.6, minChildSize: 0.6,
initialChildSize: 0.61, initialChildSize: 0.61,

View File

@ -8,6 +8,7 @@ import 'package:appflowy/shared/feedback_gesture_detector.dart';
import 'package:appflowy/util/font_family_extension.dart'; import 'package:appflowy/util/font_family_extension.dart';
import 'package:appflowy/workspace/application/settings/appearance/base_appearance.dart'; import 'package:appflowy/workspace/application/settings/appearance/base_appearance.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -208,8 +209,7 @@ class _FontButton extends StatelessWidget {
showDoneButton: true, showDoneButton: true,
showHeader: true, showHeader: true,
title: LocaleKeys.titleBar_font.tr(), title: LocaleKeys.titleBar_font.tr(),
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: AFThemeExtension.of(context).background,
isScrollControlled: true,
enableDraggableScrollable: true, enableDraggableScrollable: true,
minChildSize: 0.6, minChildSize: 0.6,
initialChildSize: 0.61, initialChildSize: 0.61,

View File

@ -137,7 +137,7 @@ class TableColorOptionAction extends PopoverActionCell {
colors: colors, colors: colors,
selected: selectedColor, selected: selectedColor,
border: Border.all( border: Border.all(
color: Theme.of(context).colorScheme.onBackground, color: AFThemeExtension.of(context).onBackground,
), ),
onTap: (option, index) async { onTap: (option, index) async {
final backgroundColor = final backgroundColor =

View File

@ -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/workspace/application/settings/appearance/base_appearance.dart';
import 'package:appflowy_editor/appflowy_editor.dart' hide Log; import 'package:appflowy_editor/appflowy_editor.dart' hide Log;
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -42,6 +43,7 @@ class EditorStyleCustomizer {
EditorStyle desktop() { EditorStyle desktop() {
final theme = Theme.of(context); final theme = Theme.of(context);
final afThemeExtension = AFThemeExtension.of(context);
final appearanceFont = context.read<AppearanceSettingsCubit>().state.font; final appearanceFont = context.read<AppearanceSettingsCubit>().state.font;
final appearance = context.read<DocumentAppearanceCubit>().state; final appearance = context.read<DocumentAppearanceCubit>().state;
final fontSize = appearance.fontSize; final fontSize = appearance.fontSize;
@ -60,8 +62,7 @@ class EditorStyleCustomizer {
textStyleConfiguration: TextStyleConfiguration( textStyleConfiguration: TextStyleConfiguration(
text: baseTextStyle(fontFamily).copyWith( text: baseTextStyle(fontFamily).copyWith(
fontSize: fontSize, fontSize: fontSize,
color: theme.colorScheme.onBackground, color: afThemeExtension.onBackground,
height: 1.5,
), ),
bold: baseTextStyle(fontFamily, fontWeight: FontWeight.bold).copyWith( bold: baseTextStyle(fontFamily, fontWeight: FontWeight.bold).copyWith(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -93,6 +94,7 @@ class EditorStyleCustomizer {
} }
EditorStyle mobile() { EditorStyle mobile() {
final afThemeExtension = AFThemeExtension.of(context);
final pageStyle = context.read<DocumentPageStyleBloc>().state; final pageStyle = context.read<DocumentPageStyleBloc>().state;
final theme = Theme.of(context); final theme = Theme.of(context);
final fontSize = pageStyle.fontLayout.fontSize; final fontSize = pageStyle.fontLayout.fontSize;
@ -108,10 +110,10 @@ class EditorStyleCustomizer {
padding: padding, padding: padding,
defaultTextDirection: defaultTextDirection, defaultTextDirection: defaultTextDirection,
textStyleConfiguration: TextStyleConfiguration( textStyleConfiguration: TextStyleConfiguration(
lineHeight: lineHeight,
text: baseTextStyle.copyWith( text: baseTextStyle.copyWith(
fontSize: fontSize, fontSize: fontSize,
color: theme.colorScheme.onBackground, color: afThemeExtension.onBackground,
height: lineHeight,
), ),
bold: baseTextStyle.copyWith(fontWeight: FontWeight.w600), bold: baseTextStyle.copyWith(fontWeight: FontWeight.w600),
italic: baseTextStyle.copyWith(fontStyle: FontStyle.italic), italic: baseTextStyle.copyWith(fontStyle: FontStyle.italic),
@ -177,7 +179,7 @@ class EditorStyleCustomizer {
return baseTextStyle(fontFamily).copyWith( return baseTextStyle(fontFamily).copyWith(
fontSize: fontSize, fontSize: fontSize,
height: 1.5, height: 1.5,
color: Theme.of(context).colorScheme.onBackground, color: AFThemeExtension.of(context).onBackground,
); );
} }
@ -187,16 +189,17 @@ class EditorStyleCustomizer {
fontFamily: defaultFontFamily, fontFamily: defaultFontFamily,
fontSize: fontSize, fontSize: fontSize,
height: 1.5, height: 1.5,
color: Theme.of(context).colorScheme.onBackground.withOpacity(0.6), color: AFThemeExtension.of(context).onBackground.withOpacity(0.6),
); );
} }
SelectionMenuStyle selectionMenuStyleBuilder() { SelectionMenuStyle selectionMenuStyleBuilder() {
final theme = Theme.of(context); final theme = Theme.of(context);
final afThemeExtension = AFThemeExtension.of(context);
return SelectionMenuStyle( return SelectionMenuStyle(
selectionMenuBackgroundColor: theme.cardColor, selectionMenuBackgroundColor: theme.cardColor,
selectionMenuItemTextColor: theme.colorScheme.onBackground, selectionMenuItemTextColor: afThemeExtension.onBackground,
selectionMenuItemIconColor: theme.colorScheme.onBackground, selectionMenuItemIconColor: afThemeExtension.onBackground,
selectionMenuItemSelectedIconColor: theme.colorScheme.onSurface, selectionMenuItemSelectedIconColor: theme.colorScheme.onSurface,
selectionMenuItemSelectedTextColor: theme.colorScheme.onSurface, selectionMenuItemSelectedTextColor: theme.colorScheme.onSurface,
selectionMenuItemSelectedColor: theme.hoverColor, selectionMenuItemSelectedColor: theme.hoverColor,
@ -205,10 +208,11 @@ class EditorStyleCustomizer {
InlineActionsMenuStyle inlineActionsMenuStyleBuilder() { InlineActionsMenuStyle inlineActionsMenuStyleBuilder() {
final theme = Theme.of(context); final theme = Theme.of(context);
final afThemeExtension = AFThemeExtension.of(context);
return InlineActionsMenuStyle( return InlineActionsMenuStyle(
backgroundColor: theme.cardColor, backgroundColor: theme.cardColor,
groupTextColor: theme.colorScheme.onBackground.withOpacity(.8), groupTextColor: afThemeExtension.onBackground.withOpacity(.8),
menuItemTextColor: theme.colorScheme.onBackground, menuItemTextColor: afThemeExtension.onBackground,
menuItemSelectedColor: theme.colorScheme.secondary, menuItemSelectedColor: theme.colorScheme.secondary,
menuItemSelectedTextColor: theme.colorScheme.onSurface, menuItemSelectedTextColor: theme.colorScheme.onSurface,
); );

View File

@ -73,7 +73,7 @@ class _WindowTitleBarState extends State<WindowTitleBar> {
return Container( return Container(
height: 40, height: 40,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
), ),
child: DragToMoveArea( child: DragToMoveArea(
child: Row( child: Row(

View File

@ -154,20 +154,20 @@ class _DesktopSignInButton extends StatelessWidget {
), ),
), ),
style: ButtonStyle( style: ButtonStyle(
overlayColor: MaterialStateProperty.resolveWith<Color?>( overlayColor: WidgetStateProperty.resolveWith<Color?>(
(states) { (states) {
if (states.contains(MaterialState.hovered)) { if (states.contains(WidgetState.hovered)) {
return style.colorScheme.onSecondaryContainer; return style.colorScheme.onSecondaryContainer;
} }
return null; return null;
}, },
), ),
shape: MaterialStateProperty.all( shape: WidgetStateProperty.all(
const RoundedRectangleBorder( const RoundedRectangleBorder(
borderRadius: Corners.s6Border, borderRadius: Corners.s6Border,
), ),
), ),
side: MaterialStateProperty.all( side: WidgetStateProperty.all(
BorderSide( BorderSide(
color: style.dividerColor, color: style.dividerColor,
), ),

View File

@ -1,9 +1,8 @@
import 'package:flutter/material.dart';
import 'package:appflowy/shared/google_fonts_extension.dart'; import 'package:appflowy/shared/google_fonts_extension.dart';
import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flowy_infra/size.dart'; import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/theme.dart'; import 'package:flowy_infra/theme.dart';
import 'package:flutter/material.dart';
// the default font family is empty, so we can use the default font family of the platform // the default font family is empty, so we can use the default font family of the platform
// the system will choose the default font family of the platform // the system will choose the default font family of the platform
@ -20,10 +19,10 @@ const builtInCodeFontFamily = 'RobotoMono';
abstract class BaseAppearance { abstract class BaseAppearance {
final white = const Color(0xFFFFFFFF); final white = const Color(0xFFFFFFFF);
final Set<MaterialState> scrollbarInteractiveStates = <MaterialState>{ final Set<WidgetState> scrollbarInteractiveStates = <WidgetState>{
MaterialState.pressed, WidgetState.pressed,
MaterialState.hovered, WidgetState.hovered,
MaterialState.dragged, WidgetState.dragged,
}; };
TextStyle getFontStyle({ TextStyle getFontStyle({

View File

@ -34,8 +34,6 @@ class DesktopAppearance extends BaseAppearance {
// Editor: toolbarColor // Editor: toolbarColor
onTertiary: theme.toolbarColor, onTertiary: theme.toolbarColor,
tertiaryContainer: theme.questionBubbleBG, tertiaryContainer: theme.questionBubbleBG,
background: theme.surface,
onBackground: theme.text,
surface: theme.surface, surface: theme.surface,
// text&icon color when it is hovered // text&icon color when it is hovered
onSurface: theme.hoverFG, onSurface: theme.hoverFG,
@ -44,7 +42,7 @@ class DesktopAppearance extends BaseAppearance {
onError: theme.onPrimary, onError: theme.onPrimary,
error: theme.red, error: theme.red,
outline: theme.shader4, outline: theme.shader4,
surfaceVariant: theme.sidebarBg, surfaceContainerHighest: theme.sidebarBg,
shadow: theme.shadow, shadow: theme.shadow,
); );
@ -76,13 +74,13 @@ class DesktopAppearance extends BaseAppearance {
contentTextStyle: TextStyle(color: colorScheme.onSurface), contentTextStyle: TextStyle(color: colorScheme.onSurface),
), ),
scrollbarTheme: ScrollbarThemeData( scrollbarTheme: ScrollbarThemeData(
thumbColor: MaterialStateProperty.resolveWith((states) { thumbColor: WidgetStateProperty.resolveWith((states) {
if (states.any(scrollbarInteractiveStates.contains)) { if (states.any(scrollbarInteractiveStates.contains)) {
return theme.shader7; return theme.shader7;
} }
return theme.shader5; return theme.shader5;
}), }),
thickness: MaterialStateProperty.resolveWith((states) { thickness: WidgetStateProperty.resolveWith((states) {
if (states.any(scrollbarInteractiveStates.contains)) { if (states.any(scrollbarInteractiveStates.contains)) {
return 4; return 4;
} }
@ -144,6 +142,8 @@ class DesktopAppearance extends BaseAppearance {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontColor: theme.hint, fontColor: theme.hint,
), ),
onBackground: theme.text,
background: theme.surface,
), ),
], ],
); );

View File

@ -1,11 +1,10 @@
import 'package:flutter/material.dart';
// ThemeData in mobile // ThemeData in mobile
import 'package:appflowy/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/aa_menu/_toolbar_theme.dart'; import 'package:appflowy/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/aa_menu/_toolbar_theme.dart';
import 'package:appflowy/workspace/application/settings/appearance/base_appearance.dart'; import 'package:appflowy/workspace/application/settings/appearance/base_appearance.dart';
import 'package:flowy_infra/size.dart'; import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/theme.dart'; import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra/theme_extension.dart';
import 'package:flutter/material.dart';
class MobileAppearance extends BaseAppearance { class MobileAppearance extends BaseAppearance {
static const _primaryColor = Color(0xFF00BCF0); //primary 100 static const _primaryColor = Color(0xFF00BCF0); //primary 100
@ -49,14 +48,12 @@ class MobileAppearance extends BaseAppearance {
tertiary: const Color(0xff858585), // for light text tertiary: const Color(0xff858585), // for light text
error: const Color(0xffFB006D), error: const Color(0xffFB006D),
onError: const Color(0xffFB006D), onError: const Color(0xffFB006D),
background: Colors.white,
onBackground: _onBackgroundColor,
outline: const Color(0xffe3e3e3), outline: const Color(0xffe3e3e3),
outlineVariant: const Color(0xffCBD5E0).withOpacity(0.24), outlineVariant: const Color(0xffCBD5E0).withOpacity(0.24),
//Snack bar //Snack bar
surface: Colors.white, surface: Colors.white,
onSurface: _onSurfaceColor, // text/body color onSurface: _onSurfaceColor, // text/body color
surfaceVariant: const Color.fromARGB(255, 216, 216, 216), surfaceContainerHighest: const Color.fromARGB(255, 216, 216, 216),
) )
: ColorScheme( : ColorScheme(
brightness: brightness, brightness: brightness,
@ -67,8 +64,6 @@ class MobileAppearance extends BaseAppearance {
tertiary: const Color(0xff858585), // temp tertiary: const Color(0xff858585), // temp
error: const Color(0xffFB006D), error: const Color(0xffFB006D),
onError: const Color(0xffFB006D), onError: const Color(0xffFB006D),
background: const Color(0xff121212), // temp
onBackground: Colors.white,
outline: _hintColorInDarkMode, outline: _hintColorInDarkMode,
outlineVariant: Colors.black, outlineVariant: Colors.black,
//Snack bar //Snack bar
@ -78,6 +73,10 @@ class MobileAppearance extends BaseAppearance {
final hintColor = brightness == Brightness.light final hintColor = brightness == Brightness.light
? const Color(0x991F2329) ? const Color(0x991F2329)
: _hintColorInDarkMode; : _hintColorInDarkMode;
final onBackground =
brightness == Brightness.light ? _onBackgroundColor : Colors.white;
final background =
brightness == Brightness.light ? Colors.white : const Color(0xff121212);
return ThemeData( return ThemeData(
useMaterial3: false, useMaterial3: false,
@ -86,14 +85,14 @@ class MobileAppearance extends BaseAppearance {
dividerColor: colorTheme.outline, //caption dividerColor: colorTheme.outline, //caption
hintColor: hintColor, hintColor: hintColor,
disabledColor: colorTheme.outline, disabledColor: colorTheme.outline,
scaffoldBackgroundColor: colorTheme.background, scaffoldBackgroundColor: background,
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
toolbarHeight: 44.0, toolbarHeight: 44.0,
foregroundColor: colorTheme.onBackground, foregroundColor: onBackground,
backgroundColor: colorTheme.background, backgroundColor: background,
centerTitle: false, centerTitle: false,
titleTextStyle: TextStyle( titleTextStyle: TextStyle(
color: colorTheme.onBackground, color: onBackground,
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: 0.05, letterSpacing: 0.05,
@ -101,8 +100,8 @@ class MobileAppearance extends BaseAppearance {
shadowColor: colorTheme.outlineVariant, shadowColor: colorTheme.outlineVariant,
), ),
radioTheme: RadioThemeData( radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith((states) { fillColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) { if (states.contains(WidgetState.selected)) {
return colorTheme.primary; return colorTheme.primary;
} }
return colorTheme.outline; return colorTheme.outline;
@ -111,20 +110,20 @@ class MobileAppearance extends BaseAppearance {
// button // button
elevatedButtonTheme: ElevatedButtonThemeData( elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle( style: ButtonStyle(
fixedSize: MaterialStateProperty.all(const Size.fromHeight(48)), fixedSize: WidgetStateProperty.all(const Size.fromHeight(48)),
elevation: MaterialStateProperty.all(0), elevation: WidgetStateProperty.all(0),
textStyle: MaterialStateProperty.all( textStyle: WidgetStateProperty.all(
TextStyle( TextStyle(
fontSize: 14, fontSize: 14,
fontFamily: fontStyle.fontFamily, fontFamily: fontStyle.fontFamily,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
shadowColor: MaterialStateProperty.all(null), shadowColor: WidgetStateProperty.all(null),
foregroundColor: MaterialStateProperty.all(Colors.white), foregroundColor: WidgetStateProperty.all(Colors.white),
backgroundColor: MaterialStateProperty.resolveWith<Color>( backgroundColor: WidgetStateProperty.resolveWith<Color>(
(Set<MaterialState> states) { (Set<WidgetState> states) {
if (states.contains(MaterialState.disabled)) { if (states.contains(WidgetState.disabled)) {
return _primaryColor; return _primaryColor;
} }
return colorTheme.primary; return colorTheme.primary;
@ -134,29 +133,29 @@ class MobileAppearance extends BaseAppearance {
), ),
outlinedButtonTheme: OutlinedButtonThemeData( outlinedButtonTheme: OutlinedButtonThemeData(
style: ButtonStyle( style: ButtonStyle(
textStyle: MaterialStateProperty.all( textStyle: WidgetStateProperty.all(
TextStyle( TextStyle(
fontSize: 14, fontSize: 14,
fontFamily: fontStyle.fontFamily, fontFamily: fontStyle.fontFamily,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
foregroundColor: MaterialStateProperty.all(colorTheme.onBackground), foregroundColor: WidgetStateProperty.all(onBackground),
backgroundColor: MaterialStateProperty.all(colorTheme.background), backgroundColor: WidgetStateProperty.all(background),
shape: MaterialStateProperty.all( shape: WidgetStateProperty.all(
RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
), ),
side: MaterialStateProperty.all( side: WidgetStateProperty.all(
BorderSide(color: colorTheme.outline, width: 0.5), BorderSide(color: colorTheme.outline, width: 0.5),
), ),
padding: MaterialStateProperty.all( padding: WidgetStateProperty.all(
const EdgeInsets.symmetric(horizontal: 8, vertical: 12), const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
), ),
), ),
), ),
textButtonTheme: TextButtonThemeData( textButtonTheme: TextButtonThemeData(
style: ButtonStyle( style: ButtonStyle(
textStyle: MaterialStateProperty.all(fontStyle), textStyle: WidgetStateProperty.all(fontStyle),
), ),
), ),
// text // text
@ -170,7 +169,7 @@ class MobileAppearance extends BaseAppearance {
letterSpacing: 0.16, letterSpacing: 0.16,
), ),
displayMedium: fontStyle.copyWith( displayMedium: fontStyle.copyWith(
color: colorTheme.onBackground, color: onBackground,
fontSize: 32, fontSize: 32,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
height: 1.20, height: 1.20,
@ -178,33 +177,33 @@ class MobileAppearance extends BaseAppearance {
), ),
// H1 Semi 26 // H1 Semi 26
displaySmall: fontStyle.copyWith( displaySmall: fontStyle.copyWith(
color: colorTheme.onBackground, color: onBackground,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
height: 1.10, height: 1.10,
letterSpacing: 0.13, letterSpacing: 0.13,
), ),
// body2 14 Regular // body2 14 Regular
bodyMedium: fontStyle.copyWith( bodyMedium: fontStyle.copyWith(
color: colorTheme.onBackground, color: onBackground,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
letterSpacing: 0.07, letterSpacing: 0.07,
), ),
// Trash empty title // Trash empty title
labelLarge: fontStyle.copyWith( labelLarge: fontStyle.copyWith(
color: colorTheme.onBackground, color: onBackground,
fontSize: 22, fontSize: 22,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.3, letterSpacing: -0.3,
), ),
// setting item title // setting item title
labelMedium: fontStyle.copyWith( labelMedium: fontStyle.copyWith(
color: colorTheme.onSurface, color: onBackground,
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
// setting group title // setting group title
labelSmall: fontStyle.copyWith( labelSmall: fontStyle.copyWith(
color: colorTheme.onBackground, color: onBackground,
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: 0.05, letterSpacing: 0.05,
@ -273,6 +272,8 @@ class MobileAppearance extends BaseAppearance {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: theme.hint, color: theme.hint,
), ),
onBackground: onBackground,
background: background,
), ),
ToolbarColorExtension.fromBrightness(brightness), ToolbarColorExtension.fromBrightness(brightness),
], ],

View File

@ -211,7 +211,7 @@ class _SidebarState extends State<_Sidebar> {
final userState = context.read<UserWorkspaceBloc>().state; final userState = context.read<UserWorkspaceBloc>().state;
return DecoratedBox( return DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
border: Border( border: Border(
right: BorderSide(color: Theme.of(context).dividerColor), right: BorderSide(color: Theme.of(context).dividerColor),
), ),

View File

@ -86,7 +86,7 @@ class _FlowyTabState extends State<FlowyTab> {
return AFThemeExtension.of(context).lightGreyHover; return AFThemeExtension.of(context).lightGreyHover;
} }
return Theme.of(context).colorScheme.surfaceVariant; return Theme.of(context).colorScheme.surfaceContainerHighest;
} }
void _closeTab([TapUpDetails? details]) => context void _closeTab([TapUpDetails? details]) => context

View File

@ -59,7 +59,7 @@ class _TabsManagerState extends State<TabsManager>
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
height: HomeSizes.tabBarHeigth, height: HomeSizes.tabBarHeigth,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
), ),
/// TODO(Xazin): Custom Reorderable TabBar /// TODO(Xazin): Custom Reorderable TabBar

View File

@ -57,7 +57,7 @@ void showSnackBarMessage(
}) { }) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
backgroundColor: Theme.of(context).colorScheme.surfaceVariant, backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest,
duration: duration, duration: duration,
action: !showCancel action: !showCancel
? null ? null

View File

@ -81,30 +81,30 @@ class _ToggleUnreadsButtonState extends State<_ToggleUnreadsButton> {
showSelectedIcon: false, showSelectedIcon: false,
style: ButtonStyle( style: ButtonStyle(
tapTargetSize: MaterialTapTargetSize.shrinkWrap, tapTargetSize: MaterialTapTargetSize.shrinkWrap,
side: MaterialStatePropertyAll( side: WidgetStatePropertyAll(
BorderSide(color: Theme.of(context).dividerColor), BorderSide(color: Theme.of(context).dividerColor),
), ),
shape: const MaterialStatePropertyAll( shape: const WidgetStatePropertyAll(
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: Corners.s6Border, borderRadius: Corners.s6Border,
), ),
), ),
foregroundColor: MaterialStateProperty.resolveWith<Color>( foregroundColor: WidgetStateProperty.resolveWith<Color>(
(state) { (state) {
if (state.contains(MaterialState.selected)) { if (state.contains(WidgetState.selected)) {
return Theme.of(context).colorScheme.onPrimary; return Theme.of(context).colorScheme.onPrimary;
} }
return AFThemeExtension.of(context).textColor; return AFThemeExtension.of(context).textColor;
}, },
), ),
backgroundColor: MaterialStateProperty.resolveWith<Color>( backgroundColor: WidgetStateProperty.resolveWith<Color>(
(state) { (state) {
if (state.contains(MaterialState.selected)) { if (state.contains(WidgetState.selected)) {
return Theme.of(context).colorScheme.primary; return Theme.of(context).colorScheme.primary;
} }
if (state.contains(MaterialState.hovered)) { if (state.contains(WidgetState.hovered)) {
return AFThemeExtension.of(context).lightGreyHover; return AFThemeExtension.of(context).lightGreyHover;
} }

View File

@ -930,7 +930,7 @@ class _CursorColorValueWidget extends StatelessWidget {
FlowyText( FlowyText(
LocaleKeys.appName.tr(), LocaleKeys.appName.tr(),
// To avoid the text color changes when it is hovered in dark mode // To avoid the text color changes when it is hovered in dark mode
color: Theme.of(context).colorScheme.onBackground, color: AFThemeExtension.of(context).onBackground,
), ),
], ],
); );
@ -981,7 +981,7 @@ class _SelectionColorValueWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// To avoid the text color changes when it is hovered in dark mode // To avoid the text color changes when it is hovered in dark mode
final textColor = Theme.of(context).colorScheme.onBackground; final textColor = AFThemeExtension.of(context).onBackground;
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [

View File

@ -21,12 +21,12 @@ DropdownMenuEntry<T> buildDropdownMenuEntry<T>(
return DropdownMenuEntry<T>( return DropdownMenuEntry<T>(
style: ButtonStyle( style: ButtonStyle(
foregroundColor: foregroundColor:
MaterialStatePropertyAll(Theme.of(context).colorScheme.primary), WidgetStatePropertyAll(Theme.of(context).colorScheme.primary),
padding: MaterialStateProperty.all( padding: WidgetStateProperty.all(
const EdgeInsets.symmetric(horizontal: 6, vertical: 4), const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
), ),
minimumSize: const MaterialStatePropertyAll(Size(double.infinity, 29)), minimumSize: const WidgetStatePropertyAll(Size(double.infinity, 29)),
maximumSize: const MaterialStatePropertyAll(Size(double.infinity, 29)), maximumSize: const WidgetStatePropertyAll(Size(double.infinity, 29)),
), ),
value: value, value: value,
label: label, label: label,

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.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:flutter/material.dart';
class SettingValueDropDown extends StatefulWidget { class SettingValueDropDown extends StatefulWidget {
const SettingValueDropDown({ const SettingValueDropDown({
@ -45,7 +45,7 @@ class _SettingValueDropDownState extends State<SettingValueDropDown> {
child: widget.child ?? child: widget.child ??
FlowyTextButton( FlowyTextButton(
widget.currentValue, widget.currentValue,
fontColor: Theme.of(context).colorScheme.onBackground, fontColor: AFThemeExtension.maybeOf(context)?.onBackground,
fillColor: Colors.transparent, fillColor: Colors.transparent,
onPressed: () {}, onPressed: () {},
), ),

View File

@ -59,14 +59,14 @@ class _SettingsDropdownState<T> extends State<SettingsDropdown<T>> {
?.copyWith(fontFamily: fontFamilyUsed), ?.copyWith(fontFamily: fontFamilyUsed),
menuStyle: MenuStyle( menuStyle: MenuStyle(
maximumSize: maximumSize:
const MaterialStatePropertyAll(Size(double.infinity, 250)), const WidgetStatePropertyAll(Size(double.infinity, 250)),
elevation: const MaterialStatePropertyAll(10), elevation: const WidgetStatePropertyAll(10),
shadowColor: shadowColor:
MaterialStatePropertyAll(Colors.black.withOpacity(0.4)), WidgetStatePropertyAll(Colors.black.withOpacity(0.4)),
backgroundColor: MaterialStatePropertyAll( backgroundColor: WidgetStatePropertyAll(
Theme.of(context).cardColor, Theme.of(context).cardColor,
), ),
padding: const MaterialStatePropertyAll( padding: const WidgetStatePropertyAll(
EdgeInsets.symmetric(horizontal: 6, vertical: 8), EdgeInsets.symmetric(horizontal: 6, vertical: 8),
), ),
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,

View File

@ -29,6 +29,6 @@ EmojiPickerConfig buildFlowyEmojiPickerConfig(BuildContext context) {
noRecentsText: LocaleKeys.emoji_noRecent.tr(), noRecentsText: LocaleKeys.emoji_noRecent.tr(),
noRecentsStyle: style.textTheme.bodyMedium, noRecentsStyle: style.textTheme.bodyMedium,
noEmojiFoundText: LocaleKeys.emoji_noEmojiFound.tr(), noEmojiFoundText: LocaleKeys.emoji_noEmojiFound.tr(),
scrollBarHandleColor: style.colorScheme.onBackground, scrollBarHandleColor: style.colorScheme.onSurface,
); );
} }

View File

@ -18,6 +18,7 @@ import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/widget/error_page.dart'; import 'package:flowy_infra_ui/widget/error_page.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flowy_infra/theme_extension.dart';
class AppFlowyCloudViewSetting extends StatelessWidget { class AppFlowyCloudViewSetting extends StatelessWidget {
const AppFlowyCloudViewSetting({ const AppFlowyCloudViewSetting({
@ -289,7 +290,7 @@ class CloudURLInputState extends State<CloudURLInput> {
.copyWith(fontWeight: FontWeight.w400, fontSize: 16), .copyWith(fontWeight: FontWeight.w400, fontSize: 16),
enabledBorder: UnderlineInputBorder( enabledBorder: UnderlineInputBorder(
borderSide: borderSide:
BorderSide(color: Theme.of(context).colorScheme.onBackground), BorderSide(color: AFThemeExtension.of(context).onBackground),
), ),
focusedBorder: UnderlineInputBorder( focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).colorScheme.primary), borderSide: BorderSide(color: Theme.of(context).colorScheme.primary),

View File

@ -1,5 +1,3 @@
import 'package:flutter/material.dart';
import 'package:appflowy/env/cloud_env.dart'; import 'package:appflowy/env/cloud_env.dart';
import 'package:appflowy/env/env.dart'; import 'package:appflowy/env/env.dart';
import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/flowy_svgs.g.dart';
@ -15,7 +13,9 @@ import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
@ -127,7 +127,7 @@ class CloudTypeSwitcher extends StatelessWidget {
child: FlowyTextButton( child: FlowyTextButton(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 6), padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 6),
titleFromCloudType(cloudType), titleFromCloudType(cloudType),
fontColor: Theme.of(context).colorScheme.onBackground, fontColor: AFThemeExtension.of(context).onBackground,
fillColor: Colors.transparent, fillColor: Colors.transparent,
onPressed: () {}, onPressed: () {},
), ),
@ -159,7 +159,6 @@ class CloudTypeSwitcher extends StatelessWidget {
showHeader: true, showHeader: true,
showDragHandle: true, showDragHandle: true,
showDivider: false, showDivider: false,
showCloseButton: false,
title: LocaleKeys.settings_menu_cloudServerType.tr(), title: LocaleKeys.settings_menu_cloudServerType.tr(),
builder: (context) { builder: (context) {
return Column( return Column(

View File

@ -1,7 +1,3 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:appflowy/core/helpers/url_launcher.dart'; import 'package:appflowy/core/helpers/url_launcher.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/workspace/application/settings/supabase_cloud_setting_bloc.dart'; import 'package:appflowy/workspace/application/settings/supabase_cloud_setting_bloc.dart';
@ -15,9 +11,13 @@ import 'package:appflowy_backend/protobuf/flowy-user/user_setting.pb.dart';
import 'package:appflowy_result/appflowy_result.dart'; import 'package:appflowy_result/appflowy_result.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/size.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/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/widget/error_page.dart'; import 'package:flowy_infra_ui/widget/error_page.dart';
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
class SettingSupabaseCloudView extends StatelessWidget { class SettingSupabaseCloudView extends StatelessWidget {
@ -293,7 +293,7 @@ class SupabaseInputState extends State<SupabaseInput> {
.copyWith(fontWeight: FontWeight.w400, fontSize: 16), .copyWith(fontWeight: FontWeight.w400, fontSize: 16),
enabledBorder: UnderlineInputBorder( enabledBorder: UnderlineInputBorder(
borderSide: borderSide:
BorderSide(color: Theme.of(context).colorScheme.onBackground), BorderSide(color: AFThemeExtension.of(context).onBackground),
), ),
focusedBorder: UnderlineInputBorder( focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).colorScheme.primary), borderSide: BorderSide(color: Theme.of(context).colorScheme.primary),

View File

@ -32,7 +32,7 @@ class SettingsMenu extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: 8) + padding: const EdgeInsets.symmetric(vertical: 8) +
const EdgeInsets.only(left: 8, right: 4), const EdgeInsets.only(left: 8, right: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(
topLeft: Radius.circular(8), topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8), bottomLeft: Radius.circular(8),

View File

@ -1,4 +1,5 @@
import 'package:dotted_border/dotted_border.dart'; import 'package:dotted_border/dotted_border.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'theme_upload_view.dart'; import 'theme_upload_view.dart';
@ -15,7 +16,7 @@ class ThemeUploadDecoration extends StatelessWidget {
borderRadius: BorderRadius.circular(ThemeUploadWidget.borderRadius), borderRadius: BorderRadius.circular(ThemeUploadWidget.borderRadius),
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
border: Border.all( border: Border.all(
color: Theme.of(context).colorScheme.onBackground.withOpacity( color: AFThemeExtension.of(context).onBackground.withOpacity(
ThemeUploadWidget.fadeOpacity, ThemeUploadWidget.fadeOpacity,
), ),
), ),
@ -26,7 +27,7 @@ class ThemeUploadDecoration extends StatelessWidget {
dashPattern: const [6, 6], dashPattern: const [6, 6],
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.onBackground .onSurface
.withOpacity(ThemeUploadWidget.fadeOpacity), .withOpacity(ThemeUploadWidget.fadeOpacity),
radius: const Radius.circular(ThemeUploadWidget.borderRadius), radius: const Radius.circular(ThemeUploadWidget.borderRadius),
child: ClipRRect( child: ClipRRect(

View File

@ -1,5 +1,6 @@
import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/theme_upload/theme_upload.dart'; import 'package:appflowy/workspace/presentation/settings/widgets/theme_upload/theme_upload.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';
@ -24,7 +25,7 @@ class ThemeUploadFailureWidget extends StatelessWidget {
FlowySvg( FlowySvg(
FlowySvgs.close_m, FlowySvgs.close_m,
size: ThemeUploadWidget.iconSize, size: ThemeUploadWidget.iconSize,
color: Theme.of(context).colorScheme.onBackground, color: AFThemeExtension.of(context).onBackground,
), ),
FlowyText.medium( FlowyText.medium(
errorMessage, errorMessage,

View File

@ -8,6 +8,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/widget/buttons/secondary_button.dart'; import 'package:flowy_infra_ui/widget/buttons/secondary_button.dart';
import 'package:flowy_infra_ui/widget/error_page.dart'; import 'package:flowy_infra_ui/widget/error_page.dart';
import 'package:flowy_infra/theme_extension.dart';
class ThemeUploadLearnMoreButton extends StatelessWidget { class ThemeUploadLearnMoreButton extends StatelessWidget {
const ThemeUploadLearnMoreButton({super.key}); const ThemeUploadLearnMoreButton({super.key});
@ -21,7 +22,7 @@ class ThemeUploadLearnMoreButton extends StatelessWidget {
height: ThemeUploadWidget.buttonSize.height, height: ThemeUploadWidget.buttonSize.height,
child: IntrinsicWidth( child: IntrinsicWidth(
child: SecondaryButton( child: SecondaryButton(
outlineColor: Theme.of(context).colorScheme.onBackground, outlineColor: AFThemeExtension.of(context).onBackground,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8), padding: const EdgeInsets.symmetric(horizontal: 8),
child: FlowyText.medium( child: FlowyText.medium(

View File

@ -13,7 +13,7 @@ class ThemeUploadLoadingWidget extends StatelessWidget {
padding: ThemeUploadWidget.padding, padding: ThemeUploadWidget.padding,
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.background .surface
.withOpacity(ThemeUploadWidget.fadeOpacity), .withOpacity(ThemeUploadWidget.fadeOpacity),
constraints: const BoxConstraints.expand(), constraints: const BoxConstraints.expand(),
child: Column( child: Column(

View File

@ -2,6 +2,7 @@ import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/theme_upload/theme_upload.dart'; import 'package:appflowy/workspace/presentation/settings/widgets/theme_upload/theme_upload.dart';
import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -13,7 +14,7 @@ class UploadNewThemeWidget extends StatelessWidget {
return Container( return Container(
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.background .surface
.withOpacity(ThemeUploadWidget.fadeOpacity), .withOpacity(ThemeUploadWidget.fadeOpacity),
padding: ThemeUploadWidget.padding, padding: ThemeUploadWidget.padding,
child: Column( child: Column(
@ -23,7 +24,7 @@ class UploadNewThemeWidget extends StatelessWidget {
FlowySvg( FlowySvg(
FlowySvgs.folder_m, FlowySvgs.folder_m,
size: ThemeUploadWidget.iconSize, size: ThemeUploadWidget.iconSize,
color: Theme.of(context).colorScheme.onBackground, color: AFThemeExtension.of(context).onBackground,
), ),
FlowyText.medium( FlowyText.medium(
LocaleKeys.settings_appearance_themeUpload_description.tr(), LocaleKeys.settings_appearance_themeUpload_description.tr(),

View File

@ -214,7 +214,7 @@ class NavigatorOkCancelDialog extends StatelessWidget {
), ),
VSpace(Insets.sm * 1.5), VSpace(Insets.sm * 1.5),
Container( Container(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
height: 1, height: 1,
), ),
VSpace(Insets.m * 1.5), VSpace(Insets.m * 1.5),

View File

@ -5,6 +5,9 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
static AFThemeExtension of(BuildContext context) => static AFThemeExtension of(BuildContext context) =>
Theme.of(context).extension<AFThemeExtension>()!; Theme.of(context).extension<AFThemeExtension>()!;
static AFThemeExtension? maybeOf(BuildContext context) =>
Theme.of(context).extension<AFThemeExtension>();
const AFThemeExtension({ const AFThemeExtension({
required this.warning, required this.warning,
required this.success, required this.success,
@ -32,6 +35,8 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
required this.progressBarBGColor, required this.progressBarBGColor,
required this.toggleButtonBGColor, required this.toggleButtonBGColor,
required this.gridRowCountColor, required this.gridRowCountColor,
required this.background,
required this.onBackground,
}); });
final Color? warning; final Color? warning;
@ -64,6 +69,9 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
final TextStyle callout; final TextStyle callout;
final TextStyle caption; final TextStyle caption;
final Color background;
final Color onBackground;
@override @override
AFThemeExtension copyWith({ AFThemeExtension copyWith({
Color? warning, Color? warning,
@ -92,6 +100,8 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
TextStyle? code, TextStyle? code,
TextStyle? callout, TextStyle? callout,
TextStyle? caption, TextStyle? caption,
Color? background,
Color? onBackground,
}) => }) =>
AFThemeExtension( AFThemeExtension(
warning: warning ?? this.warning, warning: warning ?? this.warning,
@ -121,6 +131,8 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
code: code ?? this.code, code: code ?? this.code,
callout: callout ?? this.callout, callout: callout ?? this.callout,
caption: caption ?? this.caption, caption: caption ?? this.caption,
onBackground: onBackground ?? this.onBackground,
background: background ?? this.background,
); );
@override @override
@ -165,6 +177,8 @@ class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
code: other.code, code: other.code,
callout: other.callout, callout: other.callout,
caption: other.caption, caption: other.caption,
onBackground: Color.lerp(onBackground, other.onBackground, t)!,
background: Color.lerp(background, other.background, t)!,
); );
} }
} }

View File

@ -4,7 +4,7 @@ description: Demonstrates how to use the flowy_infra_ui plugin.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
environment: environment:
flutter: ">=3.19.0" flutter: ">=3.22.0"
sdk: ">=3.1.5 <4.0.0" sdk: ">=3.1.5 <4.0.0"
dependencies: dependencies:

View File

@ -1,22 +1,19 @@
// Basis // Basis
export '/widget/separated_flex.dart';
export '/widget/spacing.dart';
export 'basis.dart'; export 'basis.dart';
export 'src/flowy_overlay/appflowy_popover.dart';
// Keyboard export 'src/flowy_overlay/flowy_dialog.dart';
export 'src/keyboard/keyboard_visibility_detector.dart';
// Overlay // Overlay
export 'src/flowy_overlay/flowy_overlay.dart'; export 'src/flowy_overlay/flowy_overlay.dart';
export 'src/flowy_overlay/list_overlay.dart'; export 'src/flowy_overlay/list_overlay.dart';
export 'src/flowy_overlay/option_overlay.dart'; export 'src/flowy_overlay/option_overlay.dart';
export 'src/flowy_overlay/flowy_dialog.dart'; // Keyboard
export 'src/flowy_overlay/appflowy_popover.dart'; export 'src/keyboard/keyboard_visibility_detector.dart';
export 'style_widget/button.dart';
export 'style_widget/color_picker.dart';
export 'style_widget/icon_button.dart';
export 'style_widget/scrolling/styled_list.dart';
export 'style_widget/scrolling/styled_scroll_bar.dart';
export 'style_widget/text.dart'; export 'style_widget/text.dart';
export 'style_widget/text_field.dart'; export 'style_widget/text_field.dart';
export 'style_widget/button.dart';
export 'style_widget/icon_button.dart';
export 'style_widget/scrolling/styled_scroll_bar.dart';
export '/widget/spacing.dart';
export '/widget/separated_flex.dart';
export 'style_widget/scrolling/styled_list.dart';
export 'style_widget/color_picker.dart';

View File

@ -128,7 +128,7 @@ class FlowyButton extends StatelessWidget {
(Platform.isIOS || Platform.isAndroid) (Platform.isIOS || Platform.isAndroid)
? BoxDecoration( ? BoxDecoration(
border: Border.all( border: Border.all(
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
width: 1.0, width: 1.0,
)) ))
: null); : null);
@ -210,12 +210,12 @@ class FlowyTextButton extends StatelessWidget {
onPressed: onPressed ?? () {}, onPressed: onPressed ?? () {},
focusNode: FocusNode(skipTraversal: onPressed == null), focusNode: FocusNode(skipTraversal: onPressed == null),
style: ButtonStyle( style: ButtonStyle(
overlayColor: const MaterialStatePropertyAll(Colors.transparent), overlayColor: const WidgetStatePropertyAll(Colors.transparent),
splashFactory: NoSplash.splashFactory, splashFactory: NoSplash.splashFactory,
tapTargetSize: MaterialTapTargetSize.shrinkWrap, tapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: MaterialStateProperty.all(padding), padding: WidgetStateProperty.all(padding),
elevation: MaterialStateProperty.all(0), elevation: WidgetStateProperty.all(0),
shape: MaterialStateProperty.all( shape: WidgetStateProperty.all(
RoundedRectangleBorder( RoundedRectangleBorder(
side: BorderSide( side: BorderSide(
color: isDangerous color: isDangerous
@ -225,7 +225,7 @@ class FlowyTextButton extends StatelessWidget {
borderRadius: radius ?? Corners.s6Border, borderRadius: radius ?? Corners.s6Border,
), ),
), ),
textStyle: MaterialStateProperty.all( textStyle: WidgetStateProperty.all(
TextStyle( TextStyle(
fontWeight: fontWeight ?? FontWeight.w500, fontWeight: fontWeight ?? FontWeight.w500,
fontSize: fontSize, fontSize: fontSize,
@ -233,9 +233,9 @@ class FlowyTextButton extends StatelessWidget {
fontFamily: fontFamily, fontFamily: fontFamily,
), ),
), ),
backgroundColor: MaterialStateProperty.resolveWith( backgroundColor: WidgetStateProperty.resolveWith(
(states) { (states) {
if (states.contains(MaterialState.hovered)) { if (states.contains(WidgetState.hovered)) {
return hoverColor ?? return hoverColor ??
(isDangerous (isDangerous
? Theme.of(context).colorScheme.error ? Theme.of(context).colorScheme.error
@ -248,9 +248,9 @@ class FlowyTextButton extends StatelessWidget {
: Theme.of(context).colorScheme.secondaryContainer); : Theme.of(context).colorScheme.secondaryContainer);
}, },
), ),
foregroundColor: MaterialStateProperty.resolveWith( foregroundColor: WidgetStateProperty.resolveWith(
(states) { (states) {
if (states.contains(MaterialState.hovered)) { if (states.contains(WidgetState.hovered)) {
return fontHoverColor ?? return fontHoverColor ??
(fontColor ?? Theme.of(context).colorScheme.onSurface); (fontColor ?? Theme.of(context).colorScheme.onSurface);
} }

View File

@ -9,7 +9,7 @@ void showSnapBar(BuildContext context, String title, {VoidCallback? onClosed}) {
ScaffoldMessenger.of(context) ScaffoldMessenger.of(context)
.showSnackBar( .showSnackBar(
SnackBar( SnackBar(
backgroundColor: Theme.of(context).colorScheme.surfaceVariant, backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest,
duration: const Duration(milliseconds: 8000), duration: const Duration(milliseconds: 8000),
content: FlowyText( content: FlowyText(
title, title,

View File

@ -1,3 +1,4 @@
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:flowy_svg/flowy_svg.dart'; import 'package:flowy_svg/flowy_svg.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -155,7 +156,7 @@ class StackTracePreview extends StatelessWidget {
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: FlowyButton( child: FlowyButton(
hoverColor: Theme.of(context).colorScheme.onBackground, hoverColor: AFThemeExtension.of(context).onBackground,
text: const FlowyText( text: const FlowyText(
"Copy", "Copy",
), ),

View File

@ -83,7 +83,7 @@ class RoundedImageButton extends StatelessWidget {
child: TextButton( child: TextButton(
onPressed: press, onPressed: press,
style: ButtonStyle( style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>( shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(borderRadius: borderRadius))), RoundedRectangleBorder(borderRadius: borderRadius))),
child: child, child: child,
), ),

View File

@ -53,11 +53,11 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: b827d08 ref: "0c79b870586f4bc5c23b61b327c51fe6a8856b47"
resolved-ref: b827d089b6e97762806075953a433cfcbe697a73 resolved-ref: "0c79b870586f4bc5c23b61b327c51fe6a8856b47"
url: "https://github.com/AppFlowy-IO/appflowy-editor.git" url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
source: git source: git
version: "2.4.0" version: "2.5.1"
appflowy_editor_plugins: appflowy_editor_plugins:
dependency: "direct main" dependency: "direct main"
description: description:
@ -949,10 +949,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: intl name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.18.1" version: "0.19.0"
intl_utils: intl_utils:
dependency: transitive dependency: transitive
description: description:
@ -1037,26 +1037,26 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: leak_tracker name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.0" version: "10.0.4"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.1" version: "3.0.3"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_testing name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.1" version: "3.0.1"
linked_scroll_controller: linked_scroll_controller:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1149,10 +1149,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.0" version: "1.12.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -1525,10 +1525,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: scaled_app name: scaled_app
sha256: "3415fad16d1cf283112988985ccd14c4cd28bf48cbe6432d59e158f3b632d58d" sha256: a2ad9f22cf2200a5ce455b59c5ea7bfb09a84acfc52452d1db54f4958c99d76a
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.0" version: "2.3.0"
screen_retriever: screen_retriever:
dependency: transitive dependency: transitive
description: description:
@ -1860,10 +1860,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: table_calendar name: table_calendar
sha256: "1e3521a3e6d3fc7f645a58b135ab663d458ab12504f1ea7f9b4b81d47086c478" sha256: b759eb6caa88dda8e51c70ee43c19d1682f8244458f84cced9138ee35b2ce416
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.9" version: "3.1.1"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@ -1876,26 +1876,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test name: test
sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.24.9" version: "1.25.2"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.1" version: "0.7.0"
test_core: test_core:
dependency: transitive dependency: transitive
description: description:
name: test_core name: test_core
sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.9" version: "0.6.0"
textstyle_extensions: textstyle_extensions:
dependency: transitive dependency: transitive
description: description:
@ -2101,10 +2101,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "13.0.0" version: "14.2.1"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@ -2203,4 +2203,4 @@ packages:
version: "2.0.0" version: "2.0.0"
sdks: sdks:
dart: ">=3.3.0 <4.0.0" dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0" flutter: ">=3.22.0"

View File

@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 0.5.8 version: 0.5.8
environment: environment:
flutter: ">=3.19.0" flutter: ">=3.22.0"
sdk: ">=3.3.0 <4.0.0" sdk: ">=3.3.0 <4.0.0"
# Dependencies specify other packages that your package needs in order to work. # Dependencies specify other packages that your package needs in order to work.
@ -55,7 +55,7 @@ dependencies:
path: packages/appflowy_popover path: packages/appflowy_popover
# third party packages # third party packages
intl: ^0.18.0 intl: ^0.19.0
time: ^2.1.3 time: ^2.1.3
equatable: ^2.0.5 equatable: ^2.0.5
freezed_annotation: ^2.2.0 freezed_annotation: ^2.2.0
@ -135,7 +135,7 @@ dependencies:
numerus: ^2.1.2 numerus: ^2.1.2
flutter_animate: ^4.5.0 flutter_animate: ^4.5.0
permission_handler: ^11.3.1 permission_handler: ^11.3.1
scaled_app: ^2.2.0 scaled_app: ^2.3.0
dev_dependencies: dev_dependencies:
flutter_lints: ^3.0.1 flutter_lints: ^3.0.1
@ -172,7 +172,7 @@ dependency_overrides:
appflowy_editor: appflowy_editor:
git: git:
url: https://github.com/AppFlowy-IO/appflowy-editor.git url: https://github.com/AppFlowy-IO/appflowy-editor.git
ref: "b827d08" ref: "0c79b870586f4bc5c23b61b327c51fe6a8856b47"
sheet: sheet:
git: git:

View File

@ -39,7 +39,7 @@ RUN source ~/.cargo/env && \
RUN sudo pacman -S --noconfirm git tar gtk3 RUN sudo pacman -S --noconfirm git tar gtk3
RUN curl -sSfL \ RUN curl -sSfL \
--output flutter.tar.xz \ --output flutter.tar.xz \
https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.19.0-stable.tar.xz && \ https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.22.0-stable.tar.xz && \
tar -xf flutter.tar.xz && \ tar -xf flutter.tar.xz && \
rm flutter.tar.xz rm flutter.tar.xz
RUN flutter config --enable-linux-desktop RUN flutter config --enable-linux-desktop

Some files were not shown because too many files have changed in this diff Show More