Skip to content

Instantly share code, notes, and snippets.

@vi-k
Created December 19, 2020 12:09
Show Gist options
  • Save vi-k/398375230d21c3ada1c003fbe8cbf1ae to your computer and use it in GitHub Desktop.
Save vi-k/398375230d21c3ada1c003fbe8cbf1ae to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final title = 'Ink';
return MaterialApp(
title: title,
home: Scaffold(
appBar: AppBar(
title: Text(title),
),
body: Wrap(
children: [
Container(
height: 300,
width: 300,
child: Stack(
children: [
Center(
child: Ink(
child: Image.network('https://picsum.photos/250?image=9'),
),
),
Positioned.fill(
child: InkWell(
onTap: () {
print('onTap');
},
),
),
],
),
),
Container(
height: 300,
width: 300,
child: Ink(
child: InkWell(
onTap: () {
print('onTap');
},
child: Center(
child: Image.network('https://picsum.photos/250?image=9'),
),
),
),
),
Container(
height: 300,
width: 300,
child: Stack(
children: [
Center(
child: Ink(
child: Image.network('https://picsum.photos/250?image=9'),
),
),
Positioned.fill(
child: Material(
type: MaterialType.transparency,
child: InkWell(
onTap: () {
print('onTap');
},
),
),
),
],
),
),
Container(
height: 300,
width: 300,
child: Stack(
children: [
Center(
child: Ink(
child: Image.network('https://picsum.photos/250?image=9'),
),
),
Positioned.fill(
child: MaterialButton(
onPressed: () {
print('onTap');
},
),
),
],
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment