Created
May 12, 2021 11:11
-
-
Save SaadArdati/0bba2bc60f5ea81322463f91a37c5053 to your computer and use it in GitHub Desktop.
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/cupertino.dart'; | |
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: Scaffold( | |
body: Center( | |
child: MyWidget(), | |
), | |
), | |
); | |
} | |
} | |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Stack( | |
alignment: Alignment.center, | |
children: [ | |
Listener( | |
behavior: HitTestBehavior.translucent, | |
onPointerSignal: (event) { | |
print('${event.kind} // ${event.delta}'); | |
}, | |
onPointerMove: (details) { | |
print('BLUE BOX ${details.position}'); | |
}, | |
child: Container( | |
color: Colors.blue, | |
width: 300, | |
height: 300, | |
padding: const EdgeInsets.all(100), | |
), | |
), | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment