0

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.

vimuth
  • 5,064
  • 33
  • 79
  • 116
Geethu
  • 1
  • Welcome! [Here's how to ask a proper "Where's the bug / Fix my code" question](//meta.stackoverflow.com/a/253788/11107541). Can you please read it and apply what you learn to improve your question? You can also read [ask] for further guidance. Can you please [edit] to convert your images of text into actual text? [See here](//meta.stackoverflow.com/a/285557/11107541) for why. See [/editing-help#code](/editing-help#code) for how to format code blocks. – starball Jan 09 '23 at 06:08
  • Please add the problem code snippet – Rahul Variya Jan 09 '23 at 06:08

2 Answers2

0

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.

Jakhongir Anasov
  • 1,207
  • 7
  • 16
0

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.

Levon Vardanyan
  • 400
  • 4
  • 16