-1

How can I fix the null value error. i'm using the bloc pattern. Please check the below image. Thanks in Advance.

enter image description here

Alpit Panchal
  • 709
  • 1
  • 7
  • 25

1 Answers1

2

Defining the state of your Bloc as nullable should fix your issue:

StateTime? instead of StateTime

class BlocTime extends Bloc<EventTime, StateTime?> {}
Thierry
  • 7,775
  • 2
  • 15
  • 33