My screen have total 5 device partition size:- 1.Desktop 2.Small Desktop 3.Tablet 4.Small Tablet 5.Mobile, for that purpose i tried to use layout builder but while i'm resizing the size of display it's take too much time to render the design because it's trying to rebuild the design at every breakpoints.which is not expected in web design,is there any alteranative way to acheive smooth responsiveness in flutter web.
class CommunityListScreen extends StatefulWidget {
static const String id = 'community_list_screen';
const CommunityListScreen({Key? key}) : super(key: key);
@override
State<CommunityListScreen> createState() => _CommunityListScreenState();
}
class _CommunityListScreenState extends State<CommunityListScreen> {
late double _deviceWidth;
late double _deviceHeight;
@override
Widget build(BuildContext context) {
_deviceWidth = MediaQuery.of(context).size.width - 150;
_deviceHeight = MediaQuery.of(context).size.height;
print(_deviceWidth);
return Scaffold(
backgroundColor: ColorAssets.themeColorLightGrey,
body: Container(
///responsive builder
margin: const EdgeInsets.only(top: 15.0),
child: LayoutBuilder(
builder: (context, constraint) {
///desktop size
if (constraint.maxWidth >= 1200) {
return desktop();
} else if (constraint.maxWidth >= 1000) {
return smallDesktop();
} else if (constraint.maxWidth >= 800) {
return tablet();
} else if (constraint.maxWidth >= 600) {
return smallTablet();
} else if (constraint.maxWidth >= 300) {
return mobile();
}
return Container(color: ColorAssets.themeColorLightPurple);
},
),
),
);
}
}
i found the exact issue,the time was taken by dottenline package which i used in my table format design, i removed this package and now the page rendering smoothly as per screen size.