From ec14eed4c92c1f53e3a1e47fca44087e96061271 Mon Sep 17 00:00:00 2001 From: Sara <sarasdj@stud.ntnu.no> Date: Wed, 7 Feb 2024 14:20:58 +0100 Subject: [PATCH] update: add box for map --- app/lib/main.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/lib/main.dart b/app/lib/main.dart index 8863d358..2b2fb703 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -25,8 +25,6 @@ class App extends StatelessWidget { // fetchData requests data from the update_map endpoint Future<void> fetchData() async { - // NB: temp test print - print("fetchData triggered!"); try { // Custom HTTP client HttpClient client = HttpClient() @@ -74,19 +72,28 @@ class _DefaultPageState extends State<DefaultPage> { @override Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + double boxWidth = 0.8; + double boxHeight = 1.2; + return Scaffold( appBar: AppBar( title: const Text('IceMap'), ), - body: const Center( + body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ + Container( + width: screenWidth * boxWidth, + height: screenWidth * boxHeight, + color: Colors.blue, // Set the color of the box + ), + SizedBox(height: 20), // Spacing between box and text Text( 'Default page', style: TextStyle(fontSize: 24), ), - SizedBox(height: 20), ], ), ), -- GitLab