I am getting this error in my multivendor applicaiton. When i add a new Product in the application. It goes to unpublished section and then you have to publish it from there. When i add a single product there is no problem ( I guess becuase it didnt happen with a single product.) But when i add the second product and go to unpublished page i get this error. ”’
The following assertion was thrown building StreamBuilder<QuerySnapshot>(dirty, state: _StreamBuilderBaseState<QuerySnapshot, AsyncSnapshot<QuerySnapshot>>#c1af9): A non-null String must be provided to a Text widget. 'package:flutter/src/widgets/text.dart': Failed assertion: line 378 pos 10: 'data != null' The relevant error-causing widget was: StreamBuilder<QuerySnapshot> file:///I:/AAAAAAYy/Vendor1/grocery_vendor_app/lib/widgets/unpublished_products.dart:11:14 When the exception was thrown, this was the stack: #2 new Text (package:flutter/src/widgets/text.dart:378:10) #3 UnPublishedProducts._productDetails.<anonymous closure> (package:grocery_vendor_app/widgets/unpublished_products.dart:66:30) #4 MappedListIterable.elementAt (dart:_internal/iterable.dart:411:31) #5 ListIterator.moveNext (dart:_internal/iterable.dart:340:26) #6 new _GrowableList._ofEfficientLengthIterable (dart:core- patch/growable_array.dart:188:27) #7 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28) #8 new List.of (dart:core-patch/array_patch.dart:50:28) #9 ListIterable.toList (dart:_internal/iterable.dart:211:44) #10 UnPublishedProducts._productDetails (package:grocery_vendor_app/widgets/unpublished_products.dart:110:8) #11 UnPublishedProducts.build.<anonymous closure> (package:grocery_vendor_app/widgets/unpublished_products.dart:43:23) #12 StreamBuilder.build (package:flutter/src/widgets/async.dart:545:81) #13 _StreamBuilderBaseState.build (package:flutter/src/widgets/async.dart:124:48) #14 StatefulElement.build (package:flutter/src/widgets/framework.dart:4612:27) #15 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15) #16 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4667:11) #17 Element.rebuild (package:flutter/src/widgets/framework.dart:4189:5) #18 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2694:33) #19 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:873:21) #20 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:319:5) #21 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15) #22 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082:9) #23 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998:5) #27 _invoke (dart:ui/hooks.dart:161:10) #28 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:253:5) #29 _drawFrame (dart:ui/hooks.dart:120:31) (elided 5 frames from class _AssertionError and dart:async)
”’
Anonymous Asked question May 13, 2021
Recent Comments