I have simple code as follows:

```
  class TestPage extends StatelessWidget {
  static String myString = 'abc';
  static double myDouble;

  @override
  Widget build(BuildContext context) {
    try {
      myDouble = double.parse(myString) + 5;
    } catch (e) {
      print(e);
    }
    return Scaffold(
      body: Center(
        child: Text(
          '$myDouble' ?? 'Ok',
          style: TextStyle(fontSize: 50),
        ),
      ),
    );
  }
}

```

Since `myDouble` is going to return null, I expect the `Text` widget to take in `'Ok'` and rendre the same. However, I still see null shown on the screen.

[![enter image description here](https://i.stack.imgur.com/ECfPX.png)](https://i.stack.imgur.com/ECfPX.png)

Any help as to why this is not working please. Thank you.

Additionally, I do not understand why I cannot use `try catch` block before build method as it gives error.