1

This is where they are pointing. My screen is just showing a white screen. None of the datas are getting displayed. How to solve this problem?Please help.

Please help me to solve this problem.

2

There are 2 best solutions below

0
On

This is a typical error. I will explain the cause of your error. When you give a value to the variable like

String? s1;
//You need to give s1 a value which is not null;
String s2 = s1!; //WITH <<s1!>> YOU ARE HERE SAYING A COMPILER THAT YOU ARE SURE s1 
//IS not null. BUT IF s1 IS NULL, THEN IT SHOWS ERROR. 

SO THE SOLUTION IS TO TRACK AND MAKE SURE THAT YOU ARE GIVING A VALUE TO THAT VARIABLE BEFORE PUTTING <<!>>. You provided insufficient code to debug. So that is the general solution.

0
On

Before using viewportDimension check that it is not null. You can do that by using scrollController.position.hasViewportDimension. And make sure that your scrollController is attached to the scroll widget.