Skip to content

Commit

Permalink
chore: upgrade Flutter to 3.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed May 14, 2024
1 parent 1ceed9b commit 04675ee
Show file tree
Hide file tree
Showing 24 changed files with 122 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.19.0"
flutter-version: "3.22.0"
cache: true

- name: Run tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
height: 36,
child: TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(const Color(0xFF00BCF0)),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
backgroundColor: WidgetStateProperty.all(const Color(0xFF00BCF0)),
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/src/editor/selection_menu/selection_menu_item_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ class _SelectionMenuItemWidgetState extends State<SelectionMenuItemWidget> {
),
style: ButtonStyle(
alignment: Alignment.centerLeft,
overlayColor: MaterialStateProperty.all(
overlayColor: WidgetStateProperty.all(
style.selectionMenuItemSelectedColor,
),
backgroundColor: widget.isSelected
? MaterialStateProperty.all(
? WidgetStateProperty.all(
style.selectionMenuItemSelectedColor,
)
: MaterialStateProperty.all(Colors.transparent),
: WidgetStateProperty.all(Colors.transparent),
),
label: Text(
widget.item.name,
Expand Down
6 changes: 3 additions & 3 deletions lib/src/editor/toolbar/desktop/items/color/color_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ class ResetColorButton extends StatelessWidget {
textAlign: TextAlign.left,
),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.hovered)) {
backgroundColor: WidgetStateProperty.resolveWith<Color>(
(Set<WidgetState> states) {
if (states.contains(WidgetState.hovered)) {

Check warning on line 174 in lib/src/editor/toolbar/desktop/items/color/color_picker.dart

View check run for this annotation

Codecov / codecov/patch

lib/src/editor/toolbar/desktop/items/color/color_picker.dart#L172-L174

Added lines #L172 - L174 were not covered by tests
return Theme.of(context).hoverColor;
}
return Colors.transparent;
Expand Down
6 changes: 3 additions & 3 deletions lib/src/editor/toolbar/desktop/items/utils/overlay_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import 'package:flutter/material.dart';

ButtonStyle buildOverlayButtonStyle(BuildContext context) {
return ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.hovered)) {
backgroundColor: WidgetStateProperty.resolveWith<Color>(
(Set<WidgetState> states) {
if (states.contains(WidgetState.hovered)) {
return Theme.of(context).hoverColor;
}
return Colors.transparent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,20 @@ class _MobileLinkMenuState extends State<MobileLinkMenu> {
widget.onCancel.call();
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStateProperty.all(
style.backgroundColor,
),
foregroundColor: MaterialStateProperty.all(
foregroundColor: WidgetStateProperty.all(
style.primaryColor,
),
elevation: MaterialStateProperty.all(0),
shape: MaterialStateProperty.all(
elevation: WidgetStateProperty.all(0),
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(style.borderRadius),
),
),
side: MaterialStateBorderSide.resolveWith(
side: WidgetStateBorderSide.resolveWith(
(states) => BorderSide(color: style.outlineColor),
),
),
Expand All @@ -154,14 +154,14 @@ class _MobileLinkMenuState extends State<MobileLinkMenu> {
?.closeKeyboard();
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
backgroundColor: WidgetStateProperty.all(
style.primaryColor,
),
foregroundColor: MaterialStateProperty.all(
foregroundColor: WidgetStateProperty.all(
style.onPrimaryColor,
),
elevation: MaterialStateProperty.all(0),
shape: MaterialStateProperty.all(
elevation: WidgetStateProperty.all(0),
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(style.borderRadius),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class MobileToolbarItemMenuBtn extends StatelessWidget {
onPressed: onPressed,
style: ButtonStyle(
alignment: label == null ? Alignment.center : Alignment.centerLeft,
foregroundColor: MaterialStateProperty.all(style.foregroundColor),
foregroundColor: WidgetStateProperty.all(style.foregroundColor),
splashFactory: NoSplash.splashFactory,
side: MaterialStateProperty.resolveWith<BorderSide>(
side: WidgetStateProperty.resolveWith<BorderSide>(
(states) {
if (isSelected == true) {
return BorderSide(
Expand All @@ -35,12 +35,12 @@ class MobileToolbarItemMenuBtn extends StatelessWidget {
return BorderSide(color: style.itemOutlineColor);
},
),
shape: MaterialStateProperty.all(
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(style.borderRadius),
),
),
padding: MaterialStateProperty.all(
padding: WidgetStateProperty.all(
EdgeInsets.zero,
),
),
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ platforms:

environment:
sdk: ">=3.1.5 <4.0.0"
flutter: ">=3.13.0"
flutter: ">=3.19.0"

dependencies:
flutter:
Expand All @@ -33,7 +33,7 @@ dependencies:
sdk: flutter
flutter_svg: ^2.0.6
html: ^0.15.0
intl: ^0.18.0
intl: ^0.19.0
intl_utils: ^2.8.2
keyboard_height_plugin: ^0.0.4
logging: ^1.2.0
Expand All @@ -52,7 +52,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^3.0.1
flutter_lints: ^4.0.0
network_image_mock: ^2.1.1
mockito: ^5.4.1
leak_tracker: ^10.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void main() async {
startOffset: 0,
),
);
await simulateKeyDownEvent(LogicalKeyboardKey.enter);
await editor.pressKey(key: LogicalKeyboardKey.enter);

var selection = editor.selection!;
var cell01 = getCellNode(tableNode.node, 0, 1)!;
Expand Down Expand Up @@ -59,7 +59,7 @@ void main() async {
startOffset: 0,
),
);
await simulateKeyDownEvent(LogicalKeyboardKey.enter);
await editor.pressKey(key: LogicalKeyboardKey.enter);

var selection = editor.selection!;

Expand Down Expand Up @@ -88,7 +88,8 @@ void main() async {
startOffset: 0,
),
);
await simulateKeyDownEvent(LogicalKeyboardKey.backspace);
await editor.pressKey(key: LogicalKeyboardKey.backspace);
await tester.pumpAndSettle();

var selection = editor.selection!;

Expand Down Expand Up @@ -123,7 +124,7 @@ void main() async {
// ),
// ),
// );
// await simulateKeyDownEvent(LogicalKeyboardKey.backspace);
// await editor.pressKey(key: LogicalKeyboardKey.backspace);

// var selection = editor.selection!;

Expand Down Expand Up @@ -165,7 +166,7 @@ void main() async {
),
),
);
await simulateKeyDownEvent(LogicalKeyboardKey.backspace);
await editor.pressKey(key: LogicalKeyboardKey.backspace);

var selection = editor.selection!;

Expand Down Expand Up @@ -204,7 +205,7 @@ void main() async {
),
),
);
await simulateKeyDownEvent(LogicalKeyboardKey.backspace);
await editor.pressKey(key: LogicalKeyboardKey.backspace);

var selection = editor.selection!;

Expand Down Expand Up @@ -237,7 +238,7 @@ void main() async {
startOffset: 1,
),
);
await simulateKeyDownEvent(LogicalKeyboardKey.arrowUp);
await editor.pressKey(key: LogicalKeyboardKey.arrowUp);

var selection = editor.selection!;

Expand All @@ -251,7 +252,7 @@ void main() async {
startOffset: 3,
),
);
await simulateKeyDownEvent(LogicalKeyboardKey.arrowUp);
await editor.pressKey(key: LogicalKeyboardKey.arrowUp);

selection = editor.selection!;

Expand Down Expand Up @@ -281,7 +282,7 @@ void main() async {
startOffset: 1,
),
);
await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);
await editor.pressKey(key: LogicalKeyboardKey.arrowDown);

var selection = editor.selection!;

Expand All @@ -295,7 +296,7 @@ void main() async {
startOffset: 3,
),
);
await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);
await editor.pressKey(key: LogicalKeyboardKey.arrowDown);

selection = editor.selection!;

Expand Down Expand Up @@ -325,7 +326,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.arrowLeft);
await editor.pressKey(key: LogicalKeyboardKey.arrowLeft);

var selection = editor.selection!;

Expand All @@ -340,7 +341,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.arrowLeft);
await editor.pressKey(key: LogicalKeyboardKey.arrowLeft);

selection = editor.selection!;

Expand Down Expand Up @@ -370,7 +371,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.arrowLeft);
await editor.pressKey(key: LogicalKeyboardKey.arrowLeft);

