Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/generated/intl/messages_all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'package:intl/src/intl_helpers.dart';

import 'messages_ar.dart' as messages_ar;
import 'messages_en.dart' as messages_en;
import 'messages_vi.dart' as messages_vi;
import 'messages_zh.dart' as messages_zh;
import 'messages_zh_CN.dart' as messages_zh_cn;
import 'messages_zh_TW.dart' as messages_zh_tw;
Expand All @@ -26,6 +27,7 @@ typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'ar': () => new SynchronousFuture(null),
'en': () => new SynchronousFuture(null),
'vi': () => new SynchronousFuture(null),
'zh': () => new SynchronousFuture(null),
'zh_CN': () => new SynchronousFuture(null),
'zh_TW': () => new SynchronousFuture(null),
Expand All @@ -37,6 +39,8 @@ MessageLookupByLibrary? _findExact(String localeName) {
return messages_ar.messages;
case 'en':
return messages_en.messages;
case 'vi':
return messages_vi.messages;
case 'zh':
return messages_zh.messages;
case 'zh_CN':
Expand Down
1 change: 1 addition & 0 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

358 changes: 358 additions & 0 deletions lib/l10n/intl_vi.arb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:thingsboard_app/modules/device/provisioning/models/provisioning_
import 'package:thingsboard_app/utils/services/communication/events/device_provisioning_status_changed_event.dart';
import 'package:thingsboard_app/utils/services/communication/i_communication_service.dart';
import 'package:thingsboard_app/utils/services/provisioning/eps_ble/i_wifi_provisioning_service.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';

class EspBleProvisioningBloc
extends Bloc<EspBleProvisioningEvent, EspBleProvisioningState> {
Expand Down Expand Up @@ -98,6 +99,19 @@ class EspBleProvisioningBloc
}
}

// Check if Bluetooth is available and enabled
if (await FlutterBluePlus.isSupported == false) {
return;
}
if (await FlutterBluePlus.adapterState.first != BluetoothAdapterState.on) {
// Attempt to enable Bluetooth
try {
await FlutterBluePlus.turnOn();
} catch (e) {
return;
}
}

try {
// This workaround because otherwise the library don't start connection to device.
await bleProvisioningService.scanBleDevices('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ class DeviceProvisioningAction extends MobileAction {
EspProvisioningRoute.wifiRoute,
routeSettings: RouteSettings(arguments: arguments),
);
break;

case 'softap':
provisioningResult =
await getIt<ThingsboardAppRouter>().navigateTo(
EspProvisioningRoute.softApRoute,
routeSettings: RouteSettings(arguments: arguments),
);
break;
}

if (provisioningResult == true) {
Expand Down
64 changes: 64 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "9.1.7"
bluez:
dependency: transitive
description:
name: bluez
sha256: "61a7204381925896a374301498f2f5399e59827c6498ae1e924aaa598751b545"
url: "https://pub.dev"
source: hosted
version: "0.8.3"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -671,6 +679,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "8.1.6"
flutter_blue_plus:
dependency: "direct main"
description:
name: flutter_blue_plus
sha256: "69a8c87c11fc792e8cf0f997d275484fbdb5143ac9f0ac4d424429700cb4e0ed"
url: "https://pub.dev"
source: hosted
version: "1.36.8"
flutter_blue_plus_android:
dependency: transitive
description:
name: flutter_blue_plus_android
sha256: "6f7fe7e69659c30af164a53730707edc16aa4d959e4c208f547b893d940f853d"
url: "https://pub.dev"
source: hosted
version: "7.0.4"
flutter_blue_plus_darwin:
dependency: transitive
description:
name: flutter_blue_plus_darwin
sha256: "682982862c1d964f4d54a3fb5fccc9e59a066422b93b7e22079aeecd9c0d38f8"
url: "https://pub.dev"
source: hosted
version: "7.0.3"
flutter_blue_plus_linux:
dependency: transitive
description:
name: flutter_blue_plus_linux
sha256: "56b0c45edd0a2eec8f85bd97a26ac3cd09447e10d0094fed55587bf0592e3347"
url: "https://pub.dev"
source: hosted
version: "7.0.3"
flutter_blue_plus_platform_interface:
dependency: transitive
description:
name: flutter_blue_plus_platform_interface
sha256: "84fbd180c50a40c92482f273a92069960805ce324e3673ad29c41d2faaa7c5c2"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
flutter_blue_plus_web:
dependency: transitive
description:
name: flutter_blue_plus_web
sha256: a1aceee753d171d24c0e0cdadb37895b5e9124862721f25f60bb758e20b72c99
url: "https://pub.dev"
source: hosted
version: "7.0.2"
flutter_cache_manager:
dependency: transitive
description:
Expand Down Expand Up @@ -1302,6 +1358,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.19.0"
intl_utils:
dependency: "direct dev"
description:
name: intl_utils
sha256: da67ac187b521445d745f7c68e7254c2090f6c3c9081c93cd515480af9e59569
url: "https://pub.dev"
source: hosted
version: "2.8.11"
io:
dependency: transitive
description:
Expand Down
3 changes: 3 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ dependencies:
freezed_annotation: ^3.1.0
json_annotation: ^4.9.0
mobile_scanner: ^7.0.1
flutter_blue_plus: ^1.32.8
flutter_hooks: ^0.21.2
esp_provisioning_softap:
git:
Expand All @@ -96,13 +97,15 @@ dev_dependencies:
json_serializable: ^6.9.5
freezed: ^3.1.0
flutter_gen: ^5.11.0
intl_utils: ^2.8.11
dependency_overrides:
logger: ^2.5.0
http: ^1.3.0
wakelock_plus: ^1.3.2

flutter:
uses-material-design: true
generate: true
assets:
- assets/images/

Expand Down