Skip to content

Commit a62f09c

Browse files
committed
feat(Article): add Article widget
1 parent e47029c commit a62f09c

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

lib/article.dart

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import 'package:flutter/material.dart';
2+
3+
class H1 extends StatelessWidget {
4+
H1({Key key, this.text = ""}) : super(key: key);
5+
final String text;
6+
@override
7+
Widget build(BuildContext context) {
8+
return Padding(
9+
padding: const EdgeInsets.only(bottom: 20),
10+
child: Text(
11+
text,
12+
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w400),
13+
),
14+
);
15+
}
16+
}
17+
18+
class H2 extends StatelessWidget {
19+
H2({Key key, this.text = ""}) : super(key: key);
20+
final String text;
21+
@override
22+
Widget build(BuildContext context) {
23+
return Padding(
24+
padding: const EdgeInsets.only(bottom: 10),
25+
child: Text(
26+
text,
27+
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w400),
28+
),
29+
);
30+
}
31+
}
32+
33+
class H3 extends StatelessWidget {
34+
H3({Key key, this.text = ""}) : super(key: key);
35+
final String text;
36+
@override
37+
Widget build(BuildContext context) {
38+
return Padding(
39+
padding: const EdgeInsets.only(bottom: 10),
40+
child: Text(
41+
text,
42+
style: TextStyle(fontSize: 15, fontWeight: FontWeight.w400),
43+
),
44+
);
45+
}
46+
}
47+
48+
class P extends StatelessWidget {
49+
P({Key key, this.text = ""}) : super(key: key);
50+
final String text;
51+
@override
52+
Widget build(BuildContext context) {
53+
return Padding(
54+
padding: const EdgeInsets.only(bottom: 15),
55+
child: Text(
56+
text,
57+
),
58+
);
59+
}
60+
}
61+
62+
class Article extends StatelessWidget {
63+
Article({Key key, this.children}) : super(key: key);
64+
final List<Widget> children;
65+
@override
66+
Widget build(BuildContext context) {
67+
return Padding(
68+
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 15),
69+
child: Column(
70+
crossAxisAlignment: CrossAxisAlignment.start,
71+
children: children,
72+
),
73+
);
74+
}
75+
}
76+
class Section extends StatelessWidget {
77+
Section({Key key, this.children}) : super(key: key);
78+
final List<Widget> children;
79+
@override
80+
Widget build(BuildContext context) {
81+
return Padding(
82+
padding: const EdgeInsets.only(bottom: 24),
83+
child: Column(
84+
crossAxisAlignment: CrossAxisAlignment.start,
85+
children: children,
86+
),
87+
);
88+
}
89+
}
90+
91+

lib/flutter_weui.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ export 'touchable.dart';
1414
export 'media_box.dart';
1515
export 'panel.dart';
1616
export 'footer.dart';
17+
export 'article.dart';

0 commit comments

Comments
 (0)