flutter_blue icon indicating copy to clipboard operation
flutter_blue copied to clipboard

Warning: Operand of null-aware operation '??'

Open JAICHANGPARK opened this issue 3 years ago • 2 comments

../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.8.0/lib/src/bluetooth_characteristic.dart:30:37: Warning: Operand of null-aware operation '??' has type 'List<int>' which excludes null.
 - 'List' is from 'dart:core'.
  List<int> get lastValue => _value.value ?? [];
                                    ^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.8.0/lib/src/bluetooth_descriptor.dart:18:37: Warning: Operand of null-aware operation '??' has type 'List<int>' which excludes null.
 - 'List' is from 'dart:core'.
  List<int> get lastValue => _value.value ?? [];
                                    ^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.8.0/lib/src/flutter_blue.dart:134:33: Warning: Operand of null-aware operation '??' has type 'List<ScanResult>' which excludes null.
 - 'List' is from 'dart:core'.
 - 'ScanResult' is from 'package:flutter_blue/flutter_blue.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.8.0/lib/flutter_blue.dart').
      final list = _scanResults.value ?? [];
                                ^

JAICHANGPARK avatar Jul 27 '21 04:07 JAICHANGPARK

../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.8.0/lib/src/bluetooth_characteristic.dart:30:37: Warning: Operand of null-aware operation '??' has type 'List<int>' which excludes null.
 - 'List' is from 'dart:core'.
  List<int> get lastValue => _value.value ?? [];
                                    ^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.8.0/lib/src/bluetooth_descriptor.dart:18:37: Warning: Operand of null-aware operation '??' has type 'List<int>' which excludes null.
 - 'List' is from 'dart:core'.
  List<int> get lastValue => _value.value ?? [];
                                    ^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.8.0/lib/src/flutter_blue.dart:134:33: Warning: Operand of null-aware operation '??' has type 'List<ScanResult>' which excludes null.
 - 'List' is from 'dart:core'.
 - 'ScanResult' is from 'package:flutter_blue/flutter_blue.dart' ('../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue-0.8.0/lib/flutter_blue.dart').
      final list = _scanResults.value ?? [];
                                ^

I also encountered the same problem. How did I solve it?

ifredom avatar Sep 26 '21 03:09 ifredom

Any news?

GPlay97 avatar Jun 18 '22 21:06 GPlay97