ripple_container 0.1.1 copy "ripple_container: ^0.1.1" to clipboard
ripple_container: ^0.1.1 copied to clipboard

RippleContainer provides a versatile Box widget that can apply a ripple effect in Flutter applications.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:ripple_container/ripple_container.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            RippleContainer(
              width: 200,
              height: 100,
              backgroundColor: Colors.blueAccent,
              margin: const EdgeInsets.all(10),
              borderRadius: BorderRadius.circular(30),
              splashColor: Colors.amber,
              border: const Border.fromBorderSide(BorderSide(color: Colors.grey)),
              boxShadow: [
                BoxShadow(
                  color: Colors.black.withOpacity(0.5),
                  offset: const Offset(0, 2),
                  blurRadius: 10,
                )
              ],
              onTap: () => tapTest('Button OnTap'),
              onLongPress: () => tapTest('Button OnLongPress'),
              child: const Text('Hi'),
            ),
            Container(
              width: 200,
              height: 100,
              decoration: const BoxDecoration(
                  border: Border.fromBorderSide(BorderSide(color: Colors.red))),
              child: const Text('Hi'),
            )
          ],
        ),
      ),
    );
  }

  void tapTest(String testMessage) =>
      ScaffoldMessenger.of(context).showSnackBar(
        SnackBar(
          content: Text(
            testMessage,
            style: TextStyle(color: Colors.white),
          ),
          duration: Duration(seconds: 1),
          showCloseIcon: true,
        ),
      );
}
3
likes
0
points
36
downloads

Publisher

verified publisheraqoong.site

Weekly Downloads

RippleContainer provides a versatile Box widget that can apply a ripple effect in Flutter applications.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on ripple_container