Skip to content

Commit f3e55fc

Browse files
authored
chore: bump min flutter version to 3.32.0 (#153)
* fix: compilation * bump flutter version to 3.32.0 * change PR CI to build 3.32.0 only now * dart format for dart 3.6.0+ * address static analysis --------- Co-authored-by: Brandon Trautmann <[email protected]>
1 parent 303f4ee commit f3e55fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+804
-1163
lines changed

.fvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.16.9"
2+
"flutter": "3.32.0"
33
}

.github/workflows/check_compat.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
name: Compatibility Check
22

3+
# ignore: RiskyTriggers
34
on:
4-
schedule:
5+
schedule:
56
# Run daily at 00:00 UTC
6-
- cron: '0 0 * * *'
7-
workflow_dispatch:
7+
- cron: "0 0 * * *"
8+
workflow_dispatch:
89

910
jobs:
1011
build:
1112
runs-on: ubuntu-latest
1213
strategy:
1314
fail-fast: false
1415
matrix:
15-
channel: ['stable', 'beta']
16+
channel: ["stable", "beta"]
1617

1718
steps:
1819
- name: Set branch based on Flutter channel
1920
id: set-branch
2021
run: |
2122
if [[ "${{ matrix.channel }}" == "stable" ]]; then
22-
echo "branch=main" >> $GITHUB_OUTPUT
23+
echo "branch=main" >> "$GITHUB_OUTPUT"
2324
elif [[ "${{ matrix.channel }}" == "beta" ]]; then
24-
echo "branch=beta" >> $GITHUB_OUTPUT
25+
echo "branch=beta" >> "$GITHUB_OUTPUT"
2526
else
2627
echo "Unknown Flutter channel: ${{ matrix.channel }}"
2728
exit 1
2829
fi
2930
30-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
31+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3132
with:
3233
ref: ${{ steps.set-branch.outputs.branch }}
3334

34-
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2.16.0
35+
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2.19.0
3536
with:
3637
channel: ${{ matrix.channel }}
3738
cache: true

.github/workflows/main.yaml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1414

1515
- name: Determine Flutter version
1616
id: flutter_version
1717
run: |
1818
# Grab the Flutter version from the .fvmrc file
1919
FLUTTER_VERSION=$(grep '"flutter"' .fvmrc | grep -o '[0-9][0-9.]*')
20-
echo "flutter_version=$FLUTTER_VERSION" >> $GITHUB_OUTPUT
20+
echo "flutter_version=$FLUTTER_VERSION" >> "$GITHUB_OUTPUT"
2121
22-
- uses: subosito/flutter-action@v2
22+
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2.19.0
2323
with:
2424
flutter-version: ${{ steps.flutter_version.outputs.flutter_version }}
2525
cache: true
@@ -31,9 +31,9 @@ jobs:
3131
run: dart format --set-exit-if-changed .
3232

3333
- name: Analyze project source
34-
uses: invertase/github-action-dart-analyzer@v1
34+
uses: invertase/github-action-dart-analyzer@e981b01a458d0bab71ee5da182e5b26687b7101b # v3.0.0
3535

36-
- uses: codecov/codecov-action@v2
36+
- uses: codecov/codecov-action@c2fcb216de2b0348de0100baa3ea2cad9f100a01 # v5.1.0
3737
with:
3838
files: coverage/lcov.info
3939

@@ -42,14 +42,14 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
flutter-version: ['3.16.9', '3.19.6', '3.22.3', '3.24.3', '3.29.2']
45+
flutter-version: ["3.32.0"]
4646
steps:
47-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4848

49-
- uses: subosito/flutter-action@v2
49+
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2.19.0
5050
with:
5151
flutter-version: ${{ matrix.flutter-version }}
52-
channel: 'stable'
52+
channel: "stable"
5353
cache: true
5454

5555
- name: Install Dependencies
@@ -69,23 +69,21 @@ jobs:
6969
name: "golden_failures_${{ matrix.flutter-version }}"
7070
path: |
7171
**/failures/**/*.png
72-
73-
7472
7573
pana:
7674
runs-on: ubuntu-latest
7775

7876
steps:
79-
- uses: actions/checkout@v3
77+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8078

8179
- name: Determine Flutter version
8280
id: flutter_version
8381
run: |
8482
# Grab the Flutter version from the .fvmrc file
8583
FLUTTER_VERSION=$(grep '"flutter"' .fvmrc | grep -o '[0-9][0-9.]*')
86-
echo "flutter_version=$FLUTTER_VERSION" >> $GITHUB_OUTPUT
84+
echo "flutter_version=$FLUTTER_VERSION" >> "$GITHUB_OUTPUT"
8785
88-
- uses: subosito/flutter-action@v2
86+
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2.19.0
8987
with:
9088
flutter-version: ${{ steps.flutter_version.outputs.flutter_version }}
9189
cache: true

