zoomable_tilt_view 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 74

zoomable_tilt_view #

ZoomableTiltView is simple widget to add some juiciness to your app.

Example gif

Usage #

Simply import the package and wrap it inside ZoomableTiltView widget.

import 'package:zoomable_tilt_view/zoomable_tilt_view.dart';

Example #

ZoomableTiltView(
  yTiltLimit: 50,
  xTiltLimit: 50,
  tiltSensitivity: 1.5,
  zoomLimit: 1.8,
  child: Container(
    height: 200,
    width: 200,
    color: Colors.pinkAccent,
    child: Center(
      child: Text(
        "HIREME",
        style: TextStyle(
          fontSize: 24,
          fontWeight: FontWeight.bold,
          color: Colors.white,
        ),
      ),
    ),
  ),
),

Parameters #

ParameterDefaultDescription
yTiltLimit int25How much the child can tilt on Y axis. Must be positive number.
xTiltLimit int25How much the child can tilt on X axis. Must be positive number.
tiltSensitivity double1.0How much the child tilts.
tiltResetAnimationDuration DurationDuration(milliseconds: 900)How fast the tilt resets after you release the hold.
zoomLimit double1.2How much the child zooms when on press.
zoomAnimationDuration DurationDuration(milliseconds: 250)How long it takes to zoom in/out on press/release.
zoomAlignment AlignmentAlignment.centerWhich direction the child scales when pressed. Useful if the child is near edges of the screen.

[0.1.1] - 2020-01-23 #

  • Added comments for better understandability

[0.1.0] - 2020-01-02 #

  • Added example to github

[0.0.1] - 2019-12-24 #

  • Releasing a reusable package from widget I made some time ago

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:zoomable_tilt_view/zoomable_tilt_view.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ZoomableTiltView Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("zoomable_tilt_view"),
      ),
      body: Center(
        child: ZoomableTiltView(
          yTiltLimit: 50,
          xTiltLimit: 50,
          tiltSensitivity: 1.5,
          zoomLimit: 1.8,
          child: Container(
            height: 200,
            width: 200,
            child: Card(
              color: Colors.pinkAccent,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(24),
              ),
              elevation: 10,
              child: Center(
                child: Text(
                  "HIREME",
                  style: TextStyle(
                    fontSize: 24,
                    fontWeight: FontWeight.bold,
                    color: Colors.white,
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  zoomable_tilt_view: ^0.1.1

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:zoomable_tilt_view/zoomable_tilt_view.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
51
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
91
Overall:
Weighted score of the above. [more]
74
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • zoomable_tilt_view that is a package requiring null.

Health suggestions

Format lib/zoomable_tilt_view.dart.

Run flutter format to format lib/zoomable_tilt_view.dart.

Maintenance suggestions

The package description is too short. (-9 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

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