Skip to content

Commit c206bae

Browse files
authored
[desktop_photo_search] Tighten constraints then regenerate files (#1986)
No functional changes, just cleanup. Updating the build_value build dependencies then regenerating allows us to remove the analysis excludes in the `analysis_options.yaml` files due to them now ignoring lints.
1 parent 95e4d1a commit c206bae

32 files changed

+459
-393
lines changed
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
include: package:analysis_defaults/flutter.yaml
22

3-
analyzer:
4-
exclude: [lib/src/**.g.dart]
5-
63
linter:
74
rules:
85
sort_pub_dependencies: true

desktop_photo_search/fluent_ui/lib/src/model/search.g.dart

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ class _$SearchSerializer implements StructuredSerializer<Search> {
4141

4242
final iterator = serialized.iterator;
4343
while (iterator.moveNext()) {
44-
final key = iterator.current as String;
44+
final key = iterator.current! as String;
4545
iterator.moveNext();
4646
final Object? value = iterator.current;
4747
switch (key) {
4848
case 'query':
4949
result.query = serializers.deserialize(value,
50-
specifiedType: const FullType(String)) as String;
50+
specifiedType: const FullType(String))! as String;
5151
break;
5252
case 'results':
5353
result.results.replace(serializers.deserialize(value,
@@ -69,11 +69,11 @@ class _$Search extends Search {
6969
final BuiltList<Photo> results;
7070

7171
factory _$Search([void Function(SearchBuilder)? updates]) =>
72-
(new SearchBuilder()..update(updates)).build();
72+
(new SearchBuilder()..update(updates))._build();
7373

7474
_$Search._({required this.query, required this.results}) : super._() {
75-
BuiltValueNullFieldError.checkNotNull(query, 'Search', 'query');
76-
BuiltValueNullFieldError.checkNotNull(results, 'Search', 'results');
75+
BuiltValueNullFieldError.checkNotNull(query, r'Search', 'query');
76+
BuiltValueNullFieldError.checkNotNull(results, r'Search', 'results');
7777
}
7878

7979
@override
@@ -91,12 +91,16 @@ class _$Search extends Search {
9191

9292
@override
9393
int get hashCode {
94-
return $jf($jc($jc(0, query.hashCode), results.hashCode));
94+
var _$hash = 0;
95+
_$hash = $jc(_$hash, query.hashCode);
96+
_$hash = $jc(_$hash, results.hashCode);
97+
_$hash = $jf(_$hash);
98+
return _$hash;
9599
}
96100

97101
@override
98102
String toString() {
99-
return (newBuiltValueToStringHelper('Search')
103+
return (newBuiltValueToStringHelper(r'Search')
100104
..add('query', query)
101105
..add('results', results))
102106
.toString();
@@ -139,13 +143,15 @@ class SearchBuilder implements Builder<Search, SearchBuilder> {
139143
}
140144

141145
@override
142-
_$Search build() {
146+
Search build() => _build();
147+
148+
_$Search _build() {
143149
_$Search _$result;
144150
try {
145151
_$result = _$v ??
146152
new _$Search._(
147153
query: BuiltValueNullFieldError.checkNotNull(
148-
query, 'Search', 'query'),
154+
query, r'Search', 'query'),
149155
results: results.build());
150156
} catch (_) {
151157
late String _$failedField;
@@ -154,7 +160,7 @@ class SearchBuilder implements Builder<Search, SearchBuilder> {
154160
results.build();
155161
} catch (e) {
156162
throw new BuiltValueNestedFieldError(
157-
'Search', _$failedField, e.toString());
163+
r'Search', _$failedField, e.toString());
158164
}
159165
rethrow;
160166
}
@@ -163,4 +169,4 @@ class SearchBuilder implements Builder<Search, SearchBuilder> {
163169
}
164170
}
165171

166-
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
172+
// ignore_for_file: deprecated_member_use_from_same_package,type=lint

desktop_photo_search/fluent_ui/lib/src/serializers.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ Serializers _$serializers = (new Serializers().toBuilder()
4141
() => new ListBuilder<CurrentUserCollections>()))
4242
.build();
4343

44-
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
44+
// ignore_for_file: deprecated_member_use_from_same_package,type=lint

desktop_photo_search/fluent_ui/lib/src/unsplash/api_error.g.dart

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class _$ApiErrorSerializer implements StructuredSerializer<ApiError> {
4141

4242
final iterator = serialized.iterator;
4343
while (iterator.moveNext()) {
44-
final key = iterator.current as String;
44+
final key = iterator.current! as String;
4545
iterator.moveNext();
4646
final Object? value = iterator.current;
4747
switch (key) {
@@ -63,7 +63,7 @@ class _$ApiError extends ApiError {
6363
final BuiltList<String>? errors;
6464

6565
factory _$ApiError([void Function(ApiErrorBuilder)? updates]) =>
66-
(new ApiErrorBuilder()..update(updates)).build();
66+
(new ApiErrorBuilder()..update(updates))._build();
6767

6868
_$ApiError._({this.errors}) : super._();
6969

@@ -82,12 +82,15 @@ class _$ApiError extends ApiError {
8282

8383
@override
8484
int get hashCode {
85-
return $jf($jc(0, errors.hashCode));
85+
var _$hash = 0;
86+
_$hash = $jc(_$hash, errors.hashCode);
87+
_$hash = $jf(_$hash);
88+
return _$hash;
8689
}
8790

8891
@override
8992
String toString() {
90-
return (newBuiltValueToStringHelper('ApiError')..add('errors', errors))
93+
return (newBuiltValueToStringHelper(r'ApiError')..add('errors', errors))
9194
.toString();
9295
}
9396
}
@@ -123,7 +126,9 @@ class ApiErrorBuilder implements Builder<ApiError, ApiErrorBuilder> {
123126
}
124127

125128
@override
126-
_$ApiError build() {
129+
ApiError build() => _build();
130+
131+
_$ApiError _build() {
127132
_$ApiError _$result;
128133
try {
129134
_$result = _$v ?? new _$ApiError._(errors: _errors?.build());
@@ -134,7 +139,7 @@ class ApiErrorBuilder implements Builder<ApiError, ApiErrorBuilder> {
134139
_errors?.build();
135140
} catch (e) {
136141
throw new BuiltValueNestedFieldError(
137-
'ApiError', _$failedField, e.toString());
142+
r'ApiError', _$failedField, e.toString());
138143
}
139144
rethrow;
140145
}
@@ -143,4 +148,4 @@ class ApiErrorBuilder implements Builder<ApiError, ApiErrorBuilder> {
143148
}
144149
}
145150

146-
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
151+
// ignore_for_file: deprecated_member_use_from_same_package,type=lint

desktop_photo_search/fluent_ui/lib/src/unsplash/current_user_collections.g.dart

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ class _$CurrentUserCollectionsSerializer
6464

6565
final iterator = serialized.iterator;
6666
while (iterator.moveNext()) {
67-
final key = iterator.current as String;
67+
final key = iterator.current! as String;
6868
iterator.moveNext();
6969
final Object? value = iterator.current;
7070
switch (key) {
7171
case 'id':
7272
result.id = serializers.deserialize(value,
73-
specifiedType: const FullType(int)) as int;
73+
specifiedType: const FullType(int))! as int;
7474
break;
7575
case 'title':
7676
result.title = serializers.deserialize(value,
@@ -103,12 +103,12 @@ class _$CurrentUserCollections extends CurrentUserCollections {
103103

104104
factory _$CurrentUserCollections(
105105
[void Function(CurrentUserCollectionsBuilder)? updates]) =>
106-
(new CurrentUserCollectionsBuilder()..update(updates)).build();
106+
(new CurrentUserCollectionsBuilder()..update(updates))._build();
107107

108108
_$CurrentUserCollections._(
109109
{required this.id, this.title, this.publishedAt, this.updatedAt})
110110
: super._() {
111-
BuiltValueNullFieldError.checkNotNull(id, 'CurrentUserCollections', 'id');
111+
BuiltValueNullFieldError.checkNotNull(id, r'CurrentUserCollections', 'id');
112112
}
113113

114114
@override
@@ -132,14 +132,18 @@ class _$CurrentUserCollections extends CurrentUserCollections {
132132

133133
@override
134134
int get hashCode {
135-
return $jf($jc(
136-
$jc($jc($jc(0, id.hashCode), title.hashCode), publishedAt.hashCode),
137-
updatedAt.hashCode));
135+
var _$hash = 0;
136+
_$hash = $jc(_$hash, id.hashCode);
137+
_$hash = $jc(_$hash, title.hashCode);
138+
_$hash = $jc(_$hash, publishedAt.hashCode);
139+
_$hash = $jc(_$hash, updatedAt.hashCode);
140+
_$hash = $jf(_$hash);
141+
return _$hash;
138142
}
139143

140144
@override
141145
String toString() {
142-
return (newBuiltValueToStringHelper('CurrentUserCollections')
146+
return (newBuiltValueToStringHelper(r'CurrentUserCollections')
143147
..add('id', id)
144148
..add('title', title)
145149
..add('publishedAt', publishedAt)
@@ -194,11 +198,13 @@ class CurrentUserCollectionsBuilder
194198
}
195199

196200
@override
197-
_$CurrentUserCollections build() {
201+
CurrentUserCollections build() => _build();
202+
203+
_$CurrentUserCollections _build() {
198204
final _$result = _$v ??
199205
new _$CurrentUserCollections._(
200206
id: BuiltValueNullFieldError.checkNotNull(
201-
id, 'CurrentUserCollections', 'id'),
207+
id, r'CurrentUserCollections', 'id'),
202208
title: title,
203209
publishedAt: publishedAt,
204210
updatedAt: updatedAt);
@@ -207,4 +213,4 @@ class CurrentUserCollectionsBuilder
207213
}
208214
}
209215

210-
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
216+
// ignore_for_file: deprecated_member_use_from_same_package,type=lint

desktop_photo_search/fluent_ui/lib/src/unsplash/exif.g.dart

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class _$ExifSerializer implements StructuredSerializer<Exif> {
7474

7575
final iterator = serialized.iterator;
7676
while (iterator.moveNext()) {
77-
final key = iterator.current as String;
77+
final key = iterator.current! as String;
7878
iterator.moveNext();
7979
final Object? value = iterator.current;
8080
switch (key) {
@@ -124,7 +124,7 @@ class _$Exif extends Exif {
124124
final int? iso;
125125

126126
factory _$Exif([void Function(ExifBuilder)? updates]) =>
127-
(new ExifBuilder()..update(updates)).build();
127+
(new ExifBuilder()..update(updates))._build();
128128

129129
_$Exif._(
130130
{this.make,
@@ -156,19 +156,20 @@ class _$Exif extends Exif {
156156

157157
@override
158158
int get hashCode {
159-
return $jf($jc(
160-
$jc(
161-
$jc(
162-
$jc($jc($jc(0, make.hashCode), model.hashCode),
163-
exposureTime.hashCode),
164-
aperture.hashCode),
165-
focalLength.hashCode),
166-
iso.hashCode));
159+
var _$hash = 0;
160+
_$hash = $jc(_$hash, make.hashCode);
161+
_$hash = $jc(_$hash, model.hashCode);
162+
_$hash = $jc(_$hash, exposureTime.hashCode);
163+
_$hash = $jc(_$hash, aperture.hashCode);
164+
_$hash = $jc(_$hash, focalLength.hashCode);
165+
_$hash = $jc(_$hash, iso.hashCode);
166+
_$hash = $jf(_$hash);
167+
return _$hash;
167168
}
168169

169170
@override
170171
String toString() {
171-
return (newBuiltValueToStringHelper('Exif')
172+
return (newBuiltValueToStringHelper(r'Exif')
172173
..add('make', make)
173174
..add('model', model)
174175
..add('exposureTime', exposureTime)
@@ -234,7 +235,9 @@ class ExifBuilder implements Builder<Exif, ExifBuilder> {
234235
}
235236

236237
@override
237-
_$Exif build() {
238+
Exif build() => _build();
239+
240+
_$Exif _build() {
238241
final _$result = _$v ??
239242
new _$Exif._(
240243
make: make,
@@ -248,4 +251,4 @@ class ExifBuilder implements Builder<Exif, ExifBuilder> {
248251
}
249252
}
250253

251-
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
254+
// ignore_for_file: deprecated_member_use_from_same_package,type=lint

desktop_photo_search/fluent_ui/lib/src/unsplash/links.g.dart

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class _$LinksSerializer implements StructuredSerializer<Links> {
6161

6262
final iterator = serialized.iterator;
6363
while (iterator.moveNext()) {
64-
final key = iterator.current as String;
64+
final key = iterator.current! as String;
6565
iterator.moveNext();
6666
final Object? value = iterator.current;
6767
switch (key) {
@@ -99,7 +99,7 @@ class _$Links extends Links {
9999
final String? downloadLocation;
100100

101101
factory _$Links([void Function(LinksBuilder)? updates]) =>
102-
(new LinksBuilder()..update(updates)).build();
102+
(new LinksBuilder()..update(updates))._build();
103103

104104
_$Links._({this.self, this.html, this.download, this.downloadLocation})
105105
: super._();
@@ -123,14 +123,18 @@ class _$Links extends Links {
123123

124124
@override
125125
int get hashCode {
126-
return $jf($jc(
127-
$jc($jc($jc(0, self.hashCode), html.hashCode), download.hashCode),
128-
downloadLocation.hashCode));
126+
var _$hash = 0;
127+
_$hash = $jc(_$hash, self.hashCode);
128+
_$hash = $jc(_$hash, html.hashCode);
129+
_$hash = $jc(_$hash, download.hashCode);
130+
_$hash = $jc(_$hash, downloadLocation.hashCode);
131+
_$hash = $jf(_$hash);
132+
return _$hash;
129133
}
130134

131135
@override
132136
String toString() {
133-
return (newBuiltValueToStringHelper('Links')
137+
return (newBuiltValueToStringHelper(r'Links')
134138
..add('self', self)
135139
..add('html', html)
136140
..add('download', download)
@@ -185,7 +189,9 @@ class LinksBuilder implements Builder<Links, LinksBuilder> {
185189
}
186190

187191
@override
188-
_$Links build() {
192+
Links build() => _build();
193+
194+
_$Links _build() {
189195
final _$result = _$v ??
190196
new _$Links._(
191197
self: self,
@@ -197,4 +203,4 @@ class LinksBuilder implements Builder<Links, LinksBuilder> {
197203
}
198204
}
199205

200-
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
206+
// ignore_for_file: deprecated_member_use_from_same_package,type=lint

0 commit comments

Comments
 (0)