scale 0.0.3

  • Readme
  • Changelog
  • Installing
  • new49

A flutter package to help you scale your design on bigger or smaller screens to achieve the same design look.

Screenshot #

iPhone 8, iPhone X Max, iPad Pro 12.9

This screenshots from my app, it's available on AppStore and PlayStore

Usage #

First of all, in your base widget setup Scale. So, if you have a design with 1280 * 720. You will pass first the context then the design size.

Scale.setup(context, Size(1280, 720));

Scale relative to height #

Now to scale a number relative to screen height

final height = Scale.scaleVertically(50);

Or, you can use the extension

final height = 50.sv;

Scale relative to width #

To scale a number relative to screen height

final height = Scale.scaleHorizontally(50);

Or, you can use the extension

final height = 50.sh;

Scale font #

The font will be scaled relative to screen width, to do that:

final fontSize = Scale.scaleFont(17);

Or, you can use the extension

final fontSize = 17.sf;

Installing #

Simply add the following line to your pubspec.yaml file:

dependencies:
  scale: any       # <-- Add this line

[0.0.1] - 06/06/2020. #

First release.

[0.0.2] - 06/06/2020. #

Add homepage and update read me.

[0.0.3] - 06/06/2020. #

Update screenshots and logo.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  scale: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:scale/scale.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
6
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

We analyzed this package on Jul 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [scale] that is in a package requiring null.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and scale.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test