From 3dcb8215f28fc164ccdd40bf4ee02fb3632d1413 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Tue, 26 Dec 2023 18:59:07 +0200 Subject: [PATCH] Updated navigation --- lib/fetcher.dart | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/lib/fetcher.dart b/lib/fetcher.dart index 4223167..eb5894b 100644 --- a/lib/fetcher.dart +++ b/lib/fetcher.dart @@ -1,6 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:witl/home_screen.dart'; -import 'package:witl/input_data.dart'; class FetchAPI extends StatelessWidget { const FetchAPI({super.key}); @@ -11,33 +9,19 @@ class FetchAPI extends StatelessWidget { appBar: AppBar( title: const Text("Fetching API"), ), - body: Column( - mainAxisAlignment: MainAxisAlignment.start, + body: ListView( children: [ InkWell( - onTap:() { - Navigator.push( + onTap: () { + Navigator.pushNamedAndRemoveUntil( context, - MaterialPageRoute(builder: (context) => const HomeScreen()) - ); + '/', + (route) => false + ); }, child: Container( - padding: const EdgeInsets.all(20.0), - child: const Text("To Homescreen") - ), - ), - const SizedBox(height: 20), - InkWell( - onTap:() { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => const InputData()) - ); - }, - child: Container( - padding: const EdgeInsets.all(20.0), - child: const Text("To Input Data") - ), + padding: const EdgeInsets.all(20.0), + child: const Text("Homescreen")), ), ], ),