flick 1.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 82

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:


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:

  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!


[1.0.3] - 21.11.2019 #

  • Minor changes.

[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.


// © Cosmos Software | Ali Yigit Bireroglu                                                                                                           /
// All material used in the making of this code, project, program, application, software et cetera (the "Intellectual Property")                     /
// belongs completely and solely to Ali Yigit Bireroglu. This includes but is not limited to the source code, the multimedia and                     /
// other asset files. If you were granted this Intellectual Property for personal use, you are obligated to include this copyright                   /
// text at all times.                                                                                                                                /

import 'package:flutter/material.dart';

import 'package:flick/flick.dart';

GlobalKey view = GlobalKey();

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

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flick Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: MyHomePage(title: 'Flick Demo'),

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  _MyHomePageState createState() => _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  Widget box() {
    return Container(
      key: view,
      width: 200,
      height: 200,
      color: Colors.transparent,
      child: Padding(
        padding: const EdgeInsets.all(5),
        child: Container(
          constraints: BoxConstraints.expand(),
          decoration: const BoxDecoration(
            color: Colors.redAccent,
            borderRadius: const BorderRadius.all(const Radius.circular(10.0)),
          child: Center(
            child: Text(
              style: const TextStyle(
                color: Colors.white,
                fontWeight: FontWeight.bold,
                fontSize: 25,
              textAlign: TextAlign.center,

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(widget.title)),
      body: FlickController(
        sensitivity: 0.1,

Use this package as a library

1. Depend on it

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

  flick: ^1.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:flick/flick.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 Jul 2, 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 [flick] that is in a package requiring null.

Health suggestions

Format lib/flick_controller.dart.

Run flutter format to format lib/flick_controller.dart.


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
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies