Animatable horizontal-gesture detecting container supporting event callbacks
onAction
callback functionCHANGELOG.md
in descending order1.19.0
to 0.5.7
to
fix dartdoc
issues on Dart Pub/lib/src/Swipable.dart
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:swipable/swipable.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Swipable Test',
home: new MyHomePage(title: 'Swipable Test'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _count = 0;
bool onFling(SwipableInfo swipe, DragEndDetails event) {
setState(() {
_count++;
});
return true;
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
centerTitle: true,
title: new Text(widget.title),
),
body: new Container(
child: new Swipable(
onFling: onFling,
tweenTranslation: (swipe) => Offset(2.0 * swipe.fractionalDelta, 0.0),
child: new Card(
child: new Center(child: new Text('Swipes: $_count')),
),
)),
);
}
}
Add this to your package's pubspec.yaml file:
dependencies:
swipable: ^0.1.0
You can install packages from the command line:
with Flutter:
$ flutter packages get
Alternatively, your editor might support flutter packages get
.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:swipable/swipable.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.1.0 | Sep 17, 2018 |
|
|
0.0.4 | Aug 10, 2018 |
|
|
0.0.3 | Aug 10, 2018 |
|
|
0.0.2 | Aug 10, 2018 |
|
|
0.0.1 | Aug 10, 2018 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
59
|
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]
|
79
|
We analyzed this package on Feb 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
Format lib/swipable.dart
.
Run flutter format
to format lib/swipable.dart
.
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=2.0.0-dev.63.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 |