device_screen_size 0.0.1 copy "device_screen_size: ^0.0.1" to clipboard
device_screen_size: ^0.0.1 copied to clipboard

A Flutter package for responsive screen height and width

Device Screen Size #

Device Screen Size package helps you to get your screen height and width in percentage.

Installation #

  1. Add the latest version of package to your pubspec.yaml (and rundart pub get):
dependencies:
  device_screen_size: ^0.0.1
  1. Import the package and use it in your Flutter App.
import 'package:device_screen_size/device_screen_size.dart';

Example #

Here is a simple example to use it in your code

class HomePage extends StatelessWidget {  
  const HomePage({Key? key}) : super(key: key);  
  
  @override  
  Widget build(BuildContext context) {  
    return Scaffold(  
      body: Center(  
        child: Container(
                alignment: Alignment.center,
                height:screenHeightPercentage(context, percentage: 0.08),
                width: screenWidthPercentage(context, percentage: 0.44),
                child: Image.asset(
                myimage,
                fit: BoxFit.fill,
            ),
        ),  
      ),  
    );  
  }  
}

6
likes
140
pub points
66%
popularity

Publisher

unverified uploader

A Flutter package for responsive screen height and width

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on device_screen_size