// // demo for flutter to interface with a game controller // screen map for pixel 4 landscape // youtube -----> https://www.youtube.com/watch?v=uqnyVWxzeag import 'package:flutter/material.dart'; void main() {runApp(MyApp());} class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( // appBar: AppBar(title: Text('Educative Positioned Answer')), body: PositionedExample()));}} class PositionedExample extends StatefulWidget { PositionedExample({super.key}); @override State createState() => _PositionedExample();} class _PositionedExample extends State { double _value = 20; String status = ' '; @override Widget build(BuildContext context) { return Stack( children: [ Container(color: Colors.grey[300], width: double.infinity, height: double.infinity), Positioned(top: 20, left: 150, child: ElevatedButton(onPressed:(){setState((){status = 'BLUE';});}, style:ButtonStyle(backgroundColor:MaterialStateProperty.all(Colors.blue)), child: Text('BLUE'))), Positioned(top: 20, right: 200, child: ElevatedButton(onPressed:(){setState((){status = 'RED';});}, style:ButtonStyle(backgroundColor:MaterialStateProperty.all(Colors.red)), child: Text('RED'))), Positioned(top:170, left:270, child: Text(status,style:DefaultTextStyle.of(context).style.apply(fontSizeFactor:5.0))), Positioned(bottom: 20, left: 50, child: Container(width: 70, height: 110, color: Colors.green)), Positioned(bottom: 60, right: 80, child: Slider(min:0.0, max:200.0, value: _value, onChanged: (value) { setState(() {status = value.round().toString(); _value = value;});}))]);}}