flick 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

flick #

Cosmos Software Awesome Flutter

Pub License

An extensive flick tool/widget for Flutter that allows very flexible flick management for your widgets.

It is designed to work flawlessly with snap but it can be used as a standalone package too.

It is highly recommended to read the documentation and run the example project on a real device to fully understand and inspect the full range of capabilities.

Media | Description | How-to-Use

Notice #

  • flick works as intended on actual devices even if it might appear to fail rarely on simulators. Don't be discouraged!

Media #

Watch on Youtube:

v0.1.0



Description #

This is an extensive flick tool/widget for Flutter that allows very flexible flick management for your widgets.

Just wrap the widget you want to flick with the FlickController widget, fill the parameters and this package will take care of everything else.

How-to-Use #

"The view is what is being moved. It is the widget that flicks. The bound is what constrains the view."

First, a GlobalKey for your view:

GlobalKey view = GlobalKey();

If you want your view to be constrained, also define a GlobalKey for your bound.

GlobalKey bound = GlobalKey();

Then, create a FlickController such as:

FlickController(
  uiChild(),    //uiChild
  false,        //useCache
  view,         //viewKey
 {Key key,
  boundKey          : bound,
  constraintsMin    : Offset.zero,
  constraintsMax    : const Offset(1.0, 1.0),
  flexibilityMin    : const Offset(0.75, 0.75),
  flexibilityMax    : const Offset(0.75, 0.75),
  customBoundWidth  : 0,
  customBoundHeight : 0,
  sensitivity       : 0.05,
  onMove            : _onMove,
  onDragStart       : _onDragStart,
  onDragUpdate      : _onDragUpdate,
  onDragEnd         : _onDragEnd,
  onFlick           : _onFlick})

Widget uiChild() {
  return Container(
    key: view,
    ...
  ); 
}

void _onMove(Offset offset);

void _onDragStart(dynamic dragDetails);
void _onDragUpdate(dynamic dragDetails);
void _onDragEnd(dynamic dragDetails);

void _onFlick(Offset offset);

Further Explanations:

For a complete set of descriptions for all parameters and methods, see the documentation.

  • Set [useCache] to true if your [uiChild] doesn't change during the Peek & Pop process.
  • If [boundKey] is set, [constraintsMin], [constraintsMax], [flexibilityMin] and [flexibilityMax] can't be null.
  • For further clarification of [constraintsMin], [constraintsMax], [flexibilityMin] and [flexibilityMax], see this.
  • Use [FlickControllerState]'s [shouldFlick(dynamic dragEndDetails, double treshold)] method to determine if the view should flick or not where [treshold] is the velocity at which the view should be considered to flick.

Notes #

I started using and learning Flutter only some weeks ago so this package might have some parts that don't make sense, that should be completely different, that could be much better, etc. Please let me know! Nicely!

Any help, suggestion or criticism is appreciated!

Cheers.





[1.0.2] - 07.09.2019

  • Minor changes.

[1.0.1] - 30.08.2019

  • Minor changes.

  • Improved code style.

  • [1.0.1+1] Updated README.

[1.0.0] - 23.08.2019

  • Minor changes.

  • Improved code style with trailing commas.

[0.1.1] - 20.08.2019

  • Improved code style.

  • Code excerpt added to the README.

  • [0.1.1+1] Updated README.

[0.1.0] - 18.08.2019

  • Initial release.

example/README.md

example #

Example Project for flick.

flick #

Cosmos Software Awesome Flutter

Pub License

An extensive flick tool/widget for Flutter that allows very flexible flick management for your widgets.

It is designed to work flawlessly with snap but it can be used as a standalone package too.

It is highly recommended to read the documentation and run the example project on a real device to fully understand and inspect the full range of capabilities.

Media | Description | How-to-Use

Notice #

  • flick works as intended on actual devices even if it might appear to fail rarely on simulators. Don't be discouraged!

Media #

Watch on Youtube:

v0.1.0



Description #

This is an extensive flick tool/widget for Flutter that allows very flexible flick management for your widgets.

Just wrap the widget you want to flick with the FlickController widget, fill the parameters and this package will take care of everything else.

How-to-Use #

"The view is what is being moved. It is the widget that flicks. The bound is what constrains the view."

First, a GlobalKey for your view:

GlobalKey view = GlobalKey();

If you want your view to be constrained, also define a GlobalKey for your bound.

GlobalKey bound = GlobalKey();

Then, create a FlickController such as:

FlickController(
  uiChild(),    //uiChild
  false,        //useCache
  view,         //viewKey
 {Key key,
  boundKey          : bound,
  constraintsMin    : Offset.zero,
  constraintsMax    : const Offset(1.0, 1.0),
  flexibilityMin    : const Offset(0.75, 0.75),
  flexibilityMax    : const Offset(0.75, 0.75),
  customBoundWidth  : 0,
  customBoundHeight : 0,
  sensitivity       : 0.05,
  onMove            : _onMove,
  onDragStart       : _onDragStart,
  onDragUpdate      : _onDragUpdate,
  onDragEnd         : _onDragEnd,
  onFlick           : _onFlick})

Widget uiChild() {
  return Container(
    key: view,
    ...
  ); 
}

void _onMove(Offset offset);

void _onDragStart(dynamic dragDetails);
void _onDragUpdate(dynamic dragDetails);
void _onDragEnd(dynamic dragDetails);

void _onFlick(Offset offset);

Further Explanations:

For a complete set of descriptions for all parameters and methods, see the documentation.

  • Set [useCache] to true if your [uiChild] doesn't change during the Peek & Pop process.
  • If [boundKey] is set, [constraintsMin], [constraintsMax], [flexibilityMin] and [flexibilityMax] can't be null.
  • For further clarification of [constraintsMin], [constraintsMax], [flexibilityMin] and [flexibilityMax], see this.
  • Use [FlickControllerState]'s [shouldFlick(dynamic dragEndDetails, double treshold)] method to determine if the view should flick or not where [treshold] is the velocity at which the view should be considered to flick.

Notes #

I started using and learning Flutter only some weeks ago so this package might have some parts that don't make sense, that should be completely different, that could be much better, etc. Please let me know! Nicely!

Any help, suggestion or criticism is appreciated!

Cheers.





Use this package as a library

1. Depend on it

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


dependencies:
  flick: ^1.0.2

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

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

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/flick_controller.dart.

Run flutter format to format lib/flick_controller.dart.

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 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test