forked from ankurg132/programming-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlanguages.dart
93 lines (89 loc) · 2.8 KB
/
languages.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
import 'package:flutter/material.dart';
import 'package:fancy_drawer/fancy_drawer.dart';
import 'package:programming_resources/insidelanguages.dart';
class Languages extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<Languages>
with SingleTickerProviderStateMixin {
FancyDrawerController _controller;
final items = ['1. C / C++', '2. Python ', '3. Java', '4. Ruby'];
@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: () => {/*listClassClick(context)*/},//aboutusClick(context),
child: Text('About Us',
style: TextStyle(
fontSize: 18,
color: Colors.purple.shade700,
fontWeight: FontWeight.bold,
),)
),TextButton(onPressed: () => {},//contributeClick(context),
child: Text('Contribute',
style: TextStyle(
fontSize: 18,
color: Colors.purple.shade700,
fontWeight: FontWeight.bold,
),))
,
],
child: Scaffold(
appBar: AppBar(
title: new Text('Programming Languages',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) => Cpp()),
);
}
else if(index==1){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Python()),
);
}
},
),
);
},
),
),
);
}
}