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

The 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
0
points
49
downloads

Publisher

unverified uploader

Weekly Downloads

The 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

License

unknown (license)

Dependencies

flutter

More

Packages that depend on pressable_flutter