Measured-Size icon indicating copy to clipboard operation
Measured-Size copied to clipboard

Add support for Flutter 3.0 - Fix null-aware operation warning

Open mattias-lonn opened this issue 3 years ago • 1 comments

On flutter 3.0 there's is a new warning added for null-aware operation, this removes the usage of the null-aware operation.

Warning:

../flutter/.pub-cache/hosted/pub.dartlang.org/measured_size-1.0.0/lib/measured_size.dart:29:22: Warning: Operand of null-aware operation
'!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart'
 ('../../../../flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback(postFrameCallback);

mattias-lonn avatar May 27 '22 15:05 mattias-lonn

if someone else comes seeking for a temp fix for this warning you can add it to your pubspec.yaml and your project will build without this warning:

dependencies:
  measured_size:
    git:
      url: https://github.com/mattias-lonn/Measured-Size.git
      ref: main

mattias-lonn avatar May 27 '22 15:05 mattias-lonn