Relative Content

Tag Archive for flutterdartmedia-queriesdart-pub

What is the best way to declare the MediaQuery size objects in Flutter

import ‘package:flutter/material.dart’; class Home extends StatelessWidget { const Home({super.key}); @override Widget build(BuildContext context) { double screenWidth = MediaQuery.sizeOf(context).width; double screenHeight = MediaQuery.sizeOf(context).height; return SafeArea( child: Scaffold(), ); } } What is the best way to declare MediaQuery objects? That should not effect the performance of the Flutter applciation. flutter dart media-queries dart-pub