release_to_trigger 0.0.9 copy "release_to_trigger: ^0.0.9" to clipboard
release_to_trigger: ^0.0.9 copied to clipboard

release_to_trigger is a Flutter package for capturing vertical swipes and triggering actions, perfect for custom triggers like loading new content or activating app features

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:release_to_trigger/release_to_trigger.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Release to Trigger Example',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: SurpriseUnlockPage(),
    );
  }
}

class SurpriseUnlockPage extends StatefulWidget {
  @override
  _SurpriseUnlockPageState createState() => _SurpriseUnlockPageState();
}

class _SurpriseUnlockPageState extends State<SurpriseUnlockPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Unlock the Surprise!'),
      ),
      body: 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,
        pullSensitivityHeight: 250,
        onTrigger: () {
          Navigator.of(context).push(ModalBottomSheetRoute(
              useSafeArea: true,
              showDragHandle: true,
              builder: (context) => const SizedBox(
                    child: Center(
                      child: Text("Action Triggered"),
                    ),
                  ),
              isScrollControlled: true));
        },
        child: const Text("release to trigger example"),
      ),
    );
  }
}
11
likes
140
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

release_to_trigger is a Flutter package for capturing vertical swipes and triggering actions, perfect for custom triggers like loading new content or activating app features

Repository (GitHub)
View/report issues

Topics

#pull-to-refresh #swipe-gesture #trigger-actions #vertical-swipe #gesture-detection-flutte

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on release_to_trigger