var selection = editor.selection!;

Expand Down Expand Up @@ -400,7 +401,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.arrowRight);
await editor.pressKey(key: LogicalKeyboardKey.arrowRight);

var selection = editor.selection!;

Expand Down Expand Up @@ -432,7 +433,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.arrowRight);
await editor.pressKey(key: LogicalKeyboardKey.arrowRight);

var selection = editor.selection!;

Expand All @@ -448,7 +449,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.arrowRight);
await editor.pressKey(key: LogicalKeyboardKey.arrowRight);

selection = editor.selection!;

Expand Down Expand Up @@ -480,7 +481,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.tab);
await editor.pressKey(key: LogicalKeyboardKey.tab);

var selection = editor.selection!;

Expand All @@ -495,7 +496,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.tab);
await editor.pressKey(key: LogicalKeyboardKey.tab);

selection = editor.selection!;

Expand All @@ -511,7 +512,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.tab);
await editor.pressKey(key: LogicalKeyboardKey.tab);

selection = editor.selection!;

Expand Down Expand Up @@ -543,8 +544,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.shiftLeft);
await simulateKeyDownEvent(LogicalKeyboardKey.tab);
await editor.pressKey(key: LogicalKeyboardKey.tab, isShiftPressed: true);

var selection = editor.selection!;

Expand All @@ -559,8 +559,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.shiftLeft);
await simulateKeyDownEvent(LogicalKeyboardKey.tab);
await editor.pressKey(key: LogicalKeyboardKey.tab, isShiftPressed: true);

selection = editor.selection!;

Expand All @@ -576,8 +575,7 @@ void main() async {
),
);

await simulateKeyDownEvent(LogicalKeyboardKey.shiftLeft);
await simulateKeyDownEvent(LogicalKeyboardKey.tab);
await editor.pressKey(key: LogicalKeyboardKey.tab, isShiftPressed: true);

selection = editor.selection!;

Expand Down
2 changes: 1 addition & 1 deletion test/new/block_component/text_direction_mixin_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ void main() {
.indentPadding(node, TextDirection.ltr),
);

await simulateKeyDownEvent(LogicalKeyboardKey.backspace);
await editor.pressKey(key: LogicalKeyboardKey.backspace);
await tester.pumpAndSettle();

nestedBlock =
Expand Down
1 change: 1 addition & 0 deletions test/new/infra/testable_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ class TestableEditor {
LogicalKeyboardKey.asterisk: '*',
LogicalKeyboardKey.underscore: '_',
};

Future<void> pressKey({
String? character,
LogicalKeyboardKey? key,
Expand Down
Loading

0 comments on commit 04675ee

Please sign in to comment.