forked from ankurg132/programming-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
112 lines (106 loc) · 3.44 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import 'package:flutter/material.dart';
import 'package:fancy_drawer/fancy_drawer.dart';
import 'package:programming_resources/about.dart';
import 'package:programming_resources/languages.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Programming Resources',
theme: ThemeData(
primarySwatch: Colors.amber,
),
home: MyHomePage(title: 'Programming Resouces'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
FancyDrawerController _controller;
final items = ['1. Programming Languages', '2. Web Development ', '3. Machine Learning', '4. App development', '5. Cloud computing'];
@override
void initState() {
super.initState();
_controller = FancyDrawerController(
vsync: this, duration: Duration(milliseconds: 200))
..addListener(() {
setState(() {});
});
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return FancyDrawerWrapper(
backgroundColor: Colors.white,
controller: _controller,
drawerItems: <Widget>[
TextButton(onPressed: () => {Navigator.push(
context,
MaterialPageRoute(builder: (context) => AboutPage()),
)},//aboutusClick(context),
child: Text('About Us',
style: TextStyle(
fontSize: 18,
color: Colors.purple.shade700,
fontWeight: FontWeight.bold,
),)
),TextButton(onPressed: () => {launch('https://docs.google.com/forms/d/e/1FAIpQLSdrx4E78wM_RZ67szoqta_DvJ-J8629gMta4j16V0PRe0jxXQ/viewform?usp=sf_link')},//contributeClick(context),
child: Text('Contribute',
style: TextStyle(
fontSize: 18,
color: Colors.purple.shade700,
fontWeight: FontWeight.bold,
),))
,
],
child: Scaffold(
appBar: AppBar(
title: new Text('Programming Resources',style:TextStyle(color:Colors.white)),
backgroundColor: Colors.purple.shade700,
leading: IconButton(
icon: Icon(
Icons.menu,
color: Colors.white,
),
onPressed: () {
_controller.toggle();
},
),
),
body: ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
return Card( // <-- Card
child: ListTile(
title: Text(items[index]),
onTap: () {
if(index==0){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Languages()),
);
}
},
),
);
},
),
),
);
}
}