Running Gradle task 'assembleDebug'... ../../Documents/Android%20Studio%20Project/kotaawan/lib/feature/main/home/product/new-product.dart:37:22: Error: A non-null value must be returned since the return type 'Widget' doesn't allow null.
From these lines, it seems like you are defining a function at line 37 that supposed to return a Widget
, but instead return null
. Keep in mind that when placing a widget within a screen in Flutter, that widget must not be null.
You can catch the null
widget with a blank Container
like:
...
child: someWidget ?? Container()
...
Small note: When asking question, you should include the block of code mentioned in the error in your question (The block from line 37 in your new-product.dart
file), so that others can pinpoint the error faster.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…