forked from md-siam/widget_of_the_day
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable.dart
119 lines (117 loc) · 4.14 KB
/
table.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
113
114
115
116
117
118
119
import 'package:flutter/material.dart';
class MyTable extends StatelessWidget {
const MyTable({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.deepPurple[100],
appBar: AppBar(title: const Text('Table')),
body: Column(
children: [
const SizedBox(height: 20),
Padding(
padding: const EdgeInsets.all(10.0),
child: Table(
border: TableBorder.all(),
columnWidths: const {
0: FlexColumnWidth(.35),
3: FlexColumnWidth(0.50),
},
textDirection: TextDirection.ltr,
children: const [
TableRow(
children: [
Text(
'No.',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
textAlign: TextAlign.center,
),
Text(
'Name',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
textAlign: TextAlign.center,
),
Text(
'Surname',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
textAlign: TextAlign.center,
),
Text(
'Age',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
textAlign: TextAlign.center,
),
],
),
TableRow(
children: [
Text('1.', textAlign: TextAlign.center),
Text('Md.', textAlign: TextAlign.center),
Text('Siam', textAlign: TextAlign.center),
Text('27', textAlign: TextAlign.center),
],
),
TableRow(
children: [
Text('2.', textAlign: TextAlign.center),
Text('Jasia', textAlign: TextAlign.center),
Text('Khatun', textAlign: TextAlign.center),
Text('20', textAlign: TextAlign.center),
],
),
TableRow(
children: [
Text('3.', textAlign: TextAlign.center),
Text('Mahmuda', textAlign: TextAlign.center),
Text('Khatun', textAlign: TextAlign.center),
Text('31', textAlign: TextAlign.center),
],
),
],
),
),
const SizedBox(height: 20),
Padding(
padding: const EdgeInsets.all(10.0),
child: Table(
children: [
TableRow(
children: [
Container(height: 80, color: Colors.blue),
Container(height: 80, color: Colors.orange),
Container(height: 80, color: Colors.green),
Container(height: 80, color: Colors.red),
Container(height: 80, color: Colors.grey),
Container(height: 80, color: Colors.teal),
],
),
TableRow(
children: [
Container(height: 80, color: Colors.black),
Container(height: 80, color: Colors.cyan),
Container(height: 80, color: Colors.amber),
Container(height: 80, color: Colors.white),
Container(height: 80, color: Colors.pink),
Container(height: 80, color: Colors.purple),
],
),
],
),
)
],
),
);
}
}