Skip to content

Commit 22f4ba2

Browse files
chore(deps): bump flutter_lints from 1.0.4 to 2.0.1 (#88)
* chore(deps): bump flutter_lints from 1.0.4 to 2.0.1 Bumps [flutter_lints](https://github.com/flutter/packages/tree/main/packages) from 1.0.4 to 2.0.1. - [Release notes](https://github.com/flutter/packages/releases) - [Commits](https://github.com/flutter/packages/commits/flutter_lints-v2.0.1/packages) --- updated-dependencies: - dependency-name: flutter_lints dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * refactor: tweaked linting errors * chore: added DI files to analysis exclude list Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Johnny Sørensen <[email protected]>
1 parent 5bd92e5 commit 22f4ba2

File tree

11 files changed

+55
-56
lines changed

11 files changed

+55
-56
lines changed

analysis_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ analyzer:
7777
# Ignore invalid annotations since freezed annotation and json serializable required it
7878
invalid_annotation_target: ignore
7979
exclude:
80+
# ignore DI
81+
- "**/injector.config.dart"
82+
- "**/generated_plugin_registrant.dart"
8083
# Ignore warnings in files from json_serializable, built_value and most generators
8184
- "**/*.g.dart"
8285
# Ignore warnings in files generated by Freezed specifically.

lib/data/services/http_client/dio_http_client.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import 'package:injectable/injectable.dart';
77
88
@Injectable(as: HttpClient)
99
class DioHttpClient extends HttpClient {
10-
DioHttpClient(this._dio);
10+
DioHttpClient(this.dio);
1111

12-
final Dio _dio;
12+
final Dio dio;
1313

1414
@override
15-
Map<String, dynamic> get headers => _dio.options.headers;
15+
Map<String, dynamic> get headers => dio.options.headers;
1616

17-
Interceptors get interceptors => _dio.interceptors;
17+
Interceptors get interceptors => dio.interceptors;
1818

1919
/// Invoke the get method in the provided [Dio] instance.
2020
///
@@ -31,14 +31,14 @@ class DioHttpClient extends HttpClient {
3131
CancelToken? cancelToken,
3232
ProgressCallback? onReceiveProgress,
3333
}) async {
34-
final _options = (options ?? Options()).copyWith(
34+
final optionsFallback = (options ?? Options()).copyWith(
3535
headers: headers,
3636
);
3737

3838
try {
39-
final response = await _dio.get<T>(
39+
final response = await dio.get<T>(
4040
path,
41-
options: _options,
41+
options: optionsFallback,
4242
cancelToken: cancelToken,
4343
queryParameters: queryParameters,
4444
onReceiveProgress: onReceiveProgress,
@@ -66,7 +66,7 @@ class DioHttpClient extends HttpClient {
6666
ProgressCallback? onReceiveProgress,
6767
}) async {
6868
try {
69-
final response = await _dio.post<T>(
69+
final response = await dio.post<T>(
7070
path,
7171
data: data,
7272
options: options,
@@ -98,7 +98,7 @@ class DioHttpClient extends HttpClient {
9898
ProgressCallback? onReceiveProgress,
9999
}) async {
100100
try {
101-
final response = await _dio.put<T>(
101+
final response = await dio.put<T>(
102102
path,
103103
data: data,
104104
options: options,
@@ -116,7 +116,7 @@ class DioHttpClient extends HttpClient {
116116

117117
Future<Response<T>> fetch<T>(RequestOptions options) async {
118118
try {
119-
return _dio.fetch<T>(options);
119+
return dio.fetch<T>(options);
120120
} catch (e) {
121121
throw ResponseError.from(e);
122122
}

lib/data/services/response_error.dart

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,27 +85,25 @@ class ResponseError<T> with _$ResponseError<T> implements Exception {
8585

8686
extension ResponseErrorExtensions on ResponseError {
8787
String getErrorMessage(Localization l10n) {
88-
final _localization = l10n.error;
89-
9088
//TODO: create error module for errors and set value accordingly
9189
return when<String>(
92-
noInternetConnection: () => _localization.connectionError,
93-
sendTimeout: () => _localization.authenticationError,
94-
connectTimeout: () => _localization.authenticationError,
95-
receiveTimeout: () => _localization.authenticationError,
90+
noInternetConnection: () => l10n.error.connectionError,
91+
sendTimeout: () => l10n.error.authenticationError,
92+
connectTimeout: () => l10n.error.authenticationError,
93+
receiveTimeout: () => l10n.error.authenticationError,
9694
badRequest: (message) => message.getErrorMessage(l10n),
97-
notFound: () => _localization.authenticationError,
98-
tooManyRequests: () => _localization.authenticationError,
99-
unprocessableEntity: () => _localization.authenticationError,
100-
internalServerError: () => _localization.authenticationError,
101-
unexpectedError: () => _localization.authenticationError,
102-
requestCancelled: () => _localization.authenticationError,
103-
conflict: () => _localization.authenticationError,
104-
unauthorized: () => _localization.authenticationError,
105-
invalidPassword: () => _localization.authenticationError,
106-
invalidEmail: () => _localization.authenticationError,
107-
invalidSearhTerm: () => _localization.authenticationError,
108-
invalidLoginCredentials: () => _localization.authenticationError,
95+
notFound: () => l10n.error.authenticationError,
96+
tooManyRequests: () => l10n.error.authenticationError,
97+
unprocessableEntity: () => l10n.error.authenticationError,
98+
internalServerError: () => l10n.error.authenticationError,
99+
unexpectedError: () => l10n.error.authenticationError,
100+
requestCancelled: () => l10n.error.authenticationError,
101+
conflict: () => l10n.error.authenticationError,
102+
unauthorized: () => l10n.error.authenticationError,
103+
invalidPassword: () => l10n.error.authenticationError,
104+
invalidEmail: () => l10n.error.authenticationError,
105+
invalidSearhTerm: () => l10n.error.authenticationError,
106+
invalidLoginCredentials: () => l10n.error.authenticationError,
109107
);
110108
}
111109
}

lib/data/services/response_objects/error_response.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ extension ErrorResponseExtensions on ErrorResponse {
5454

5555
extension ErrorNameExtensions on ErrorName {
5656
String getErrorMessage(Localization l10n) {
57-
final _localization = l10n.error;
58-
5957
switch (this) {
6058
//Handle error enum and return mapped nstack vlaue
6159
case ErrorName.errorExample:
62-
return _localization.authenticationError;
60+
return l10n.error.authenticationError;
6361
default:
6462
return '';
6563
}

lib/extensions/future_extensions.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ extension FutureExtensions<T> on Future<T> {
99
debugPrint(s.toString());
1010
}
1111

12-
final _error = ResponseError.from(e);
12+
final error = ResponseError.from(e);
1313

14-
onError.call(_error, s);
14+
onError.call(error, s);
1515
});
1616
}
1717
}

lib/presentation/app.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class App extends StatelessWidget {
1010

1111
@override
1212
Widget build(BuildContext context) {
13-
final _appRouter = injector.get<AppRouter>();
13+
final appRouter = injector.get<AppRouter>();
1414
return MaterialApp.router(
1515
debugShowCheckedModeBanner: false,
1616
theme: getAppTheme(Brightness.light),
@@ -24,9 +24,9 @@ class App extends StatelessWidget {
2424
);
2525
},
2626
routerDelegate: AutoRouterDelegate(
27-
_appRouter,
27+
appRouter,
2828
),
29-
routeInformationParser: _appRouter.defaultRouteParser(),
29+
routeInformationParser: appRouter.defaultRouteParser(),
3030
);
3131
}
3232
}

lib/presentation/feature/home/home_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class HomeScreen extends StatefulWidget {
1313
final HomeScreenTab tab;
1414

1515
@override
16-
_HomeScreenState createState() => _HomeScreenState();
16+
State<HomeScreen> createState() => _HomeScreenState();
1717
}
1818

1919
class _HomeScreenState extends State<HomeScreen> {

lib/presentation/feature/profile/profile_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ProfilePage extends StatefulWidget {
99
const ProfilePage({Key? key}) : super(key: key);
1010

1111
@override
12-
_ProfilePageState createState() => _ProfilePageState();
12+
State<ProfilePage> createState() => _ProfilePageState();
1313
}
1414

1515
class _ProfilePageState extends State<ProfilePage> {
@@ -30,7 +30,7 @@ class _ProfilePageState extends State<ProfilePage> {
3030
title: BlocBuilder<ProfileCubit, ProfileState>(
3131
bloc: _profilePresenter,
3232
builder: (context, state) {
33-
return Text(state.isLoading ? 'Profile' : 'Profile: ' + state.name);
33+
return Text(state.isLoading ? 'Profile' : 'Profile: ${state.name}');
3434
},
3535
),
3636
),

lib/presentation/feature/splash/splash_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class SplashScreen extends StatefulWidget {
99
const SplashScreen({Key? key}) : super(key: key);
1010

1111
@override
12-
_SplashScreenState createState() => _SplashScreenState();
12+
State<SplashScreen> createState() => _SplashScreenState();
1313
}
1414

1515
class _SplashScreenState extends State<SplashScreen> {

pubspec.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ packages:
2828
name: async
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "2.8.2"
31+
version: "2.9.0"
3232
auth_header:
3333
dependency: transitive
3434
description:
@@ -126,7 +126,7 @@ packages:
126126
name: characters
127127
url: "https://pub.dartlang.org"
128128
source: hosted
129-
version: "1.2.0"
129+
version: "1.2.1"
130130
charcode:
131131
dependency: transitive
132132
description:
@@ -147,7 +147,7 @@ packages:
147147
name: clock
148148
url: "https://pub.dartlang.org"
149149
source: hosted
150-
version: "1.1.0"
150+
version: "1.1.1"
151151
code_builder:
152152
dependency: transitive
153153
description:
@@ -252,7 +252,7 @@ packages:
252252
name: fake_async
253253
url: "https://pub.dartlang.org"
254254
source: hosted
255-
version: "1.3.0"
255+
version: "1.3.1"
256256
ffi:
257257
dependency: transitive
258258
description:
@@ -292,7 +292,7 @@ packages:
292292
name: flutter_lints
293293
url: "https://pub.dartlang.org"
294294
source: hosted
295-
version: "1.0.4"
295+
version: "2.0.1"
296296
flutter_svg:
297297
dependency: "direct main"
298298
description:
@@ -435,7 +435,7 @@ packages:
435435
name: lints
436436
url: "https://pub.dartlang.org"
437437
source: hosted
438-
version: "1.0.1"
438+
version: "2.0.1"
439439
logging:
440440
dependency: transitive
441441
description:
@@ -449,21 +449,21 @@ packages:
449449
name: matcher
450450
url: "https://pub.dartlang.org"
451451
source: hosted
452-
version: "0.12.11"
452+
version: "0.12.12"
453453
material_color_utilities:
454454
dependency: transitive
455455
description:
456456
name: material_color_utilities
457457
url: "https://pub.dartlang.org"
458458
source: hosted
459-
version: "0.1.4"
459+
version: "0.1.5"
460460
meta:
461461
dependency: transitive
462462
description:
463463
name: meta
464464
url: "https://pub.dartlang.org"
465465
source: hosted
466-
version: "1.7.0"
466+
version: "1.8.0"
467467
mime:
468468
dependency: transitive
469469
description:
@@ -549,7 +549,7 @@ packages:
549549
name: path
550550
url: "https://pub.dartlang.org"
551551
source: hosted
552-
version: "1.8.1"
552+
version: "1.8.2"
553553
path_drawing:
554554
dependency: transitive
555555
description:
@@ -743,7 +743,7 @@ packages:
743743
name: source_span
744744
url: "https://pub.dartlang.org"
745745
source: hosted
746-
version: "1.8.2"
746+
version: "1.9.0"
747747
stack_trace:
748748
dependency: transitive
749749
description:
@@ -771,21 +771,21 @@ packages:
771771
name: string_scanner
772772
url: "https://pub.dartlang.org"
773773
source: hosted
774-
version: "1.1.0"
774+
version: "1.1.1"
775775
term_glyph:
776776
dependency: transitive
777777
description:
778778
name: term_glyph
779779
url: "https://pub.dartlang.org"
780780
source: hosted
781-
version: "1.2.0"
781+
version: "1.2.1"
782782
test_api:
783783
dependency: transitive
784784
description:
785785
name: test_api
786786
url: "https://pub.dartlang.org"
787787
source: hosted
788-
version: "0.4.9"
788+
version: "0.4.12"
789789
timing:
790790
dependency: transitive
791791
description:
@@ -871,5 +871,5 @@ packages:
871871
source: hosted
872872
version: "3.1.0"
873873
sdks:
874-
dart: ">=2.17.0-0 <3.0.0"
874+
dart: ">=2.17.0 <3.0.0"
875875
flutter: ">=2.8.0"

0 commit comments

Comments
 (0)