Last active
February 7, 2024 09:34
-
-
Save themisir/ed0fd320a28f1f27999dff67ee5f2302 to your computer and use it in GitHub Desktop.
InkWell ripple over Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Originally published for: https://stackoverflow.com/questions/48066321/inkwell-ripple-over-top-of-image-in-gridtile-in-flutter/59317162#59317162