single_touch_gesture 1.0.1 copy "single_touch_gesture: ^1.0.1" to clipboard
single_touch_gesture: ^1.0.1 copied to clipboard

A Flutter package that prevents multiple gesture recognition, allowing only one touch at a time.

example/lib/main.dart

import 'package:example/checkbox_tile_example.dart';
import 'package:example/dismissible_example.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const SingleTouchExample());
}

class SingleTouchExample extends StatelessWidget {
  const SingleTouchExample({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "Single Touch Gesture Demo",
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const HomePage(title: "Single Touch Gesture Demo"),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key, required this.title});

  final String title;

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          spacing: 10,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              style: ButtonStyle(
                  backgroundColor: WidgetStatePropertyAll(
                      Theme.of(context).colorScheme.inversePrimary)),
              child: Text(
                "Dismissible Example",
                style: TextStyle(color: Colors.black),
              ),
              onPressed: () {
                Navigator.of(context).push(MaterialPageRoute(
                  builder: (context) => DismissibleExample(),
                ));
              },
            ),
            ElevatedButton(
              style: ButtonStyle(
                  backgroundColor: WidgetStatePropertyAll(
                      Theme.of(context).colorScheme.inversePrimary)),
              child: Text(
                "Checkbox Tile Example",
                style: TextStyle(color: Colors.black),
              ),
              onPressed: () {
                Navigator.of(context).push(MaterialPageRoute(
                  builder: (context) => CheckBoxTileExample(),
                ));
              },
            ),
          ],
        ),
      ),
    );
  }
}
4
likes
160
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package that prevents multiple gesture recognition, allowing only one touch at a time.

Repository (GitHub)
View/report issues

Topics

#single #touch #gestures #multiple #prevention

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on single_touch_gesture