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

A highly customizable Flutter package that triggers an action when the user pulls down from the top or pulls up from the bottom of the screen and releases it. Similar to Instagram's 'Swipe Up' functio [...]

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
0
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

A highly customizable Flutter package that triggers an action when the user pulls down from the top or pulls up from the bottom of the screen and releases it. Similar to Instagram's 'Swipe Up' functionality, this package allows developers to customize the pull threshold, progress indicator, colors, and trigger text. Ideal for implementing features like 'pull to refresh' or 'load more' actions.

Repository (GitHub)
View/report issues

Topics

#trigger #action #pull #release #release-to-trigger

License

unknown (license)

Dependencies

flutter

More

Packages that depend on release_to_trigger