device_screen_size 0.0.2 copy "device_screen_size: ^0.0.2" to clipboard
device_screen_size: ^0.0.2 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: DeviceScreenSize.screenHeightInPercentage(context,
                  percentage: 0.8),
                width: DeviceScreenSize.screenWidthInPercentage(context,
                  percentage: 1),
                child: Image.asset(
                myimage,
                fit: BoxFit.fill,
            ),
        ),  
      ),  
    );  
  }  
}

6
likes
130
pub points
68%
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