This package is deprecated and no longer maintained. ThingsBoard CE and PE are now a single product, and
thingsboard_pe_client has been replaced by thingsboard_client
(GitHub).
Version 5.0.0 of this package contains no code of its own: its main library only re-exports
package:thingsboard_client/thingsboard_client.dart (thingsboard_client: ^5.0.0) and is marked @Deprecated.
Code that imports it gets thingsboard_client 5.0.0, so it compiles only where it does not use the APIs changed in
5.0, and shows a deprecation diagnostic. Deep imports (package:thingsboard_pe_client/src/...) no longer resolve.
Requires Dart SDK 3.10.0 or later (Flutter 3.38 or later) and ThingsBoard 4.4.0 or later.
Main breaking changes relative to 4.4.x:
- the telemetry WebSocket API, the login models and
Authorityuse the generated built_value models, andPushNotification*is replaced byNotification; - 68 enum constants in 19 enums are renamed (
EntityType.oAUTH2CLIENT→OAUTH2_CLIENT, ...), andFontWeightandFontStyleare renamed toTbFontWeightandTbFontStyle; - corrected types:
claimDevice,getPersistedRpcByDeviceandexportIntegrationPackagereturn typed results,assignAlarmandunassignAlarmreturnAlarmInfo, andpageSize/pageareintin 28 operations; - 21 response fields that the server can send as
nullare nullable; - the
providerof the AI chat model configs is theAiProviderenum instead of aString; DeviceApiControllerApiandSolutionControllerApiare removed.
The full guide is Migrating from thingsboard_pe_client 4.4.x.
-
In
pubspec.yaml, replace the dependency:dependencies: thingsboard_client: ^5.0.0 # was: thingsboard_pe_client: ^4.x
-
Rewrite the imports:
grep -rl "package:thingsboard_pe_client/" lib test 2>/dev/null | while read -r f; do perl -pi -e 's#package:thingsboard_pe_client/thingsboard_pe_client\.dart#package:thingsboard_client/thingsboard_client.dart#g; s#package:thingsboard_pe_client/#package:thingsboard_client/#g' "$f" done
The command works on Linux and macOS (
perlis preinstalled on both); on Windows, run it in WSL or Git Bash. It also renamespackage:thingsboard_pe_client/thingsboard_client.dart, the old main library of 4.2.x and earlier, and rewrites deep imports (package:thingsboard_pe_client/src/...) to the same paths inthingsboard_client. Prefer the main librarypackage:thingsboard_client/thingsboard_client.dart:src/is not public API, and some 4.4.x files no longer exist. -
Fetch dependencies and check the result:
flutter pub get && flutter analyze
Please file issues at the thingsboard_client issue tracker.