release_to_trigger
- Swipe Gesture & Trigger Actions for Flutter ๐ฑ๐ฅ
release_to_trigger
is a powerful Flutter widget designed to capture vertical swipe gestures and trigger custom actions when users pull and release the swipe at a defined height. With support for both top and bottom swipe gestures, itโs perfect for building interactive UIs, pull-to-refresh controls, or custom trigger actions like loading new content or activating specific app features.
๐ Key Features
- Swipe Gesture Detection: Recognize and respond to vertical swipes, both from the top and bottom of the screen.
- Pull-to-Trigger Action: Easily define actions that get triggered when the swipe reaches a set height.
- Customizable Appearance: Modify text styles, colors, and progress indicators to match your appโs theme.
- Progress Indicator: Real-time feedback with a circular progress indicator that adjusts dynamically as the user pulls.
- User Feedback Integration: Customize swipe feedback with visual indicators and smooth animations.
โจ Use Cases
- Pull-to-Refresh functionality.
- Swipe-to-Activate features.
- Unlock hidden content or actions based on user interactions.
- Enhance user experience with gesture-based controls.
๐ฅ Why Choose release_to_trigger
?
- ๐ฏ High Customizability: Tailor the widgetโs look and behavior to your appโs design.
- ๐ Optimized Performance: Built for smooth animations and responsiveness on any screen size.
- ๐ผ Versatile Implementation: Use in apps that require gesture detection, refresh controls, or interactive triggers.
๐ Getting Started
Simply add the following to your pubspec.yaml
file:
dependencies:
release_to_trigger: ^0.0.2
Then, import and start using it in your project:
import 'package:release_to_trigger/release_to_trigger.dart';
๐ธ Screenshots
Showcase the widget in action:
Initial State | Triggered State |
---|---|
๐ง Example Code
Check out a sample implementation:
ReleaseToTrigger(
backgroundColor: Colors.green.withOpacity(0.2),
progressColor: Colors.green,
initialText: 'Pull down to unlock the surprise',
triggeredText: 'Release to reveal the surprise!',
triggerHeight: 250.0,
onTrigger: () {
// Action to be performed on trigger
},
child: Text('This is a customizable widget!'),
);
๐ Topics Covered
This package is ideal for:
pull-to-refresh
swipe-gesture
trigger-actions
vertical-swipe
gesture-detection-flutter
โญ Show Your Support
If you like release_to_trigger
, please star the repository on GitHub, leave a review on PubDev, and feel free to contribute! Your feedback helps us improve and add more exciting features!