To get mediaQueryData just use following command: MediaQueryData mediaQueryData = MediaQuery. of(context); On the basis of MediaQueryData you can get now device size, orientation, screen height, screen width, blockSize in horizontal, blockSize in vertical as well as safe area in vertical and horizontal both.