-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdictionaries.dart
63 lines (53 loc) · 1.46 KB
/
dictionaries.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
import 'package:flutter/material.dart';
class Dictionaries extends StatefulWidget {
final List<Dictionary> dictionaries;
Dictionaries(
Key key,
this.dictionaries,
):super(key: key);
@override
State<StatefulWidget> createState() => _DictionariesState();
}
class _DictionariesState extends State<Dictionaries> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: widget.dictionaries.length,
itemBuilder: (context, index) {
return new InkWell(
onTap:(){
Scaffold.of(context).showSnackBar(SnackBar(
content: Text('Tap'),
));
},
child: new Card(
elevation: 5.0,
margin: EdgeInsets.all(20.0),
child: new Padding(
padding: new EdgeInsets.all(40.0),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Text(
widget.dictionaries[index].title,
style: TextStyle(fontSize: 30.0),
textAlign: TextAlign.start,
),
],
)
),
)
);
},
);
}
}
class Dictionary {
final int id;
final String title;
Dictionary(this.id, this.title);
}