Home > Blockchain >  How i solve this?
How i solve this?

Time:06-15

The body might complete normally, causing 'null' to be returned, but the return type, 'FutureOr', is a potentially non-nullable type. Try adding either a return or a throw statement at the end.

CodePudding user response:

this is because the function missed a return type.

 Future<bool> func1() {
  // you logic
  return true <-- // return bool value should be specified here
 }

if you want the function without return type

 Future<void> func2() {
   // you logic
     <-- //there will not be return type here 
 }
  • Related