gesture_handlers 0.0.1 copy "gesture_handlers: ^0.0.1" to clipboard
gesture_handlers: ^0.0.1 copied to clipboard

outdated

Gesture handlers Flutter project.

Gesture handlers #

Pub Version Pub Likes Pub popularity Flutter Platform

Gesture handlers Flutter project.

Provide reusable gesture handler and Support interactive transitions between routes (i.e., controlled by gesture).

Preview #

bottom sheet demo right sheet demo

Installation #

Add gesture_handlers as a dependency in your pubspec.yaml file.

flutter pub add flutter_vk_sdk

Import it in your Dart code

import 'package:gesture_handlers/gesture_handlers.dart';

Usage #

Basic usage #

Initialize concrete GestureHandler implementation.

final tapHandler = TapHandlerDelegate(onTap: () => print('tap handled'));

Pass handler to GestureListener.

@override
Widget build(BuildContext context) {
  return GestureListener(
    handler: handlerComposer,
    child: Scaffold(body: Center(child: Text('Tap'))),
  );
}

Dispose it at the end.

@override
void dispose() {
  tapHandler.dispose();
  super.dispose();
}

Route gesture transition #

  • Initialize NavigatorGesturesFlutterBinding or use your own NavigatorGesturesBinding implementation for prevent route GestureHandler active pointers canceling by NavigatorState.
import 'package:gesture_handlers/gesture_handlers.dart';

void main() {
  /// Prints information about preventing cancel pointer with [GestureBinding.cancelPointer].
  // debugPrintPreventCancelPointer = true;

  NavigatorGesturesFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}
  • Initialize SwipeRouteHandler or your own GestureRouteDelegate implementation.
  • Use GestureModalBottomSheetRoute, MaterialGesturePageRoute or create custom gesture route with GestureRouteTransitionMixin.
3
likes
0
pub points
24%
popularity

Publisher

unverified uploader

Gesture handlers Flutter project.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on gesture_handlers