add about page
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:iiitb_menu/models/globalModel.dart';
|
||||
import 'package:iiitb_menu/views/homePage.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import "package:iiitb_menu/views/about.dart";
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -20,8 +21,13 @@ class MainApp extends StatelessWidget {
|
||||
builder: (BuildContext context, child) {
|
||||
return MaterialApp(
|
||||
title: "IIITB Menu",
|
||||
home: const HomePage(),
|
||||
theme: ThemeData(useMaterial3: false),
|
||||
routes: {
|
||||
"/": (context) => HomePage(),
|
||||
"/info": (context) => AboutPage(),
|
||||
},
|
||||
initialRoute: "/",
|
||||
// home: const HomePage(),
|
||||
theme: ThemeData(useMaterial3: true),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
21
lib/views/about.dart
Normal file
21
lib/views/about.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AboutPage extends StatelessWidget {
|
||||
const AboutPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text("About Page")),
|
||||
body: const Column(
|
||||
children: [
|
||||
Image(image: AssetImage("assets/plate.png")),
|
||||
Text(
|
||||
"IIIT Bangalore Unofficial Mess Menu",
|
||||
style: TextStyle(fontSize: 50),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -25,13 +25,40 @@ class HomePage extends StatelessWidget {
|
||||
return Consumer<GlobalModel>(
|
||||
builder: (BuildContext context, GlobalModel data, Widget? child) {
|
||||
return Scaffold(
|
||||
drawer: Drawer(
|
||||
child: ListView(
|
||||
children: [
|
||||
ListTile(
|
||||
leading: Icon(Icons.menu),
|
||||
title: Text("Menu"),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
ListTile(
|
||||
leading: Icon(Icons.star),
|
||||
title: Text("Specials"),
|
||||
),
|
||||
Divider(),
|
||||
ListTile(
|
||||
leading: Icon(Icons.settings),
|
||||
title: Text("Settings"),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.info),
|
||||
title: Text("About App"),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, "/info");
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: Text("Daily ${data.menuTime} Menu"),
|
||||
bottom: TabBar(
|
||||
controller: cont,
|
||||
splashFactory: NoSplash.splashFactory,
|
||||
indicator: const UnderlineTabIndicator(
|
||||
insets: EdgeInsets.fromLTRB(10, 3, 10, 3)),
|
||||
// splashFactory: InkSplash.splashFactory,
|
||||
// indicator: const UnderlineTabIndicator(
|
||||
// insets: EdgeInsets.fromLTRB(10, 3, 10, 3)),
|
||||
onTap: (int index) {
|
||||
data.setMenuTime(index);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user