Skip to content

Commit

Permalink
chore: upgrade to Flutter 3.22.0 (#5395)
Browse files Browse the repository at this point in the history
* chore: upgrade flutter to 3.22.0

* chore: upgrade editor version

* chore: upgrade CI files

* fix: failed tests
  • Loading branch information
LucasXu0 committed May 23, 2024
1 parent acae348 commit 9a5dbbb
Show file tree
Hide file tree
Showing 104 changed files with 339 additions and 308 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android_ci.yaml.bak
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# env:
# CARGO_TERM_COLOR: always
# FLUTTER_VERSION: "3.19.0"
# FLUTTER_VERSION: "3.22.0"
# RUST_TOOLCHAIN: "1.77.2"
# CARGO_MAKE_VERSION: "0.36.6"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flutter_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:

env:
CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.19.0"
FLUTTER_VERSION: "3.22.0"
RUST_TOOLCHAIN: "1.77.2"
CARGO_MAKE_VERSION: "0.36.6"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
- "!frontend/appflowy_web_app/**"

env:
FLUTTER_VERSION: "3.19.0"
FLUTTER_VERSION: "3.22.0"
RUST_TOOLCHAIN: "1.77.2"

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "*"

env:
FLUTTER_VERSION: "3.19.0"
FLUTTER_VERSION: "3.22.0"
RUST_TOOLCHAIN: "1.77.2"

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.19.0"
FLUTTER_VERSION: "3.22.0"
RUST_TOOLCHAIN: "1.77.2"

jobs:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
- 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.
### 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
### Bug Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void main() {
LogicalKeyboardKey.keyR,
],
tester: tester,
withKeyUp: true,
);
expect(first.attributes[blockComponentAlign], rightAlignmentKey);

Expand All @@ -77,6 +78,7 @@ void main() {
LogicalKeyboardKey.keyE,
],
tester: tester,
withKeyUp: true,
);
expect(first.attributes[blockComponentAlign], centerAlignmentKey);

Expand All @@ -88,6 +90,7 @@ void main() {
LogicalKeyboardKey.keyL,
],
tester: tester,
withKeyUp: true,
);
expect(first.attributes[blockComponentAlign], leftAlignmentKey);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Future<void> triggerReferenceDocumentBySlashMenu(WidgetTester tester) async {
LogicalKeyboardKey.enter,
],
tester: tester,
withKeyUp: true,
);

