You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see in the build method of ScreenTypeLayout, that we have access to the SizingInformation but are not passing it to each builder:
@override
Widget build(BuildContext context) {
return ResponsiveBuilder(
breakpoints: breakpoints,
builder: (context, sizingInformation) {
// If we're at desktop size
if (sizingInformation.deviceScreenType == DeviceScreenType.desktop) {
// If we have supplied the desktop layout then display that
if (desktop != null) return desktop!(context);
// If no desktop layout is supplied we want to check if we have the size below it and display that
if (tablet != null) return tablet!(context);
}
if (sizingInformation.deviceScreenType == DeviceScreenType.tablet) {
if (tablet != null) return tablet!(context);
}
if (sizingInformation.deviceScreenType == DeviceScreenType.watch &&
watch != null) {
return watch!(context);
}
// If none of the layouts above are supplied or we're on the mobile layout then we show the mobile layout
return mobile(context);
},
Please pass it to the passed in builders, as right now we need to add our own ResponsiveBuilder to get the SizingInformation while the build method of ScreenTypeLayout is already doing that.
P.S. You may as well do the same for RefinedLayoutBuilder.
The text was updated successfully, but these errors were encountered:
BenjiFarquhar
changed the title
Pass SizingInformation to the builders to the ScreenTypeLayout builders
Pass SizingInformation to the ScreenTypeLayout builders
Aug 6, 2022
Hi,
I see in the
build
method of ScreenTypeLayout, that we have access to theSizingInformation
but are not passing it to each builder:Please pass it to the passed in builders, as right now we need to add our own
ResponsiveBuilder
to get the SizingInformation while the build method ofScreenTypeLayout
is already doing that.P.S. You may as well do the same for
RefinedLayoutBuilder
.BTW, I've done it in a fork.
The text was updated successfully, but these errors were encountered: