import 'package:flutter/material.dart'; class TestPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Hit Test'), ), body: Stack( clipBehavior: Clip.none, children: [ GestureDetector( onTap: () { print('Red Container tapped'); }, child: Container( width: 100, height: 100, color: Colors.red, margin: EdgeInsets.all(20), ), ), GestureDetector( onTap: () { print('Blue Container tapped'); }, child: Container( width: 50, height: 50, color: Colors.blue, margin: EdgeInsets.fromLTRB(30, 20, 20, 20), ), ), ], ), ); } }