diff --git a/lib/features/common/packages/bluetooth/blueberry_ring/utils/blueberry_commands_utils.dart b/lib/features/common/packages/bluetooth/blueberry_ring/utils/blueberry_commands_utils.dart index 5f079853..79c5a1a2 100644 --- a/lib/features/common/packages/bluetooth/blueberry_ring/utils/blueberry_commands_utils.dart +++ b/lib/features/common/packages/bluetooth/blueberry_ring/utils/blueberry_commands_utils.dart @@ -24,7 +24,8 @@ class BlueberryCommandsUtils { static List> splitArrayByLength(List arr, int length) { List> result = []; for (int i = 0; i < arr.length; i += length) { - result.add(arr.sublist(i, i + length)); + int end = (i + length < arr.length) ? i + length : arr.length; + result.add(arr.sublist(i, end)); } return result; }