transformable 1.1.3

Transformable #


A 2D Scrollable and Scalable Flutter Widget.

Example #

This example app is included in the package (/example/lib/main.dart).

  builder: (context, constraints) => Transformable(
    child: Grid(),
    viewerSize: viewerSize,
    controller: TransformController(
      config: TransformConfig(
        initialTransform: Transformation(offset: startOffset),
        initialSize: childStartSize,
        innerBoundRect: innerRect,
        outerBoundRect: outerRect,

Usage #

Wrap your desired widget in the Transformable widget, and specify the size of the child and the size of the view. To use the maximum available view, wrap this in a LayoutBuilder and use constraints.biggest as the size.

  child: Grid(),
  size: Size(100, 100)

Restrict the allowed area that the child can be moved to by specifying an inner and/or outer boundary rectangle. The inner rectangle is useful in situations like a photo viewer, where you want to make sure the child fills the a given area at all times. The outer rectangle is useful anytime you want to keep the child within a given area.

Details #

The outerBoundRect restricts the child's size to the size of the view, and restricts the child's position such that no part of the child can be out of the view. The innerBoundRect restricts the child's size to at least the size of the innerBoundRect, and restricts the child's position such that the child will completely cover innerBoundRect at all times.

1.1.3 #

  • Bug fixes
    • Min/max scale values were being ignored in some cases.

1.1.2 #

  • Bug fixes
    • Initial transformation now optional as expected.

1.1.1 #

  • Bug fixes (removes old dev code).

1.1.0 #

  • Removed an unnecessary dependency on the vector_math package.

1.0.0 #

  • V1!
    • Updated to use a controller for updating/observating.
    • More user-friendly options for sizing/constraining.

0.1.0+1 #

  • Small bug fixes

0.1.0 #

  • First public version


example #

A new Flutter project.

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:

  transformable: ^1.1.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:transformable/transformable.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7


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