Skip to content

Instantly share code, notes, and snippets.

@shihaohong
Created March 18, 2020 17:08
Show Gist options
  • Save shihaohong/8f2b1a63d88f2683b5f1434246b10ebb to your computer and use it in GitHub Desktop.
Save shihaohong/8f2b1a63d88f2683b5f1434246b10ebb to your computer and use it in GitHub Desktop.
Overlapping InkWells with Stack
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
debugShowCheckedModeBanner: false,
home: MyWidget(),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Conversation Gallery')),
backgroundColor: Colors.grey,
body: Container(
child: Stack(
children: <Widget>[
Center(
child: Card(
child: InkWell(
onTap: () => null,
child: Container(
width: 240,
height: 180,
),
),
),
),
Center(
child: InputChip(
onPressed: () => null,
label: const Text('Tap'),
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment