row_multi_text.dart
2.24 KB
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
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/utils.dart';
import '../utils/screen_util.dart';
class RowMultiText extends StatelessWidget {
final String title;
final String content;
final TextAlign textAlign;
final Color textColor;
final Color bgColor;
final Color textColorR;
final String imageName;
RowMultiText(this.title, this.content,
{this.textAlign = TextAlign.right,
this.textColor = MyColours.color_828282,
this.textColorR = MyColours.color_353535,
this.bgColor = MyColours.color_ffffff,
this.imageName});
@override
Widget build(BuildContext context) {
return Container(
color: bgColor,
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(25)),
alignment: Alignment.center,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Align(
alignment: Alignment.centerLeft,
child: Text(
title,
style:
TextStyle(color: textColor, fontSize: ScreenUtil().setSp(30)),
),
),
Expanded(
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
if (imageName != null)
Container(
margin: EdgeInsets.only(right: w(2)),
child: Image.asset(
Utils.getImgPath(imageName),
width: w(20),
)),
Text(content,
style: TextStyle(
color: textColorR,
fontSize: ScreenUtil().setSp(30)),
softWrap: true,
textAlign: this.textAlign),
],
)),
)
],
),
);
}
}