await tester.pumpAndSettle();
Expand All @@ -129,6 +130,7 @@ Future<void> enterDocumentText(WidgetTester tester) async {
LogicalKeyboardKey.keyT,
],
tester: tester,
withKeyUp: true,
);
await tester.pumpAndSettle();
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@ class FlowyTestKeyboard {
static Future<void> simulateKeyDownEvent(
List<LogicalKeyboardKey> keys, {
required flutter_test.WidgetTester tester,
bool withKeyUp = false,
}) async {
for (final LogicalKeyboardKey key in keys) {
await flutter_test.simulateKeyDownEvent(key);
await tester.pumpAndSettle();
}

if (withKeyUp) {
for (final LogicalKeyboardKey key in keys) {
await flutter_test.simulateKeyUpEvent(key);
await tester.pumpAndSettle();
}
}
}
}
2 changes: 1 addition & 1 deletion frontend/appflowy_flutter/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ SPEC CHECKSUMS:
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
integration_test: 13825b8a9334a850581300559b8839134b124670
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
irondash_engine_context: 3458bf979b90d616ffb8ae03a150bafe2e860cc9
keyboard_height_plugin: 43fa8bba20fd5c4fdeed5076466b8b9d43cc6b86
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
Expand Down
14 changes: 7 additions & 7 deletions frontend/appflowy_flutter/lib/flutter/af_dropdown_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ class _AFDropdownMenuState<T> extends State<AFDropdownMenu<T>> {

ButtonStyle effectiveStyle = entry.style ?? defaultStyle;
final Color focusedBackgroundColor = effectiveStyle.foregroundColor
?.resolve(<MaterialState>{MaterialState.focused}) ??
?.resolve(<WidgetState>{WidgetState.focused}) ??
Theme.of(context).colorScheme.onSurface;

Widget label = entry.labelWidget ?? Text(entry.label);
Expand All @@ -499,7 +499,7 @@ class _AFDropdownMenuState<T> extends State<AFDropdownMenu<T>> {
// color will also change to foregroundColor.withOpacity(0.12).
effectiveStyle = entry.enabled && i == focusedIndex
? effectiveStyle.copyWith(
backgroundColor: MaterialStatePropertyAll<Color>(
backgroundColor: WidgetStatePropertyAll<Color>(
focusedBackgroundColor.withOpacity(0.12),
),
)
Expand Down Expand Up @@ -628,17 +628,17 @@ class _AFDropdownMenuState<T> extends State<AFDropdownMenu<T>> {
final double? anchorWidth = getWidth(_anchorKey);
if (widget.width != null) {
effectiveMenuStyle = effectiveMenuStyle.copyWith(
minimumSize: MaterialStatePropertyAll<Size?>(Size(widget.width!, 0.0)),
minimumSize: WidgetStatePropertyAll<Size?>(Size(widget.width!, 0.0)),
);
} else if (anchorWidth != null) {
effectiveMenuStyle = effectiveMenuStyle.copyWith(
minimumSize: MaterialStatePropertyAll<Size?>(Size(anchorWidth, 0.0)),
minimumSize: WidgetStatePropertyAll<Size?>(Size(anchorWidth, 0.0)),
);
}

if (widget.menuHeight != null) {
effectiveMenuStyle = effectiveMenuStyle.copyWith(
maximumSize: MaterialStatePropertyAll<Size>(
maximumSize: WidgetStatePropertyAll<Size>(
Size(double.infinity, widget.menuHeight!),
),
);
Expand Down Expand Up @@ -1029,8 +1029,8 @@ class _DropdownMenuDefaultsM3 extends DropdownMenuThemeData {
@override
MenuStyle get menuStyle {
return const MenuStyle(
minimumSize: MaterialStatePropertyAll<Size>(Size(_kMinimumWidth, 0.0)),
maximumSize: MaterialStatePropertyAll<Size>(Size.infinite),
minimumSize: WidgetStatePropertyAll<Size>(Size(_kMinimumWidth, 0.0)),
maximumSize: WidgetStatePropertyAll<Size>(Size.infinite),
visualDensity: VisualDensity.standard,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:appflowy/workspace/application/favorite/favorite_bloc.dart';
import 'package:appflowy/workspace/application/view/prelude.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down Expand Up @@ -92,7 +93,7 @@ class MobileViewPageMoreButton extends StatelessWidget {
context,
showDragHandle: true,
showDivider: false,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: AFThemeExtension.of(context).background,
builder: (_) => MultiBlocProvider(
providers: [
BlocProvider.value(value: context.read<ViewBloc>()),
Expand Down Expand Up @@ -144,7 +145,7 @@ class MobileViewPageLayoutButton extends StatelessWidget {
showDoneButton: true,
showHeader: true,
title: LocaleKeys.pageStyle_title.tr(),
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: AFThemeExtension.of(context).background,
builder: (_) => MultiBlocProvider(
providers: [
BlocProvider.value(value: context.read<DocumentPageStyleBloc>()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
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:flutter/material.dart';

Expand All @@ -19,7 +20,7 @@ class BottomSheetActionWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final iconColor =
this.iconColor ?? Theme.of(context).colorScheme.onBackground;
this.iconColor ?? AFThemeExtension.of(context).onBackground;

if (svg == null) {
return OutlinedButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/workspace/application/favorite/favorite_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_bloc/flutter_bloc.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
Expand Down Expand Up @@ -54,7 +55,7 @@ enum MobilePaneActionType {
context,
showDragHandle: true,
showDivider: false,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: AFThemeExtension.of(context).background,
useRootNavigator: true,
builder: (context) {
return MultiBlocProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_board/appflowy_board.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down Expand Up @@ -265,7 +266,7 @@ class _BoardContentState extends State<_BoardContent> {
BoxDecoration _makeBoxDecoration(BuildContext context) {
final themeMode = context.read<AppearanceSettingsCubit>().state.themeMode;
return BoxDecoration(
color: Theme.of(context).colorScheme.background,
color: AFThemeExtension.of(context).background,
borderRadius: const BorderRadius.all(Radius.circular(8)),
border: themeMode == ThemeMode.light
? Border.fromBorderSide(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
child: IconButton(
icon: Icon(
Icons.close,
color: style.colorScheme.onBackground,
color: style.colorScheme.onSurface,
),
onPressed: () =>
setState(() => _textController.clear()),
Expand All @@ -86,7 +86,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
child: Text(
LocaleKeys.button_cancel.tr(),
style: style.textTheme.titleSmall?.copyWith(
color: style.colorScheme.onBackground,
color: style.colorScheme.onSurface,
),
),
onPressed: () => setState(() => isEditing = false),
Expand All @@ -96,7 +96,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
LocaleKeys.button_add.tr(),
style: style.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.bold,
color: style.colorScheme.onBackground,
color: style.colorScheme.onSurface,
),
),
onPressed: () {
Expand All @@ -117,14 +117,14 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
)
: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
foregroundColor: style.colorScheme.onBackground,
foregroundColor: style.colorScheme.onSurface,
backgroundColor: style.colorScheme.secondary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
).copyWith(
overlayColor:
MaterialStateProperty.all(Theme.of(context).hoverColor),
WidgetStateProperty.all(Theme.of(context).hoverColor),
),
icon: const Icon(Icons.add),
label: Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:collection/collection.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down Expand Up @@ -168,7 +169,7 @@ class MobileHiddenGroup extends StatelessWidget {
return TextButton(
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.bodyMedium,
foregroundColor: Theme.of(context).colorScheme.onBackground,
foregroundColor: AFThemeExtension.of(context).onBackground,
visualDensity: VisualDensity.compact,
),
child: CardCellBuilder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down Expand Up @@ -131,7 +132,7 @@ class _MobileRowDetailPageState extends State<MobileRowDetailPage> {
void _showCardActions(BuildContext context) {
showMobileBottomSheet(
context,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: AFThemeExtension.of(context).background,
showDragHandle: true,
builder: (_) => Column(
mainAxisSize: MainAxisSize.min,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ class MobileRowDetailCreateFieldButton extends StatelessWidget {
constraints: const BoxConstraints(minWidth: double.infinity),
child: TextButton.icon(
style: Theme.of(context).textButtonTheme.style?.copyWith(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
),
overlayColor: MaterialStateProperty.all<Color>(
overlayColor: WidgetStateProperty.all<Color>(
Theme.of(context).hoverColor,
),
alignment: AlignmentDirectional.centerStart,
splashFactory: NoSplash.splashFactory,
padding: const MaterialStatePropertyAll(
padding: const WidgetStatePropertyAll(
EdgeInsets.symmetric(vertical: 14, horizontal: 6),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

Expand Down Expand Up @@ -40,7 +41,7 @@ Future<FieldType?> showFieldTypeGridBottomSheet(
showCloseButton: true,
elevation: 20,
title: title,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: AFThemeExtension.of(context).background,
enableDraggableScrollable: true,
builder: (context) {
final typeOptionMenuItemValue = mobileSupportedFieldTypes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class _SortDetailContent extends StatelessWidget {
color: Theme.of(context).colorScheme.surface,
),
splashFactory: NoSplash.splashFactory,
overlayColor: const MaterialStatePropertyAll(
overlayColor: const WidgetStatePropertyAll(
Colors.transparent,
),
onTap: (index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:collection/collection.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down Expand Up @@ -183,7 +184,7 @@ class MobileDatabaseViewListButton extends StatelessWidget {
showMobileBottomSheet(
context,
showDragHandle: true,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: AFThemeExtension.of(context).background,
builder: (_) {
return BlocProvider<ViewBloc>(
create: (_) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ class DatabaseViewSettingTile extends StatelessWidget {
showHeader: true,
showBackButton: true,
title: LocaleKeys.grid_settings_properties.tr(),
showDivider: true,
builder: (_) {
return BlocProvider.value(
value: context.read<ViewBloc>(),
Expand Down

0 comments on commit 9a5dbbb

Please sign in to comment.