Skip to content

Commit 73a5093

Browse files
committed
updated packages and fixed linter errors
1 parent 67d8352 commit 73a5093

File tree

72 files changed

+149
-176
lines changed

Some content is hidden

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

72 files changed

+149
-176
lines changed

lib/config/routes/router.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ThingsboardAppRouter {
9393
String? state,
9494
bool? hideToolbar,
9595
bool animate = true,
96-
}) async {
96+
}) {
9797
return router.navigateTo(
9898
_navigatorKey.currentContext!,
9999
'/dashboard',

lib/core/auth/login/login_page.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import 'package:flutter/material.dart';
55
import 'package:flutter/scheduler.dart';
66
import 'package:flutter_bloc/flutter_bloc.dart';
77
import 'package:flutter_form_builder/flutter_form_builder.dart';
8-
import 'package:mobile_scanner/mobile_scanner.dart';
9-
import 'package:thingsboard_app/generated/l10n.dart';
108
import 'package:flutter_svg/flutter_svg.dart';
119
import 'package:form_builder_validators/form_builder_validators.dart';
1210
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
11+
import 'package:mobile_scanner/mobile_scanner.dart';
1312
import 'package:thingsboard_app/config/routes/router.dart';
1413
import 'package:thingsboard_app/constants/assets_path.dart';
1514
import 'package:thingsboard_app/core/auth/login/bloc/bloc.dart';
@@ -19,6 +18,7 @@ import 'package:thingsboard_app/core/auth/login/select_region/choose_region_scre
1918
import 'package:thingsboard_app/core/auth/login/select_region/model/region.dart';
2019
import 'package:thingsboard_app/core/auth/oauth2/i_oauth2_client.dart';
2120
import 'package:thingsboard_app/core/context/tb_context_widget.dart';
21+
import 'package:thingsboard_app/generated/l10n.dart';
2222
import 'package:thingsboard_app/locator.dart';
2323
import 'package:thingsboard_app/thingsboard_client.dart';
2424
import 'package:thingsboard_app/utils/services/device_info/i_device_info_service.dart';
@@ -540,7 +540,7 @@ class _LoginPageState extends TbPageState<LoginPage>
540540
Expanded(
541541
child: OutlinedButton(
542542
style: _oauth2IconButtonStyle,
543-
onPressed: () async => _onLoginWithBarcode(context),
543+
onPressed: () => _onLoginWithBarcode(context),
544544
child: SvgPicture.asset(
545545
ThingsboardImage.oauth2Logos['qr-code']!,
546546
height: 24,

lib/core/auth/login/reset_password_request_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_form_builder/flutter_form_builder.dart';
3-
import 'package:thingsboard_app/generated/l10n.dart';
43
import 'package:form_builder_validators/form_builder_validators.dart';
54
import 'package:thingsboard_app/core/auth/login/login_page_background.dart';
65
import 'package:thingsboard_app/core/context/tb_context_widget.dart';
6+
import 'package:thingsboard_app/generated/l10n.dart';
77
import 'package:thingsboard_app/widgets/tb_app_bar.dart';
88
import 'package:thingsboard_app/widgets/tb_progress_indicator.dart';
99

lib/core/auth/login/select_region/choose_region_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import 'package:flutter/material.dart';
2-
import 'package:thingsboard_app/generated/l10n.dart';
32
import 'package:thingsboard_app/config/routes/router.dart';
43
import 'package:thingsboard_app/core/auth/login/select_region/model/region.dart';
54
import 'package:thingsboard_app/core/auth/login/select_region/region_widget.dart';
65
import 'package:thingsboard_app/core/context/tb_context_widget.dart';
6+
import 'package:thingsboard_app/generated/l10n.dart';
77
import 'package:thingsboard_app/locator.dart';
88
import 'package:thingsboard_app/utils/services/endpoint/i_endpoint_service.dart';
99
import 'package:thingsboard_app/utils/ui/tb_text_styles.dart';

lib/core/auth/login/select_region/select_region_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import 'package:flutter/material.dart';
2-
import 'package:thingsboard_app/generated/l10n.dart';
32
import 'package:flutter_svg/flutter_svg.dart';
43
import 'package:thingsboard_app/config/routes/router.dart';
54
import 'package:thingsboard_app/constants/assets_path.dart';
65
import 'package:thingsboard_app/core/auth/login/select_region/model/region.dart';
76
import 'package:thingsboard_app/core/context/tb_context_widget.dart';
7+
import 'package:thingsboard_app/generated/l10n.dart';
88
import 'package:thingsboard_app/locator.dart';
99
import 'package:thingsboard_app/utils/services/endpoint/i_endpoint_service.dart';
1010
import 'package:thingsboard_app/utils/ui/tb_text_styles.dart';

lib/core/auth/login/two_factor_authentication_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import 'dart:async';
33
import 'package:collection/collection.dart';
44
import 'package:flutter/material.dart';
55
import 'package:flutter_form_builder/flutter_form_builder.dart';
6-
import 'package:thingsboard_app/generated/l10n.dart';
76
import 'package:form_builder_validators/form_builder_validators.dart';
87
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
98
import 'package:thingsboard_app/core/auth/login/login_page_background.dart';
109
import 'package:thingsboard_app/core/context/tb_context_widget.dart';
10+
import 'package:thingsboard_app/generated/l10n.dart';
1111
import 'package:thingsboard_app/thingsboard_client.dart';
1212
import 'package:thingsboard_app/widgets/tb_app_bar.dart';
1313

lib/core/auth/noauth/presentation/bloc/noauth_bloc.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NoAuthBloc extends Bloc<NoAuthEvent, NoAuthState> {
2222

2323
void _switchEndpointEventHandler() {
2424
on<SwitchToAnotherEndpointEvent>(
25-
(event, emit) async {
25+
(event, emit) {
2626
if (isClosed) {
2727
return;
2828
}
@@ -57,23 +57,23 @@ class NoAuthBloc extends Bloc<NoAuthEvent, NoAuthState> {
5757

5858
void _switchEndpointUpdatesHandler() {
5959
on<SwitchEndpointProgressUpdateEvent>(
60-
(event, emit) async {
60+
(event, emit) {
6161
emit(NoAuthWipState(currentStateMessage: event.progressMessage));
6262
},
6363
);
6464
}
6565

6666
void _switchEndpointDoneEvent() {
6767
on<SwitchEndpointDoneEvent>(
68-
(event, emit) async {
68+
(event, emit) {
6969
emit(const NoAuthDoneState());
7070
},
7171
);
7272
}
7373

7474
void _switchEndpointErrorEvent() {
7575
on<SwitchEndpointErrorEvent>(
76-
(event, emit) async {
76+
(event, emit) {
7777
emit(NoAuthErrorState(message: event.message));
7878
},
7979
);

lib/core/context/tb_context.dart

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import 'package:thingsboard_app/utils/services/layouts/i_layout_service.dart';
1919
import 'package:thingsboard_app/utils/services/local_database/i_local_database_service.dart';
2020
import 'package:thingsboard_app/utils/services/notification_service.dart';
2121
import 'package:thingsboard_app/utils/services/overlay_service/i_overlay_service.dart';
22+
import 'package:thingsboard_app/utils/utils.dart';
2223

2324
import 'package:universal_platform/universal_platform.dart';
2425

@@ -167,7 +168,7 @@ class TbContext implements PopEntry {
167168
);
168169
} catch (e) {
169170
log.error('TbContext::onUserLoaded error $e');
170-
if (!_isConnectionError(e)) {
171+
if (!Utils.isConnectionError(e)) {
171172
logout();
172173
} else {
173174
rethrow;
@@ -226,7 +227,7 @@ class TbContext implements PopEntry {
226227
} catch (e, s) {
227228
log.error('TbContext.onUserLoaded: $e', e, s);
228229

229-
if (_isConnectionError(e)) {
230+
if (Utils.isConnectionError(e)) {
230231
final res = await _overlayService.showAlertDialog(
231232
title: 'Connection error',
232233
message: 'Failed to connect to server',
@@ -292,11 +293,6 @@ class TbContext implements PopEntry {
292293
_appLinkStreamSubscription = null;
293294
}
294295

295-
bool _isConnectionError(e) {
296-
return e is ThingsboardError &&
297-
e.errorCode == ThingsBoardErrorCode.general &&
298-
e.message == 'Unable to connect';
299-
}
300296

301297
Future<void> updateRouteState() async {
302298
log.debug(

lib/core/entity/entities_base.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import 'dart:async';
22

33
import 'package:flutter/material.dart';
4-
import 'package:thingsboard_app/generated/l10n.dart';
54
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
65
import 'package:intl/intl.dart';
76
import 'package:thingsboard_app/core/context/tb_context.dart';
87
import 'package:thingsboard_app/core/context/tb_context_widget.dart';
8+
import 'package:thingsboard_app/generated/l10n.dart';
99
import 'package:thingsboard_app/locator.dart';
1010
import 'package:thingsboard_app/thingsboard_client.dart';
1111
import 'package:thingsboard_app/utils/services/overlay_service/i_overlay_service.dart';

lib/modules/alarm/alarms_list.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import 'package:flutter/material.dart';
2-
import 'package:thingsboard_app/generated/l10n.dart';
32
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
43
import 'package:thingsboard_app/core/context/tb_context.dart';
54
import 'package:thingsboard_app/core/entity/entity_list_card.dart';
5+
import 'package:thingsboard_app/generated/l10n.dart';
66
import 'package:thingsboard_app/locator.dart';
77
import 'package:thingsboard_app/modules/alarm/presentation/bloc/alarms_bloc.dart';
88
import 'package:thingsboard_app/modules/alarm/presentation/bloc/alarms_events.dart';

0 commit comments

Comments
 (0)