Updated navigation
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:witl/home_screen.dart';
|
|
||||||
import 'package:witl/input_data.dart';
|
|
||||||
|
|
||||||
class FetchAPI extends StatelessWidget {
|
class FetchAPI extends StatelessWidget {
|
||||||
const FetchAPI({super.key});
|
const FetchAPI({super.key});
|
||||||
@@ -11,33 +9,19 @@ class FetchAPI extends StatelessWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text("Fetching API"),
|
title: const Text("Fetching API"),
|
||||||
),
|
),
|
||||||
body: Column(
|
body: ListView(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap:() {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.pushNamedAndRemoveUntil(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => const HomeScreen())
|
'/',
|
||||||
|
(route) => false
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
child: const Text("To Homescreen")
|
child: const Text("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")
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user