Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter compile error: non-null value must be returned since the return type 'String' doesn't allow null - displayString

Tags:

flutter

dart

My tests are failing to compile and run in a Dart only project that is referenced by my Flutter project. I'm receiving the following error message

Failed to precompile test:test:
../../../../../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.0.0/lib/src/error/best_practices_verifier.dart:1952:14: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
  String get displayString {

Any ideas please?

Flutter 2.2.1 (current stable channel)
Tools • Dart 2.13.1

(I've asked the question in Flutter's github here also) https://github.com/flutter/flutter/issues/83683

like image 479
atreeon Avatar asked Oct 24 '25 11:10

atreeon


1 Answers

There was a component using analyzer version 1.0.0

Upgrading this component to use analyzer version 1.7 or above seemed to fix the problem for me.

like image 199
atreeon Avatar answered Oct 27 '25 01:10

atreeon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!