double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
double height = MediaQuery.of(context).size.height;
//In logical pixels
var width = MediaQuery.of(context).size.width;
var height = MediaQuery.of(context).size.height;
var padding = MediaQuery.of(context).padding;
var safeHeight = height - padding.top - padding.bottom;
import 'package:flutter_screenutil/flutter_screenutil.dart';
MediaQuery.of(context).size.height - // total height
kToolbarHeight - // top AppBar height
MediaQuery.of(context).padding.top - // top padding
kBottomNavigationBarHeight // BottomNavigationBar height
// All height of screen
double screenHeight = MediaQuery.of(context).size.height
// height of screen only
double screenHeight = MediaQuery.of(context).size.height -
MediaQuery.of(context).padding.top -
kToolbarHeight -
kBottomNavigationBarHeight;
dependencies:
flutter:
sdk: flutter
# add flutter_ScreenUtil
flutter_screenutil: ^0.4.2