#50 - Custom Gesture Detector in Flutter
Date: 2019-03-02 12:00 - dart
Example of custom gesture detection in Flutter.
import 'package:flutter/material.dart';
import 'package:gestures/gestures.dart';
void main() => runApp(YourApp());
class YourApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Example',
home: CustomGestureDetector(
gestures: [
GestureLine(AxisDirection.down),
GestureLine(AxisDirection.right),
GestureLine(AxisDirection.up),
],
onGestureEnd: (success) {
if (success) {
// TODO: your action here..
}
},
child: Container(),
)
);
}
}