8. Creating Navigation and Routing a Pizza Store App.
[Link]
import 'package:flutter/[Link]';
import 'package:lab8/[Link]';
void main() async{
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'pizza dashboard',
theme: ThemeData(
primarySwatch: [Link],
),
debugShowCheckedModeBanner: false,
home: Dashboard(),
);
// });
}
}
[Link]
import 'package:flutter/[Link]';
class TopNavigationBar extends StatelessWidget{
@override
Widget build(BuildContext context){
return DefaultTabController(length: 3,
child: Scaffold(
appBar: AppBar(
backgroundColor: [Link],
title: Row(children: [
Text('WOW Pizza',
style:TextStyle(fontSize: 20.0),),
SizedBox(width:160.0,),
Container(child:GestureDetector(
child:[Link](
'Images/[Link]',
fit:[Link],
height: 30,),
),),
SizedBox(width:10.0,),
Container(child:GestureDetector(
child:[Link](
'Images/[Link]',
fit:[Link],
height: 40,),
),),
],
),
bottom: TabBar(indicatorColor: [Link],
tabs:[
Tab(icon: Container(height:40,
child: [Link]('lib/icons/[Link]')),
text:'Vegitable Pizza'
),
Tab(icon: Container(height: 40,
child: [Link]('lib/icons/[Link]')),
text:'Cheese Pizza'
),
Tab(icon: Container(height: 40,
child: [Link]('lib/icons/[Link]')),
text:'Fries'
),
]
)
),
body:TabBarView(
children: [
MaterialApp(home:Center(child:Column(children:[
[Link]('Images/[Link]',
width:400.0,
height:300.0,),
Text("Hi, I'm Pizza Assistant, what can I help you order?",
style: TextStyle(decoration:[Link],fontSize:30.0),
textAlign: [Link],
),
]
)
),
),
MaterialApp(home:Center(child:Column(children:[
[Link]('Images/[Link]',
width:400.0,
height:300.0,),
Text("Hi, I'm Pizza Assistant, what can I help you order?",
style: TextStyle(decoration:[Link],fontSize:30.0),
textAlign: [Link],
),
]
)
),
),
MaterialApp(home:Center(child:Column(children:[
[Link]('Images/[Link]',
width:400.0,
height:300.0,),
Text("Hi, I'm Pizza Assistant, what can I help you order?",
style: TextStyle(decoration:[Link],fontSize:30.0),
textAlign: [Link],
),
]
)
),
),
],
),
));
}
}
[Link]
import 'package:flutter/[Link]';
import 'package:lab8/[Link]';
class Dashboard extends StatelessWidget {
const Dashboard({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
// Material App
return MaterialApp(
home:Scaffold(
appBar: AppBar(
title: Text("Welcome to WOW PIZZA!"),
centerTitle: true,
backgroundColor: [Link],
),
body: Column(children:[
[Link]('Images/[Link]',
width:400.0,
height:300.0,),
Text("Wanna Order Something... ",
style: TextStyle(decoration:[Link],fontSize:30.0),
textAlign: [Link],
),
ElevatedButton(
onPressed: () async => {
[Link](
context,
MaterialPageRoute(
builder: (context) => TopNavigationBar(),
),
(route) => false)
},
child: Text('Lets Go'),
style: [Link](primary: [Link]),
)
]
)
));
}
}