proxy_layout 2.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 69

proxy_layout #

pub package

Package to select layout per orientation or device size like mobile vs tablet layouts or portrait vs landscape

Usage #

You have two widgets at your disposal, DeviceProxy to use different widget for mobile and tablet devices, OrientationProxy to use different device depending of the device orientation.

DeviceProxy #

DeviceProxy(
        mobile: (context) => Text('Mobile widget'),
        tablet: (context) => Text('Tablet widget'),
      ),

The threshold to separate Mobile and Tablet devices is 600, you can override it by setting the threshold attribute.

If you don't want to specify mobile and tablet you can use builder attribute that will let you know if you are on tablet or mobile with DeviceProxyType enum.

The is isMobile and isTablet static methods available if you need to know at some point the device type to tweak some attributes.

OrientationProxy #

OrientationProxy(
          landscape: (context) => Text('Landscape widget'),
          portrait: (context) => Text('Portrait widget'),
        ),

If you don't want to specify portrait and landscape you can use builder attribute that will let you know which orientation you are with DeviceOrientationType enum.

The is isPortrait and isLandscape static methods available if you need to know at some point the orientation to just tweak some attributes.

[2.0.0] - 06/06/2019.

  • change interfaces to use builders.
  • add builder that receive enums.
  • add static helpers methods .

[1.0.0] - 19/02/2019.

  • initial release.

example/README.md

example #

A new Flutter application.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  proxy_layout: ^2.0.0

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:proxy_layout/proxy_layout.dart';
  
Version Uploaded Documentation Archive
2.0.0 May 6, 2019 Go to the documentation of proxy_layout 2.0.0 Download proxy_layout 2.0.0 archive
1.0.0 Feb 19, 2019 Go to the documentation of proxy_layout 1.0.0 Download proxy_layout 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
40
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Jun 26, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/proxy_layout.dart.

Run flutter format to format lib/proxy_layout.dart.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test