.github/workflows/post_merge.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1414

1515
- name: Determine Flutter version
1616
id: flutter_version
1717
run: |
1818
# Grab the Flutter version from the .fvmrc file
1919
FLUTTER_VERSION=$(grep '"flutter"' .fvmrc | grep -o '[0-9][0-9.]*')
20-
echo "flutter_version=$FLUTTER_VERSION" >> $GITHUB_OUTPUT
20+
echo "flutter_version=$FLUTTER_VERSION" >> "$GITHUB_OUTPUT"
2121
22-
- uses: subosito/flutter-action@v2
22+
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2.19.0
2323
with:
2424
flutter-version: ${{ steps.flutter_version.outputs.flutter_version }}
2525
cache: true
@@ -34,6 +34,6 @@ jobs:
3434
run: |
3535
flutter test --no-pub --coverage --test-randomize-ordering-seed=random
3636
37-
- uses: codecov/codecov-action@v2
37+
- uses: codecov/codecov-action@c2fcb216de2b0348de0100baa3ea2cad9f100a01 # v5.1.0
3838
with:
3939
files: coverage/lcov.info
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: Semantic PR
22

3+
# ignore: RiskyTriggers
34
on: [pull_request_target]
45

56
jobs:
67
validate_title:
78
runs-on: ubuntu-latest
89
steps:
910
- name: Validate PR title
10-
uses: amannn/action-semantic-pull-request@v4
11+
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
1112
env:
1213
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/update_goldens.yaml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
name: Update Goldens
2+
# ignore: RiskyTriggers
23
on:
34
workflow_dispatch:
45
inputs:
56
branch:
6-
description: 'Branch to generate goldens from'
7+
description: "Branch to generate goldens from"
78
required: true
89
flutter_version:
9-
description: 'Flutter version to use'
10+
description: "Flutter version to use"
1011
required: true
11-
default: '3.16.0'
12+
default: "3.16.0"
1213
permissions:
1314
contents: write
1415

@@ -17,15 +18,12 @@ jobs:
1718
runs-on: ubuntu-latest
1819
steps:
1920
- name: Checkout repo
20-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2122

2223
- name: Validate branch input
2324
run: |
2425
BRANCH_PATTERN="^[a-zA-Z0-9/_.-]+$"
2526
26-
# Input string (branch name) to be validated
27-
BRANCH_NAME=${{ inputs.branch}}
28-
2927
echo "Checking branch name: $BRANCH_NAME"
3028
3129
# Validate branch name against the regex pattern
@@ -36,38 +34,41 @@ jobs:
3634
echo "Branch name is invalid."
3735
exit 1
3836
fi
37+
env:
38+
BRANCH_NAME: ${{ inputs.branch }}
3939

4040
- name: Validate Flutter version input
4141
run: |
4242
VERSION_PATTERN="^[0-9]+\.[0-9]+\.[0-9]+$"
4343
44-
# Input string (branch name) to be validated
45-
VERSION_INPUT=${{ inputs.flutter_version}}
46-
47-
echo "Checking version input: $VERSION_INPUT"
44+
echo "Checking version input: $VERSION"
4845
4946
# Validate branch name against the regex pattern
50-
if [[ $VERSION_INPUT =~ $VERSION_PATTERN ]]; then
47+
if [[ $VERSION =~ $VERSION_PATTERN ]]; then
5148
echo "Version input is valid."
5249
exit 0
5350
else
5451
echo "Version input is invalid."
5552
exit 1
5653
fi
54+
env:
55+
VERSION: ${{ inputs.flutter_version }}
5756

5857
- name: Ensure branch is not main
5958
if: ${{ github.event.inputs.branch == 'main' || github.event.inputs.branch == 'origin/main'}}
6059
run: exit 1
6160

6261
- name: Checkout branch
63-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
62+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6463
with:
64+
# Branch validated above
65+
# ignore: UnsafeCheckout
6566
ref: ${{ github.event.inputs.branch }}
6667

67-
- uses: subosito/flutter-action@v2
68+
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2.19.0
6869
with:
6970
flutter-version: ${{ github.event.inputs.flutter_version }}
70-
channel: 'stable'
71+
channel: "stable"
7172
cache: true
7273

7374
- name: Disable animations

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"dart.flutterSdkPath": ".fvm/versions/3.16.9"
2+
"dart.flutterSdkPath": ".fvm/versions/3.32.0"
33
}

