It seems like this can at times be called before it has been through layout (in particular when restoring state). Changed to first check hasSize before using size.
Reproduction steps:
Using minimal sample code included below:
In Android emulator, go to developer options and enable "Don’t keep activities"
Run app
Click on button to restorablePush second route
Use device buttons to put app in background
Use device buttons to return to the app
It will restore and encounter this error
If relevant, this was reproduced on Android 12, Flutter 3.22.0
Fixes issue https://github.com/diegoveloper/flutter_percent_indicator/issues/175
Description:
It seems like this can at times be called before it has been through layout (in particular when restoring state). Changed to first check
hasSize
before usingsize
.Reproduction steps:
Using minimal sample code included below:
If relevant, this was reproduced on Android 12, Flutter 3.22.0
Sample code: