Skip to content

Commit 015fb9d

Browse files
authored
feat: maintain for flutter 3 (#227)
* chore: ignore lockfile * build: update tool chains * build: update deps * feat: generated files ignore all lint * chore: update generated example * test: fix * chore: ensure example runnable * chore: update example deps * chore: run analyze directly * chore: update example * build: try fix windows ci * build: try fix windows
1 parent 6158197 commit 015fb9d

Some content is hidden

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

41 files changed

+116
-1933
lines changed

.github/workflows/dart-ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- uses: actions/checkout@v3
1818
- uses: subosito/flutter-action@v2
1919
with:
20-
flutter-version: '2.8.1'
20+
channel: stable
2121
- uses: dart-lang/setup-dart@v1
2222
with:
23-
sdk: '2.15.0'
23+
sdk: stable
2424

2525
- name: Set environment
2626
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
@@ -40,6 +40,8 @@ jobs:
4040
if: startsWith(matrix.os, 'windows')
4141
run: |
4242
dart pub global activate melos
43+
# FIXME: CI randomly fail
44+
melos exec -c 1 -- flutter pub get
4345
melos bootstrap
4446
4547
- name: Run tests for our dart project.
@@ -55,8 +57,6 @@ jobs:
5557
- name: Generate example
5658
run: |
5759
melos run example:command
58-
# FIXME: https://github.com/invertase/melos/issues/117
59-
dart pub global activate build_runner
6060
melos run example:build_runner
6161
6262
- name: Check for any formatting and statically analyze the code.

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
- uses: actions/checkout@v3
2626
- uses: subosito/flutter-action@v2
2727
with:
28-
flutter-version: '2.8.1'
28+
channel: stable
2929
- uses: dart-lang/setup-dart@v1
3030
with:
31-
sdk: '2.15.0'
31+
sdk: stable
3232

3333
- name: Set environment for macos and ubuntu
3434
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ android/.idea/
3232
#.vscode/
3333

3434
# Flutter/Dart/Pub related
35+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
36+
pubspec.lock
37+
pubspec_overrides.yaml
3538
**/doc/api/
3639
.dart_tool/
3740
.flutter-plugins

.tool-versions

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
dart 2.15.0
2-
flutter 2.8.1-stable
31
nodejs 16.9.0
42

example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
**/build/
2+

example/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion 30
29+
compileSdkVersion 32
3030

3131
sourceSets {
3232
main.java.srcDirs += 'src/main/kotlin'
@@ -40,7 +40,7 @@ android {
4040
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4141
applicationId "com.example.example"
4242
minSdkVersion 22
43-
targetSdkVersion 30
43+
targetSdkVersion 32
4444
versionCode flutterVersionCode.toInteger()
4545
versionName flutterVersionName
4646
}

example/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
additional functionality it is fine to subclass or reimplement
77
FlutterApplication and put your custom class here. -->
88
<application
9-
android:name="io.flutter.app.FlutterApplication"
9+
android:name="${applicationName}"
1010
android:label="example"
1111
android:icon="@mipmap/ic_launcher">
1212
<activity
1313
android:name=".MainActivity"
14+
android:exported="true"
1415
android:launchMode="singleTop"
1516
android:theme="@style/LaunchTheme"
1617
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -127,7 +127,7 @@
127127
97C146E61CF9000F007C117D /* Project object */ = {
128128
isa = PBXProject;
129129
attributes = {
130-
LastUpgradeCheck = 1020;
130+
LastUpgradeCheck = 1300;
131131
ORGANIZATIONNAME = "";
132132
TargetAttributes = {
133133
97C146ED1CF9000F007C117D = {

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@
4141
</array>
4242
<key>UIViewControllerBasedStatusBarAppearance</key>
4343
<false/>
44+
<key>CADisableMinimumFrameDurationOnPhone</key>
45+
<true/>
4446
</dict>
4547
</plist>

example/lib/freezed_sample.freezed.dart

Lines changed: 43 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,7 @@ part of 'freezed_sample.dart';
1212
T _$identity<T>(T value) => value;
1313

1414
final _privateConstructorUsedError = UnsupportedError(
15-
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
16-
17-
/// @nodoc
18-
class _$UnionTearOff {
19-
const _$UnionTearOff();
20-
21-
Data call(int value) {
22-
return Data(
23-
value,
24-
);
25-
}
26-
27-
Loading loading() {
28-
return const Loading();
29-
}
30-
31-
ErrorDetails error([String? message]) {
32-
return ErrorDetails(
33-
message,
34-
);
35-
}
36-
}
37-
38-
/// @nodoc
39-
const $Union = _$UnionTearOff();
15+
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
4016

4117
/// @nodoc
4218
mixin _$Union {
@@ -102,26 +78,26 @@ class _$UnionCopyWithImpl<$Res> implements $UnionCopyWith<$Res> {
10278
}
10379

10480
/// @nodoc
105-
abstract class $DataCopyWith<$Res> {
106-
factory $DataCopyWith(Data value, $Res Function(Data) then) =
107-
_$DataCopyWithImpl<$Res>;
81+
abstract class _$$DataCopyWith<$Res> {
82+
factory _$$DataCopyWith(_$Data value, $Res Function(_$Data) then) =
83+
__$$DataCopyWithImpl<$Res>;
10884
$Res call({int value});
10985
}
11086

11187
/// @nodoc
112-
class _$DataCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res>
113-
implements $DataCopyWith<$Res> {
114-
_$DataCopyWithImpl(Data _value, $Res Function(Data) _then)
115-
: super(_value, (v) => _then(v as Data));
88+
class __$$DataCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res>
89+
implements _$$DataCopyWith<$Res> {
90+
__$$DataCopyWithImpl(_$Data _value, $Res Function(_$Data) _then)
91+
: super(_value, (v) => _then(v as _$Data));
11692

11793
@override
118-
Data get _value => super._value as Data;
94+
_$Data get _value => super._value as _$Data;
11995

12096
@override
12197
$Res call({
12298
Object? value = freezed,
12399
}) {
124-
return _then(Data(
100+
return _then(_$Data(
125101
value == freezed
126102
? _value.value
127103
: value // ignore: cast_nullable_to_non_nullable
@@ -155,7 +131,7 @@ class _$Data with DiagnosticableTreeMixin implements Data {
155131
bool operator ==(dynamic other) {
156132
return identical(this, other) ||
157133
(other.runtimeType == runtimeType &&
158-
other is Data &&
134+
other is _$Data &&
159135
const DeepCollectionEquality().equals(other.value, value));
160136
}
161137

@@ -165,8 +141,8 @@ class _$Data with DiagnosticableTreeMixin implements Data {
165141

166142
@JsonKey(ignore: true)
167143
@override
168-
$DataCopyWith<Data> get copyWith =>
169-
_$DataCopyWithImpl<Data>(this, _$identity);
144+
_$$DataCopyWith<_$Data> get copyWith =>
145+
__$$DataCopyWithImpl<_$Data>(this, _$identity);
170146

171147
@override
172148
@optionalTypeArgs
@@ -238,27 +214,27 @@ class _$Data with DiagnosticableTreeMixin implements Data {
238214
}
239215

240216
abstract class Data implements Union {
241-
const factory Data(int value) = _$Data;
217+
const factory Data(final int value) = _$Data;
242218

243-
int get value;
219+
int get value => throw _privateConstructorUsedError;
244220
@JsonKey(ignore: true)
245-
$DataCopyWith<Data> get copyWith => throw _privateConstructorUsedError;
221+
_$$DataCopyWith<_$Data> get copyWith => throw _privateConstructorUsedError;
246222
}
247223

248224
/// @nodoc
249-
abstract class $LoadingCopyWith<$Res> {
250-
factory $LoadingCopyWith(Loading value, $Res Function(Loading) then) =
251-
_$LoadingCopyWithImpl<$Res>;
225+
abstract class _$$LoadingCopyWith<$Res> {
226+
factory _$$LoadingCopyWith(_$Loading value, $Res Function(_$Loading) then) =
227+
__$$LoadingCopyWithImpl<$Res>;
252228
}
253229

254230
/// @nodoc
255-
class _$LoadingCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res>
256-
implements $LoadingCopyWith<$Res> {
257-
_$LoadingCopyWithImpl(Loading _value, $Res Function(Loading) _then)
258-
: super(_value, (v) => _then(v as Loading));
231+
class __$$LoadingCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res>
232+
implements _$$LoadingCopyWith<$Res> {
233+
__$$LoadingCopyWithImpl(_$Loading _value, $Res Function(_$Loading) _then)
234+
: super(_value, (v) => _then(v as _$Loading));
259235

260236
@override
261-
Loading get _value => super._value as Loading;
237+
_$Loading get _value => super._value as _$Loading;
262238
}
263239

264240
/// @nodoc
@@ -274,13 +250,13 @@ class _$Loading with DiagnosticableTreeMixin implements Loading {
274250
@override
275251
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
276252
super.debugFillProperties(properties);
277-
properties..add(DiagnosticsProperty('type', 'Union.loading'));
253+
properties.add(DiagnosticsProperty('type', 'Union.loading'));
278254
}
279255

280256
@override
281257
bool operator ==(dynamic other) {
282258
return identical(this, other) ||
283-
(other.runtimeType == runtimeType && other is Loading);
259+
(other.runtimeType == runtimeType && other is _$Loading);
284260
}
285261

286262
@override
@@ -360,28 +336,28 @@ abstract class Loading implements Union {
360336
}
361337

362338
/// @nodoc
363-
abstract class $ErrorDetailsCopyWith<$Res> {
364-
factory $ErrorDetailsCopyWith(
365-
ErrorDetails value, $Res Function(ErrorDetails) then) =
366-
_$ErrorDetailsCopyWithImpl<$Res>;
339+
abstract class _$$ErrorDetailsCopyWith<$Res> {
340+
factory _$$ErrorDetailsCopyWith(
341+
_$ErrorDetails value, $Res Function(_$ErrorDetails) then) =
342+
__$$ErrorDetailsCopyWithImpl<$Res>;
367343
$Res call({String? message});
368344
}
369345

370346
/// @nodoc
371-
class _$ErrorDetailsCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res>
372-
implements $ErrorDetailsCopyWith<$Res> {
373-
_$ErrorDetailsCopyWithImpl(
374-
ErrorDetails _value, $Res Function(ErrorDetails) _then)
375-
: super(_value, (v) => _then(v as ErrorDetails));
347+
class __$$ErrorDetailsCopyWithImpl<$Res> extends _$UnionCopyWithImpl<$Res>
348+
implements _$$ErrorDetailsCopyWith<$Res> {
349+
__$$ErrorDetailsCopyWithImpl(
350+
_$ErrorDetails _value, $Res Function(_$ErrorDetails) _then)
351+
: super(_value, (v) => _then(v as _$ErrorDetails));
376352

377353
@override
378-
ErrorDetails get _value => super._value as ErrorDetails;
354+
_$ErrorDetails get _value => super._value as _$ErrorDetails;
379355

380356
@override
381357
$Res call({
382358
Object? message = freezed,
383359
}) {
384-
return _then(ErrorDetails(
360+
return _then(_$ErrorDetails(
385361
message == freezed
386362
? _value.message
387363
: message // ignore: cast_nullable_to_non_nullable
@@ -415,7 +391,7 @@ class _$ErrorDetails with DiagnosticableTreeMixin implements ErrorDetails {
415391
bool operator ==(dynamic other) {
416392
return identical(this, other) ||
417393
(other.runtimeType == runtimeType &&
418-
other is ErrorDetails &&
394+
other is _$ErrorDetails &&
419395
const DeepCollectionEquality().equals(other.message, message));
420396
}
421397

@@ -425,8 +401,8 @@ class _$ErrorDetails with DiagnosticableTreeMixin implements ErrorDetails {
425401

426402
@JsonKey(ignore: true)
427403
@override
428-
$ErrorDetailsCopyWith<ErrorDetails> get copyWith =>
429-
_$ErrorDetailsCopyWithImpl<ErrorDetails>(this, _$identity);
404+
_$$ErrorDetailsCopyWith<_$ErrorDetails> get copyWith =>
405+
__$$ErrorDetailsCopyWithImpl<_$ErrorDetails>(this, _$identity);
430406

431407
@override
432408
@optionalTypeArgs
@@ -498,10 +474,10 @@ class _$ErrorDetails with DiagnosticableTreeMixin implements ErrorDetails {
498474
}
499475

500476
abstract class ErrorDetails implements Union {
501-
const factory ErrorDetails([String? message]) = _$ErrorDetails;
477+
const factory ErrorDetails([final String? message]) = _$ErrorDetails;
502478

503-
String? get message;
479+
String? get message => throw _privateConstructorUsedError;
504480
@JsonKey(ignore: true)
505-
$ErrorDetailsCopyWith<ErrorDetails> get copyWith =>
481+
_$$ErrorDetailsCopyWith<_$ErrorDetails> get copyWith =>
506482
throw _privateConstructorUsedError;
507483
}

example/lib/gen/assets.gen.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/// FlutterGen
44
/// *****************************************************
55
6+
// ignore_for_file: type=lint
67
// ignore_for_file: directives_ordering,unnecessary_import
78

89
import 'package:flutter/widgets.dart';
@@ -201,6 +202,8 @@ class SvgGenImage {
201202
String? semanticsLabel,
202203
bool excludeFromSemantics = false,
203204
Clip clipBehavior = Clip.hardEdge,
205+
bool cacheColorFilter = false,
206+
SvgTheme? theme,
204207
}) {
205208
return SvgPicture.asset(
206209
_assetName,
@@ -219,6 +222,8 @@ class SvgGenImage {
219222
semanticsLabel: semanticsLabel,
220223
excludeFromSemantics: excludeFromSemantics,
221224
clipBehavior: clipBehavior,
225+
cacheColorFilter: cacheColorFilter,
226+
theme: theme,
222227
);
223228
}
224229

example/lib/gen/colors.gen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/// FlutterGen
44
/// *****************************************************
55
6+
// ignore_for_file: type=lint
67
// ignore_for_file: directives_ordering,unnecessary_import
78

89
import 'package:flutter/painting.dart';

example/lib/gen/fonts.gen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/// FlutterGen
44
/// *****************************************************
55
6+
// ignore_for_file: type=lint
67
// ignore_for_file: directives_ordering,unnecessary_import
78

89
class FontFamily {

example/lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter/widgets.dart';
32

43
import 'gen/assets.gen.dart';
54
import 'gen/colors.gen.dart';

0 commit comments

Comments
 (0)