-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
68 lines (57 loc) · 1.78 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import 'package:course_swap/CourseCard.dart';
import 'package:course_swap/CourseDropDown.dart';
import 'package:course_swap/CustomScreen.dart';
import 'package:course_swap/MyProfile.dart';
import 'package:course_swap/MyRequirements.dart';
import 'package:course_swap/RequestCard.dart';
import 'package:flutter/cupertino.dart';
import 'package:course_swap/TabBarMaterialWidget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
//initialRoute: '/',
routes: {
// When navigating to the "/" route, build the FirstScreen widget.
'/first': (context) => MyHomePage(),
// When navigating to the "/second" route, build the SecondScreen widget.
'/req': (context) => MyRequirements(),
'/profile': (context) => MyProfile()
},
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData.dark(),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int index =0;
final pages = <Widget>[
CustomScreen('Dashboard', CourseCard()),
CustomScreen(
'Add Requirement',
MyRequirements()),
CustomScreen('My Profile', MyProfile())
];
@override
Widget build(BuildContext context) => Scaffold(
extendBody: true,
body: pages[index],
);
void onChangedTab(int index) {
setState(() {
this.index = index;
});
}
}