ripple_image_button 1.0.9 ripple_image_button: ^1.0.9 copied to clipboard
RippleImageButton has ripple effect on click. Image widget can not ripple effect on wrapped InkWell Widget. so I tried to Container Widget and could be have ripple effect on click
import 'package:flutter/material.dart';
import 'package:ripple_image_button/ripple_image_button.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),
primaryColor: Colors.purple.shade500,
useMaterial3: true,
),
home: Scaffold(
backgroundColor: Theme.of(context).primaryColor,
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 200,
height: 50,
child: RippleImageButton(
image: const AssetImage('images/google_sign_image.png'), // or NetworkImage
onTap: () {},
),
),
const SizedBox(height: 18,),
RippleImageButton(
image: const AssetImage('images/google_sign_image.png'),
onTap: () {},
width: 200,
height: 50,
),
const SizedBox(height: 18),
RippleImageButton(
image: const AssetImage('images/google_sign_image.png'),
onTap: () {},
width: 200,
height: 50,
borderRadius: 30,
)
],
),
),
),
);
}
}