example/lib/widgets/red_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RedButton extends StatelessWidget {
2222
return ElevatedButton.icon(
2323
style: style,
2424
onPressed: onPressed,
25-
icon: icon!,
25+
icon: icon,
2626
label: child,
2727
);
2828
} else {

lib/src/alchemist_config.dart

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ import 'package:flutter/material.dart';
77
/// A function that returns the path of a golden test file for a given test's
88
/// [fileName]. This function's return value should include the `.png`
99
/// extension.
10-
typedef FilePathResolver = FutureOr<String> Function(
11-
String fileName,
12-
String environmentName,
13-
);
10+
typedef FilePathResolver =
11+
FutureOr<String> Function(String fileName, String environmentName);
1412

1513
/// {@template alchemist_config}
1614
/// A configuration object that contains settings used by Alchemist for
@@ -71,11 +69,11 @@ class AlchemistConfig extends Equatable {
7169
ThemeData? theme,
7270
PlatformGoldensConfig? platformGoldensConfig,
7371
CiGoldensConfig? ciGoldensConfig,
74-
}) : _forceUpdateGoldenFiles = forceUpdateGoldenFiles,
75-
_theme = theme,
76-
_goldenTestTheme = goldenTestTheme,
77-
_platformGoldensConfig = platformGoldensConfig,
78-
_ciGoldensConfig = ciGoldensConfig;
72+
}) : _forceUpdateGoldenFiles = forceUpdateGoldenFiles,
73+
_theme = theme,
74+
_goldenTestTheme = goldenTestTheme,
75+
_platformGoldensConfig = platformGoldensConfig,
76+
_ciGoldensConfig = ciGoldensConfig;
7977

8078
/// The instance of the [AlchemistConfig] in the current zone used by the
8179
/// `alchemist` package.
@@ -161,12 +159,7 @@ class AlchemistConfig extends Equatable {
161159
required AlchemistConfig config,
162160
required T Function() run,
163161
}) {
164-
return runZoned<T>(
165-
run,
166-
zoneValues: {
167-
currentConfigKey: config,
168-
},
169-
);
162+
return runZoned<T>(run, zoneValues: {currentConfigKey: config});
170163
}
171164

172165
/// Whether to force the golden tests to update the golden file.
@@ -236,20 +229,21 @@ class AlchemistConfig extends Equatable {
236229
forceUpdateGoldenFiles: other?._forceUpdateGoldenFiles,
237230
theme: other?._theme,
238231
goldenTestTheme: other?._goldenTestTheme,
239-
platformGoldensConfig:
240-
platformGoldensConfig.merge(other?._platformGoldensConfig),
232+
platformGoldensConfig: platformGoldensConfig.merge(
233+
other?._platformGoldensConfig,
234+
),
241235
ciGoldensConfig: ciGoldensConfig.merge(other?._ciGoldensConfig),
242236
);
243237
}
244238

245239
@override
246240
List<Object?> get props => [
247-
forceUpdateGoldenFiles,
248-
theme,
249-
goldenTestTheme,
250-
platformGoldensConfig,
251-
ciGoldensConfig,
252-
];
241+
forceUpdateGoldenFiles,
242+
theme,
243+
goldenTestTheme,
244+
platformGoldensConfig,
245+
ciGoldensConfig,
246+
];
253247
}
254248

255249
/// {@template goldens_config}
@@ -295,8 +289,8 @@ abstract class GoldensConfig extends Equatable {
295289
required this.renderShadows,
296290
FilePathResolver? filePathResolver,
297291
ThemeData? theme,
298-
}) : _filePathResolver = filePathResolver,
299-
_theme = theme;
292+
}) : _filePathResolver = filePathResolver,
293+
_theme = theme;
300294

301295
/// Whether or not the golden tests should run.
302296
final bool enabled;
@@ -366,12 +360,12 @@ abstract class GoldensConfig extends Equatable {
366360

367361
@override
368362
List<Object?> get props => [
369-
obscureText,
370-
enabled,
371-
filePathResolver,
372-
theme,
373-
renderShadows,
374-
];
363+
obscureText,
364+
enabled,
365+
filePathResolver,
366+
theme,
367+
renderShadows,
368+
];
375369
}
376370

377371
/// {@template platform_goldens_config}
@@ -457,10 +451,7 @@ class PlatformGoldensConfig extends GoldensConfig {
457451
}
458452

459453
@override
460-
List<Object?> get props => [
461-
...super.props,
462-
platforms,
463-
];
454+
List<Object?> get props => [...super.props, platforms];
464455
}
465456

466457
/// {@template ci_goldens_config}

0 commit comments

Comments
 (0)