Skip to content

Instantly share code, notes, and snippets.

@themisir
Last active February 7, 2024 09:34
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save themisir/ed0fd320a28f1f27999dff67ee5f2302 to your computer and use it in GitHub Desktop.
Save themisir/ed0fd320a28f1f27999dff67ee5f2302 to your computer and use it in GitHub Desktop.
InkWell ripple over Image
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
));
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Home Page'),
),
body: Center(
child: Stack(
children: <Widget>[
Image.network('https://flutter.dev/images/flutter-logo-sharing.png'),
Positioned.fill(
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {
print('Sure');
},
),
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment