|
...
|
...
|
@@ -2781,7 +2781,7 @@ class Utils { |
|
|
|
|
|
|
|
// 设置文本的宽度约束
|
|
|
|
double width = subType1 == '1' ? 240 : 154;
|
|
|
|
Offset offset = subType1 == '1' ? Offset(241, 349) : Offset(340, 349);
|
|
|
|
Offset offset = subType1 == '1' ? Offset(241, 349) : Offset(338, 349);
|
|
|
|
ParagraphConstraints pc = ui.ParagraphConstraints(width: width);
|
|
|
|
ui.Paragraph paragraph = pb.build()..layout(pc);
|
|
|
|
canvas.drawParagraph(paragraph, offset);
|
|
...
|
...
|
@@ -2813,7 +2813,7 @@ class Utils { |
|
|
|
String subType1 = subType[1]; //模版下面的子样式
|
|
|
|
|
|
|
|
String month =
|
|
|
|
'${Utils.addZeroNumber(date.month)}/${Utils.addZeroNumber(date.day)}';
|
|
|
|
'${Utils.addZeroNumber(date.month)}/${Utils.addZeroNumber(date.day)} ';
|
|
|
|
String week = returnWeek(date, context);
|
|
|
|
String hour = subType1 == '1' || subType1 == '3' ? '${ddateHm}' : '';
|
|
|
|
String section = subType1 == '1' || subType1 == '4'
|
|
...
|
...
|
@@ -2823,7 +2823,7 @@ class Utils { |
|
|
|
: '';
|
|
|
|
|
|
|
|
if (section != '' && hour != '') {
|
|
|
|
hour = hour + ' ';
|
|
|
|
hour = hour + ' ';
|
|
|
|
}
|
|
|
|
|
|
|
|
String time = hour + section;
|
|
...
|
...
|
@@ -2834,7 +2834,7 @@ class Utils { |
|
|
|
// paint.style = PaintingStyle.fill;
|
|
|
|
// }
|
|
|
|
// // 绘制图像
|
|
|
|
canvas.drawRect(Rect.fromLTWH(0, 300, 500, 100), paint);
|
|
|
|
canvas.drawRect(Rect.fromLTWH(0, 267, 500, 133), paint);
|
|
|
|
|
|
|
|
// if (Platform.isIOS) {
|
|
|
|
// final paint1 = Paint()
|
|
...
|
...
|
@@ -2858,7 +2858,7 @@ class Utils { |
|
|
|
// 设置文本的宽度约束
|
|
|
|
ParagraphConstraints pc2 = ui.ParagraphConstraints(width: 500);
|
|
|
|
ui.Paragraph paragraph2 = pb2.build()..layout(pc2);
|
|
|
|
canvas.drawParagraph(paragraph2, Offset(0, 280));
|
|
|
|
canvas.drawParagraph(paragraph2, Offset(0, 275));
|
|
|
|
|
|
|
|
// 绘制文字
|
|
|
|
ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle(
|
|
...
|
...
|
@@ -2868,29 +2868,30 @@ class Utils { |
|
|
|
fontStyle: FontStyle.normal,
|
|
|
|
fontSize: 38));
|
|
|
|
pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38));
|
|
|
|
pb3.addText(month);
|
|
|
|
pb3.addText(month + week);
|
|
|
|
|
|
|
|
// 设置文本的宽度约束
|
|
|
|
ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 80);
|
|
|
|
ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 240);
|
|
|
|
ui.Paragraph paragraph3 = pb3.build()..layout(pc3);
|
|
|
|
canvas.drawParagraph(paragraph3, Offset(340, 320));
|
|
|
|
canvas.drawParagraph(paragraph3, Offset(subType1 == '1' ? 8 : 65, 345));
|
|
|
|
|
|
|
|
// 绘制文字
|
|
|
|
ui.ParagraphBuilder pb4 = ui.ParagraphBuilder(ui.ParagraphStyle(
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
height: 1,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontStyle: FontStyle.normal,
|
|
|
|
fontSize: 20));
|
|
|
|
pb4.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 20));
|
|
|
|
pb4.addText(week);
|
|
|
|
// // 绘制文字
|
|
|
|
// ui.ParagraphBuilder pb4 = ui.ParagraphBuilder(ui.ParagraphStyle(
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
// height: 1,
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
// fontStyle: FontStyle.normal,
|
|
|
|
// fontSize: 20));
|
|
|
|
// pb4.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 20));
|
|
|
|
// pb4.addText(week);
|
|
|
|
|
|
|
|
// 设置文本的宽度约束
|
|
|
|
ParagraphConstraints pc4 = ui.ParagraphConstraints(width: 50);
|
|
|
|
ui.Paragraph paragraph4 = pb4.build()..layout(pc4);
|
|
|
|
canvas.drawParagraph(paragraph4, Offset(420, 320));
|
|
|
|
// // 设置文本的宽度约束
|
|
|
|
// ParagraphConstraints pc4 = ui.ParagraphConstraints(width: 50);
|
|
|
|
// ui.Paragraph paragraph4 = pb4.build()..layout(pc4);
|
|
|
|
// canvas.drawParagraph(paragraph4, Offset(420, 320));
|
|
|
|
|
|
|
|
Rect rect = Rect.fromLTWH(350, 348, 118, 30);
|
|
|
|
Rect rect = Rect.fromLTWH(
|
|
|
|
subType1 == '1' ? 265 : 315, 335, subType1 == '1' ? 210 : 112, 50);
|
|
|
|
paint.color = MyColours.color_66FFEFC5;
|
|
|
|
RRect rRect = RRect.fromRectAndRadius(rect, Radius.circular(6));
|
|
|
|
canvas.drawRRect(rRect, paint);
|
|
...
|
...
|
@@ -2903,14 +2904,15 @@ class Utils { |
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
height: 1,
|
|
|
|
fontStyle: FontStyle.normal,
|
|
|
|
fontSize: 20));
|
|
|
|
pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 20));
|
|
|
|
fontSize: 38));
|
|
|
|
pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38));
|
|
|
|
pb.addText(time);
|
|
|
|
|
|
|
|
// 设置文本的宽度约束
|
|
|
|
|
|
|
|
Offset offset = subType1 == '1' ? Offset(348, 353) : Offset(348, 353);
|
|
|
|
ParagraphConstraints pc = ui.ParagraphConstraints(width: 118);
|
|
|
|
Offset offset = subType1 == '1' ? Offset(265, 345) : Offset(315, 345);
|
|
|
|
ParagraphConstraints pc =
|
|
|
|
ui.ParagraphConstraints(width: subType1 == '1' ? 210 : 112);
|
|
|
|
ui.Paragraph paragraph = pb.build()..layout(pc);
|
|
|
|
canvas.drawParagraph(paragraph, offset);
|
|
|
|
|
|
...
|
...
|
@@ -2934,13 +2936,13 @@ class Utils { |
|
|
|
var images = await loadImage(_thumbnail, true); // 使用方法获取Unit8List格式的图片
|
|
|
|
print(images);
|
|
|
|
|
|
|
|
Paint paint = Paint()
|
|
|
|
..color = MyColours.color_66515151
|
|
|
|
..style = PaintingStyle.fill;
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
paint = Paint()..style = PaintingStyle.fill;
|
|
|
|
}
|
|
|
|
canvas.drawImage(images, Offset.zero, paint); //绘制原始图片
|
|
|
|
final Paint paint = Paint();
|
|
|
|
canvas.drawImage(images, Offset.zero, paint); //绘制原始图片 Paint paint = Paint()
|
|
|
|
paint.color = MyColours.color_99000000;
|
|
|
|
paint.style = PaintingStyle.fill;
|
|
|
|
// if (Platform.isIOS) {
|
|
|
|
// paint = Paint()..style = PaintingStyle.fill;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// paint.color = MyColours.color_99000000;
|
|
|
|
// paint.style = PaintingStyle.fill;
|
...
|
...
|
|