Open jlin5 opened 1 year ago
Thank you for reporting with the info. This could be the null size on initial frame issue. MediaQuery return null on the initial frame which makes layouts that rely on it not work on the first frame.
Hello, has this been resolved? @jlin5 were you able to figure something out? I'm having the same problem :/
Same problem here :( Any fixes or temporary work around to address that initial null value? @jlin5 @rayliverified I really want to use this framework in my new app. Thank you 🙏🏽
@pulsafi @jesus-villalobos @rayliverified
I'm not sure what happened but the screen doesn't change suddenly anymore when I run the sample code. The breakpoint value is still null though on initial build. I noticed that in version 0.2.0, there was a conditional that would return an empty background if the screenWidth is 0.
The fix would be to add a similar conditional before InheritedResponsiveBreakpoints in the latest version.
// Initialization check. Window measurements not available until postFrameCallback.
// Return first frame with empty widget.
if (screenWidth == 0) {
return Container();
}
Thank you for looking into this @jlin5 🙏🏽 From my understanding, though, there is nothing that I can do on my end to catch this Null? Should I just add a check for if screenSize is Null? Or would we just have to wait until @rayliverified gets around to addressing this? Thanks :)
You're right, the initial frame 0 width and height issue is still present in the Flutter framework.
Let me read through the issues and see how people want to solve this. So far, the v0.2.0 solution was an empty container with a configurable color.
Solution 1: Empty container Complaints: Black, flickering. Solution 2: Empty container with configurable color
We're currently at Solution 2. I'll add Solution 2 back after doing some investigation into if it's compatible with initial loading screens / indicators.
I noticed that the breakpoint value will be null on initial build and a subsequent build update would have the breakpoint value. This would cause a sudden change on the screen which is most noticeable when using the SingleChildScrollView widget. I used an iPad (10th generation) simulator and ran Flutter's hot restart multiple times to see the screen changing size. This is happening on v1.0.0 to v1.1.1.
Print logs:
Code: