-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathmain.dart
57 lines (51 loc) · 1.34 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
import 'package:flutter/material.dart';
void main() {
List<String> notes = [
"fluttermaster.com",
"Update Android Studio to 3.3",
"Implement ListView widget",
"Demo ListView simplenote app",
"Fixing app color",
"Create new note screen",
"Persist notes data",
"Add screen transition animation",
"Something long Something long Something long Something long Something long Something long",
];
runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("Simple Note ListView"),
),
body: Container(
color: Colors.white10,
padding: EdgeInsets.all(16.0),
child: HomePage(notes)
),
),
));
}
class HomePage extends StatelessWidget {
final List<String> notes;
HomePage(this.notes);
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: notes.length,
itemBuilder: (context, pos) {
return Padding(
padding: EdgeInsets.only(bottom: 16.0),
child: Card(
color: Colors.white,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 24.0, horizontal: 16.0),
child: Text(notes[pos], style: TextStyle(
fontSize: 18.0,
height: 1.6,
),),
),
)
);
},
);
}
}