flutter_debouncer 1.3.1 copy "flutter_debouncer: ^1.3.1" to clipboard
flutter_debouncer: ^1.3.1 copied to clipboard

A Flutter plugin for debouncing can be used to simplify the implementation of debouncing logic in Flutter applications, making it easier to handle user interactions effectively.

example/lib/main.dart

import 'package:example/debounce_example.dart';
import 'package:example/throttle_example.dart';
import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyScreen(),
    );
  }
}

class MyScreen extends StatefulWidget {
  const MyScreen({super.key});

  @override
  State<MyScreen> createState() => _MyScreenState();
}

class _MyScreenState extends State<MyScreen> {
  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Debouncer Example'),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(18),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              ElevatedButton(
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(builder: (context) => const DebounceExample()),
                  );
                },
                child: const Text('Debouncer'),
              ),
              ElevatedButton(
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(builder: (context) => const ThrottleExample()),
                  );
                },
                child: const Text('Throttle'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
16
likes
150
points
8.62k
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for debouncing can be used to simplify the implementation of debouncing logic in Flutter applications, making it easier to handle user interactions effectively.

Repository (GitHub)

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_debouncer