Skip to content

Commit

Permalink
SNRGY-3221 add deactivate logic to app drawer andd fix index inconsis…
Browse files Browse the repository at this point in the history
…tencies
  • Loading branch information
zsco committed May 7, 2024
1 parent 6b3fa45 commit 86fb4c2
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 160 deletions.
1 change: 0 additions & 1 deletion lib/app_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ class AppState extends ChangeNotifier with WidgetsBindingObserver {
refreshDeviceIds.length, 0, refreshFilter, null,
forceBackend: true)
.catchError(( e) async {
_logger.e((e as Error).stackTrace);
if (!Settings.getLocalMode()) {
Toast.showToastNoContext(
"Error refreshing device status, using cache");
Expand Down
4 changes: 2 additions & 2 deletions lib/services/api_available.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ class ApiAvailableService {

ApiAvailableService._internal() {
Connectivity().onConnectivityChanged.listen((event) {
final offline = event == ConnectivityResult.none;
final offline = event.contains(ConnectivityResult.none);
if (offline != _offline) {
_offline = offline;
AppState().notifyListeners();
}
});
Timer.periodic(const Duration(seconds: 10), (timer) async {
// not all connectivity changes are recognized, checking periodically
final offline = await Connectivity().checkConnectivity() == ConnectivityResult.none;
final offline = await Connectivity().checkConnectivity().then((value) => value.contains(ConnectivityResult.none));
if (offline != _offline) {
_offline = offline;
AppState().notifyListeners();
Expand Down
2 changes: 1 addition & 1 deletion lib/services/device_commands.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class DeviceCommandsService {
try {
retryRes = await _runCommands(cloudRetries, true, "", preferEventValue);
} on DioException catch (e) {
_logger.e("Cant run cloud commands :${e.message!}");
_logger.e("Cant run cloud commands :${e.message}");
retryRes = List<DeviceCommandResponse>.generate(cloudRetries.length,
(index) => DeviceCommandResponse(502, e.toString()));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/api_available_interceptor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ApiAvailableInterceptor extends Interceptor {

factory ApiAvailableInterceptor() => _instance;

ApiAvailableInterceptor._internal() {}
ApiAvailableInterceptor._internal();


@override
Expand Down
293 changes: 145 additions & 148 deletions lib/widgets/tabs/device_tabs.dart

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/widgets/tabs/nav.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ class NavigationItem {
String name;
int index;
IconData icon;
bool disabled = false;
NavigationItem(this.name, this.index, this.icon);
}
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ packages:
dependency: "direct main"
description:
name: connectivity_plus
sha256: e9feae83b1849f61bad9f6f33ee00646e3410d54ce0821e02f262f9901dad3c9
sha256: db7a4e143dc72cc3cb2044ef9b052a7ebfe729513e6a82943bc3526f784365b8
url: "https://pub.dev"
source: hosted
version: "6.0.1"
version: "6.0.3"
connectivity_plus_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -1241,10 +1241,10 @@ packages:
dependency: "direct main"
description:
name: sidebarx
sha256: "7042d64844b8e64ca5c17e70d89b49df35b54a26c015b90000da9741eab70bc0"
sha256: abe39d6db237fb8e25c600e8039ffab80fa7fe71acab03e9c378c31f912d2766
url: "https://pub.dev"
source: hosted
version: "0.16.3"
version: "0.17.1"
sky_engine:
dependency: transitive
description: flutter
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.0.313+313
version: 0.0.314+314


environment:
Expand Down Expand Up @@ -53,7 +53,7 @@ dependencies:
mutex: ^3.1.0
openidconnect: ^1.0.28
openidconnect_platform_interface: ^1.0.15
connectivity_plus: ^6.0.1
connectivity_plus: ^6.0.3
crypto: ^3.0.2
fluttertoast: ^8.2.1
provider: ^6.0.5
Expand Down Expand Up @@ -83,7 +83,7 @@ dependencies:
arrow_path: ^3.1.0
device_info_plus: ^10.0.1
#ory_kratos_client: 1.0.0
sidebarx: ^0.16.2
sidebarx: ^0.17.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 86fb4c2

Please sign in to comment.