bounce_tapper 1.0.9 copy "bounce_tapper: ^1.0.9" to clipboard
bounce_tapper: ^1.0.9 copied to clipboard

Smooth on-tap bounce (shrink/grow) animation that can easily enhance user touch interactions.

example/bounce_tapper_example.dart

import 'package:bounce_tapper/src/bounce_tapper.dart';
import 'package:flutter/material.dart';

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              BounceTapper(
                child: FilledButton(
                  onPressed: () {
                    ScaffoldMessenger.of(context).showSnackBar(
                      const SnackBar(
                        content: Text(
                          'Yay! A SnackBar!',
                        ),
                      ),
                    );
                  },
                  child: const Text('BUTTON'),
                ),
              ),
              const SizedBox(height: 50),
              BounceTapper(
                onTap: () {
                  ScaffoldMessenger.of(context).showSnackBar(
                    const SnackBar(
                      content: Text(
                        'Yay! A SnackBar!',
                      ),
                    ),
                  );
                },
                child: Container(
                  height: 100,
                  width: 100,
                  decoration: BoxDecoration(
                    color: Colors.red,
                    borderRadius: BorderRadius.circular(12),
                  ),
                ),
              ),
              const SizedBox(height: 50),
              BounceTapper(
                onTap: () {
                  ScaffoldMessenger.of(context).showSnackBar(
                    const SnackBar(
                      content: Text(
                        'OnTap!',
                      ),
                    ),
                  );
                },
                onLongPressUp: () {
                  ScaffoldMessenger.of(context).showSnackBar(
                    const SnackBar(
                      content: Text(
                        'OnLongPressUp!',
                      ),
                    ),
                  );
                },
                child: const Card(
                  margin: EdgeInsets.zero,
                  child: SizedBox(
                    height: 100,
                    width: 100,
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
18
likes
150
points
122
downloads

Publisher

unverified uploader

Weekly Downloads

Smooth on-tap bounce (shrink/grow) animation that can easily enhance user touch interactions.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on bounce_tapper