Scale Size

pub package

A Flutter package helps applications design differently from GUI guides, even on devices with different resolutions.

Usage

To use this plugin, add scale_size as a dependency in your pubspec.yaml file.

Example

// Import package
import 'package:scale_size/scale_size.dart';

// Instantiate it in build function of first screen (ex: Splash screen)
class SplashScreen extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    // designWidth is size of width in GUI design (ex: figma, zeplin, ...)
    ScaleSize.init(context, designWidth: 360);
    return Scaffold(...);
  }
}

// Access size with init designWidth
ScaleSize.get(10);
// Access size with current designWidth
ScaleSize.get(10, designWidth: 360);

// Available size after init
ScaleSize.statusBarHeight;
ScaleSize.navigationBarHeight;
ScaleSize.screenWidth;
ScaleSize.screenHeight};

Libraries

scale_size