pressable_flutter 1.0.4 copy "pressable_flutter: ^1.0.4" to clipboard
pressable_flutter: ^1.0.4 copied to clipboard

Pressable package adds customizable press effects, like ripple and shrink, to any child widget, enhancing user interaction in Flutter apps.

example/lib/main.dart

import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:pressable_flutter/pressable_flutter.dart';

void main() {
  runApp(const MaterialApp(home: Home()));
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: Center(
        child: Pressable(
          effect: PressEffect.withRipple(
            rippleEffect: RippleEffect.background(
              color: Colors.amberAccent,
              borderRadius: BorderRadius.circular(12),
            ),
          ),
          onPress: () => log('onPress'),
          onLongPress: () => log('onLongPress'),
          child: Container(
            height: 50,
            width: 300,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(10),
              border: Border.all(color: Colors.grey),
            ),
            child: const Center(
              child: Text(
                'Click Me',
                style: TextStyle(
                  color: Colors.black,
                  fontSize: 20,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
3
likes
160
points
43
downloads

Publisher

unverified uploader

Weekly Downloads

Pressable package adds customizable press effects, like ripple and shrink, to any child widget, enhancing user interaction in Flutter apps.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on pressable_flutter