Commit b0668c6ef323e1070ee8a3fd35ce44525ac400b7

Authored by wdn127929
1 parent 28cb2550

缺模版4样式分享

@@ -28,6 +28,7 @@ class MyColours { @@ -28,6 +28,7 @@ class MyColours {
28 static const Color color_80438E93 = Color(0x80438E93); 28 static const Color color_80438E93 = Color(0x80438E93);
29 static const Color color_303030 = Color(0xff303030); 29 static const Color color_303030 = Color(0xff303030);
30 static const Color color_CFB53B = Color(0xffCFB53B); 30 static const Color color_CFB53B = Color(0xffCFB53B);
  31 + static const Color color_66515151 = Color(0x66515151);
31 static const Color color_99515151 = Color(0x99515151); 32 static const Color color_99515151 = Color(0x99515151);
32 static const Color color_F7C797 = Color(0xffF7C797); 33 static const Color color_F7C797 = Color(0xffF7C797);
33 static const Color color_FEF3E6 = Color(0xffFEF3E6); 34 static const Color color_FEF3E6 = Color(0xffFEF3E6);
@@ -2482,16 +2482,16 @@ class Utils { @@ -2482,16 +2482,16 @@ class Utils {
2482 2482
2483 paint.color = MyColours.color_99000000; 2483 paint.color = MyColours.color_99000000;
2484 paint.style = PaintingStyle.fill; 2484 paint.style = PaintingStyle.fill;
2485 - if (Platform.isIOS) {  
2486 - paint.style = PaintingStyle.fill;  
2487 - } 2485 + // if (Platform.isIOS) {
  2486 + // paint.style = PaintingStyle.fill;
  2487 + // }
2488 // 定义源矩形,通常是图像的全部 2488 // 定义源矩形,通常是图像的全部
2489 // final Rect source = Rect.fromLTWH( 2489 // final Rect source = Rect.fromLTWH(
2490 // 0.0, 0.0, images.width.toDouble(), images.height.toDouble()); 2490 // 0.0, 0.0, images.width.toDouble(), images.height.toDouble());
2491 // // 定义目标矩形,即画布的大小 2491 // // 定义目标矩形,即画布的大小
2492 // final Rect destination = Rect.fromLTWH(0.0, 0.0, w(210), w(168)); 2492 // final Rect destination = Rect.fromLTWH(0.0, 0.0, w(210), w(168));
2493 // // 绘制图像 2493 // // 绘制图像
2494 - canvas.drawRect(Rect.fromLTWH(0, 0, 500, 52), paint); 2494 + canvas.drawRect(Rect.fromLTWH(0, 0, 500, 60), paint);
2495 // canvas.drawImageRect(images, source, destination, paint); 2495 // canvas.drawImageRect(images, source, destination, paint);
2496 2496
2497 // 定义源矩形,通常是图像的全部 2497 // 定义源矩形,通常是图像的全部
@@ -2517,8 +2517,8 @@ class Utils { @@ -2517,8 +2517,8 @@ class Utils {
2517 height: 1, 2517 height: 1,
2518 maxLines: 1, 2518 maxLines: 1,
2519 ellipsis: '3', 2519 ellipsis: '3',
2520 - fontSize: 24));  
2521 - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24)); 2520 + fontSize: 38));
  2521 + pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38));
2522 pb2.addText( 2522 pb2.addText(
2523 '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); 2523 '${Provider.of<UserModel>(context, listen: false).user!.sellername}');
2524 2524
@@ -2527,7 +2527,7 @@ class Utils { @@ -2527,7 +2527,7 @@ class Utils {
2527 ui.Paragraph paragraph2 = pb2.build()..layout(pc2); 2527 ui.Paragraph paragraph2 = pb2.build()..layout(pc2);
2528 canvas.drawParagraph(paragraph2, Offset(0, 14)); 2528 canvas.drawParagraph(paragraph2, Offset(0, 14));
2529 2529
2530 - canvas.drawRect(Rect.fromLTWH(0, 348, 500, 52), paint); 2530 + canvas.drawRect(Rect.fromLTWH(0, 340, 500, 60), paint);
2531 2531
2532 // 绘制文字 2532 // 绘制文字
2533 ui.ParagraphBuilder pb = ui.ParagraphBuilder(ui.ParagraphStyle( 2533 ui.ParagraphBuilder pb = ui.ParagraphBuilder(ui.ParagraphStyle(
@@ -2535,14 +2535,14 @@ class Utils { @@ -2535,14 +2535,14 @@ class Utils {
2535 fontWeight: FontWeight.bold, 2535 fontWeight: FontWeight.bold,
2536 fontStyle: FontStyle.normal, 2536 fontStyle: FontStyle.normal,
2537 height: 1, 2537 height: 1,
2538 - fontSize: 24));  
2539 - pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24)); 2538 + fontSize: 38));
  2539 + pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38));
2540 pb.addText(time); 2540 pb.addText(time);
2541 2541
2542 // 设置文本的宽度约束 2542 // 设置文本的宽度约束
2543 ParagraphConstraints pc = ui.ParagraphConstraints(width: 500); 2543 ParagraphConstraints pc = ui.ParagraphConstraints(width: 500);
2544 ui.Paragraph paragraph = pb.build()..layout(pc); 2544 ui.Paragraph paragraph = pb.build()..layout(pc);
2545 - canvas.drawParagraph(paragraph, Offset(0, 362)); 2545 + canvas.drawParagraph(paragraph, Offset(0, 354));
2546 2546
2547 // 绘制文字 2547 // 绘制文字
2548 // ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle( 2548 // ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle(
@@ -2618,8 +2618,8 @@ class Utils { @@ -2618,8 +2618,8 @@ class Utils {
2618 maxLines: 2, 2618 maxLines: 2,
2619 height: 1, 2619 height: 1,
2620 fontStyle: FontStyle.normal, 2620 fontStyle: FontStyle.normal,
2621 - fontSize: 24));  
2622 - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24)); 2621 + fontSize: 428));
  2622 + pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 42));
2623 pb2.addText( 2623 pb2.addText(
2624 '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); 2624 '${Provider.of<UserModel>(context, listen: false).user!.sellername}');
2625 2625
@@ -2634,8 +2634,8 @@ class Utils { @@ -2634,8 +2634,8 @@ class Utils {
2634 fontWeight: FontWeight.bold, 2634 fontWeight: FontWeight.bold,
2635 height: 1, 2635 height: 1,
2636 fontStyle: FontStyle.normal, 2636 fontStyle: FontStyle.normal,
2637 - fontSize: 48));  
2638 - pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 48)); 2637 + fontSize: 86));
  2638 + pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 86));
2639 pb3.addText(month); 2639 pb3.addText(month);
2640 2640
2641 // 设置文本的宽度约束 2641 // 设置文本的宽度约束
@@ -2649,14 +2649,14 @@ class Utils { @@ -2649,14 +2649,14 @@ class Utils {
2649 fontWeight: FontWeight.bold, 2649 fontWeight: FontWeight.bold,
2650 fontStyle: FontStyle.normal, 2650 fontStyle: FontStyle.normal,
2651 height: 1, 2651 height: 1,
2652 - fontSize: 24));  
2653 - pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24)); 2652 + fontSize: 42));
  2653 + pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 42));
2654 pb.addText(time); 2654 pb.addText(time);
2655 2655
2656 // 设置文本的宽度约束 2656 // 设置文本的宽度约束
2657 ParagraphConstraints pc = ui.ParagraphConstraints(width: 500); 2657 ParagraphConstraints pc = ui.ParagraphConstraints(width: 500);
2658 ui.Paragraph paragraph = pb.build()..layout(pc); 2658 ui.Paragraph paragraph = pb.build()..layout(pc);
2659 - canvas.drawParagraph(paragraph, Offset(0, 265)); 2659 + canvas.drawParagraph(paragraph, Offset(0, 285));
2660 2660
2661 //下面的代码是生成图片的关键代码,以上绘制文字和圆圈的代码可以忽略不计 2661 //下面的代码是生成图片的关键代码,以上绘制文字和圆圈的代码可以忽略不计
2662 var picture = 2662 var picture =
@@ -2721,8 +2721,8 @@ class Utils { @@ -2721,8 +2721,8 @@ class Utils {
2721 fontWeight: FontWeight.bold, 2721 fontWeight: FontWeight.bold,
2722 fontStyle: FontStyle.normal, 2722 fontStyle: FontStyle.normal,
2723 maxLines: 2, 2723 maxLines: 2,
2724 - fontSize: 24));  
2725 - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24)); 2724 + fontSize: 38));
  2725 + pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38));
2726 pb2.addText( 2726 pb2.addText(
2727 '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); 2727 '${Provider.of<UserModel>(context, listen: false).user!.sellername}');
2728 2728
@@ -2737,14 +2737,14 @@ class Utils { @@ -2737,14 +2737,14 @@ class Utils {
2737 fontWeight: FontWeight.bold, 2737 fontWeight: FontWeight.bold,
2738 fontStyle: FontStyle.normal, 2738 fontStyle: FontStyle.normal,
2739 height: 1, 2739 height: 1,
2740 - fontSize: 48));  
2741 - pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 48)); 2740 + fontSize: 88));
  2741 + pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 88));
2742 pb3.addText(month); 2742 pb3.addText(month);
2743 2743
2744 // 设置文本的宽度约束 2744 // 设置文本的宽度约束
2745 - ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 170); 2745 + ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 270);
2746 ui.Paragraph paragraph3 = pb3.build()..layout(pc3); 2746 ui.Paragraph paragraph3 = pb3.build()..layout(pc3);
2747 - canvas.drawParagraph(paragraph3, Offset(265, 250)); 2747 + canvas.drawParagraph(paragraph3, Offset(155, 250));
2748 2748
2749 // 绘制文字 2749 // 绘制文字
2750 ui.ParagraphBuilder pb4 = ui.ParagraphBuilder(ui.ParagraphStyle( 2750 ui.ParagraphBuilder pb4 = ui.ParagraphBuilder(ui.ParagraphStyle(
@@ -2752,18 +2752,18 @@ class Utils { @@ -2752,18 +2752,18 @@ class Utils {
2752 height: 1, 2752 height: 1,
2753 fontWeight: FontWeight.bold, 2753 fontWeight: FontWeight.bold,
2754 fontStyle: FontStyle.normal, 2754 fontStyle: FontStyle.normal,
2755 - fontSize: 20));  
2756 - pb4.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 20)); 2755 + fontSize: 38));
  2756 + pb4.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38));
2757 pb4.addText(week); 2757 pb4.addText(week);
2758 2758
2759 // 设置文本的宽度约束 2759 // 设置文本的宽度约束
2760 - ParagraphConstraints pc4 = ui.ParagraphConstraints(width: 30); 2760 + ParagraphConstraints pc4 = ui.ParagraphConstraints(width: 40);
2761 ui.Paragraph paragraph4 = pb4.build()..layout(pc4); 2761 ui.Paragraph paragraph4 = pb4.build()..layout(pc4);
2762 canvas.drawParagraph(paragraph4, Offset(430, 250)); 2762 canvas.drawParagraph(paragraph4, Offset(430, 250));
2763 2763
2764 Rect rect = subType1 == '1' 2764 Rect rect = subType1 == '1'
2765 - ? Rect.fromLTWH(315, 310, 140, 38)  
2766 - : Rect.fromLTWH(386, 310, 67, 37); 2765 + ? Rect.fromLTWH(250, 340, 220, 50)
  2766 + : Rect.fromLTWH(362, 340, 104, 50);
2767 paint.color = MyColours.color_66FFEFC5; 2767 paint.color = MyColours.color_66FFEFC5;
2768 RRect rRect = RRect.fromRectAndRadius(rect, Radius.circular(6)); 2768 RRect rRect = RRect.fromRectAndRadius(rect, Radius.circular(6));
2769 canvas.drawRRect(rRect, paint); 2769 canvas.drawRRect(rRect, paint);
@@ -2775,13 +2775,13 @@ class Utils { @@ -2775,13 +2775,13 @@ class Utils {
2775 fontWeight: FontWeight.bold, 2775 fontWeight: FontWeight.bold,
2776 height: 1, 2776 height: 1,
2777 fontStyle: FontStyle.normal, 2777 fontStyle: FontStyle.normal,
2778 - fontSize: 24));  
2779 - pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24)); 2778 + fontSize: 38));
  2779 + pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38));
2780 pb.addText(time); 2780 pb.addText(time);
2781 2781
2782 // 设置文本的宽度约束 2782 // 设置文本的宽度约束
2783 - double width = subType1 == '1' ? 200 : 114;  
2784 - Offset offset = subType1 == '1' ? Offset(285, 320) : Offset(360, 318); 2783 + double width = subType1 == '1' ? 240 : 154;
  2784 + Offset offset = subType1 == '1' ? Offset(241, 349) : Offset(340, 349);
2785 ParagraphConstraints pc = ui.ParagraphConstraints(width: width); 2785 ParagraphConstraints pc = ui.ParagraphConstraints(width: width);
2786 ui.Paragraph paragraph = pb.build()..layout(pc); 2786 ui.Paragraph paragraph = pb.build()..layout(pc);
2787 canvas.drawParagraph(paragraph, offset); 2787 canvas.drawParagraph(paragraph, offset);
@@ -2846,19 +2846,19 @@ class Utils { @@ -2846,19 +2846,19 @@ class Utils {
2846 // } 2846 // }
2847 // 绘制文字 2847 // 绘制文字
2848 ui.ParagraphBuilder pb2 = ui.ParagraphBuilder(ui.ParagraphStyle( 2848 ui.ParagraphBuilder pb2 = ui.ParagraphBuilder(ui.ParagraphStyle(
2849 - textAlign: TextAlign.left, 2849 + textAlign: TextAlign.center,
2850 fontWeight: FontWeight.bold, 2850 fontWeight: FontWeight.bold,
2851 fontStyle: FontStyle.normal, 2851 fontStyle: FontStyle.normal,
2852 maxLines: 1, 2852 maxLines: 1,
2853 - fontSize: 20));  
2854 - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 20)); 2853 + fontSize: 38));
  2854 + pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38));
2855 pb2.addText( 2855 pb2.addText(
2856 '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); 2856 '${Provider.of<UserModel>(context, listen: false).user!.sellername}');
2857 2857
2858 // 设置文本的宽度约束 2858 // 设置文本的宽度约束
2859 - ParagraphConstraints pc2 = ui.ParagraphConstraints(width: 320); 2859 + ParagraphConstraints pc2 = ui.ParagraphConstraints(width: 500);
2860 ui.Paragraph paragraph2 = pb2.build()..layout(pc2); 2860 ui.Paragraph paragraph2 = pb2.build()..layout(pc2);
2861 - canvas.drawParagraph(paragraph2, Offset(20, 337)); 2861 + canvas.drawParagraph(paragraph2, Offset(0, 280));
2862 2862
2863 // 绘制文字 2863 // 绘制文字
2864 ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle( 2864 ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle(
@@ -2866,8 +2866,8 @@ class Utils { @@ -2866,8 +2866,8 @@ class Utils {
2866 height: 1, 2866 height: 1,
2867 fontWeight: FontWeight.bold, 2867 fontWeight: FontWeight.bold,
2868 fontStyle: FontStyle.normal, 2868 fontStyle: FontStyle.normal,
2869 - fontSize: 20));  
2870 - pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 20)); 2869 + fontSize: 38));
  2870 + pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 38));
2871 pb3.addText(month); 2871 pb3.addText(month);
2872 2872
2873 // 设置文本的宽度约束 2873 // 设置文本的宽度约束
@@ -2933,34 +2933,46 @@ class Utils { @@ -2933,34 +2933,46 @@ class Utils {
2933 var canvas = new Canvas(pictureRecorder); //canvas接受一个图片记录仪 2933 var canvas = new Canvas(pictureRecorder); //canvas接受一个图片记录仪
2934 var images = await loadImage(_thumbnail, true); // 使用方法获取Unit8List格式的图片 2934 var images = await loadImage(_thumbnail, true); // 使用方法获取Unit8List格式的图片
2935 print(images); 2935 print(images);
  2936 +
2936 Paint paint = Paint() 2937 Paint paint = Paint()
2937 - ..color = Color.fromRGBO(81, 81, 81, 0.4) 2938 + ..color = MyColours.color_66515151
2938 ..style = PaintingStyle.fill; 2939 ..style = PaintingStyle.fill;
2939 if (Platform.isIOS) { 2940 if (Platform.isIOS) {
2940 paint = Paint()..style = PaintingStyle.fill; 2941 paint = Paint()..style = PaintingStyle.fill;
2941 } 2942 }
2942 - // 定义源矩形,通常是图像的全部  
2943 - final Rect source = Rect.fromLTWH(  
2944 - 0.0, 0.0, images.width.toDouble(), images.height.toDouble());  
2945 - // 定义目标矩形,即画布的大小  
2946 - final Rect destination = Rect.fromLTWH(0.0, 0.0, 500, 400);  
2947 - // 绘制图像  
2948 - canvas.drawImageRect(images, source, destination, paint);  
2949 - if (Platform.isIOS) {  
2950 - final paint1 = Paint()  
2951 - ..color = Colors.black.withOpacity(0.6)  
2952 - ..maskFilter = MaskFilter.blur(BlurStyle.normal, 5.0)  
2953 - ..style = PaintingStyle.fill;  
2954 - // 绘制一个矩形作为蒙版  
2955 - canvas.drawRect(Rect.fromLTRB(0, 0, 500, 400), paint1);  
2956 - } 2943 + canvas.drawImage(images, Offset.zero, paint); //绘制原始图片
  2944 +
  2945 + // paint.color = MyColours.color_99000000;
  2946 + // paint.style = PaintingStyle.fill;
  2947 + // if (Platform.isIOS) {
  2948 + // paint.style = PaintingStyle.fill;
  2949 + // }
  2950 + // // 绘制图像
  2951 + canvas.drawRect(Rect.fromLTWH(0, 0, 500, 400), paint);
  2952 +
  2953 + // // 定义源矩形,通常是图像的全部
  2954 + // final Rect source = Rect.fromLTWH(
  2955 + // 0.0, 0.0, images.width.toDouble(), images.height.toDouble());
  2956 + // // 定义目标矩形,即画布的大小
  2957 + // final Rect destination = Rect.fromLTWH(0.0, 0.0, 500, 400);
  2958 + // // 绘制图像
  2959 + // canvas.drawImageRect(images, source, destination, paint);
  2960 + // if (Platform.isIOS) {
  2961 + // final paint1 = Paint()
  2962 + // ..color = Colors.black.withOpacity(0.6)
  2963 + // ..maskFilter = MaskFilter.blur(BlurStyle.normal, 5.0)
  2964 + // ..style = PaintingStyle.fill;
  2965 + // // 绘制一个矩形作为蒙版
  2966 + // // canvas.drawRect(Rect.fromLTRB(0, 0, 500, 400), paint1);
  2967 + // }
2957 // 绘制文字 2968 // 绘制文字
2958 ui.ParagraphBuilder pb2 = ui.ParagraphBuilder(ui.ParagraphStyle( 2969 ui.ParagraphBuilder pb2 = ui.ParagraphBuilder(ui.ParagraphStyle(
2959 textAlign: TextAlign.center, 2970 textAlign: TextAlign.center,
2960 fontWeight: FontWeight.normal, 2971 fontWeight: FontWeight.normal,
2961 fontStyle: FontStyle.normal, 2972 fontStyle: FontStyle.normal,
2962 - fontSize: 26));  
2963 - pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 26)); 2973 + height: 1,
  2974 + fontSize: 28));
  2975 + pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 28));
2964 pb2.addText( 2976 pb2.addText(
2965 '${Provider.of<UserModel>(context, listen: false).user!.sellername}'); 2977 '${Provider.of<UserModel>(context, listen: false).user!.sellername}');
2966 2978
@@ -2973,34 +2985,47 @@ class Utils { @@ -2973,34 +2985,47 @@ class Utils {
2973 ui.ParagraphBuilder pb = ui.ParagraphBuilder(ui.ParagraphStyle( 2985 ui.ParagraphBuilder pb = ui.ParagraphBuilder(ui.ParagraphStyle(
2974 textAlign: TextAlign.center, 2986 textAlign: TextAlign.center,
2975 fontWeight: FontWeight.bold, 2987 fontWeight: FontWeight.bold,
  2988 + height: 1,
2976 fontStyle: FontStyle.normal, 2989 fontStyle: FontStyle.normal,
2977 - fontSize: 48));  
2978 - pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 48)); 2990 + fontSize: 72));
  2991 + pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 72));
2979 pb.addText(month); 2992 pb.addText(month);
2980 2993
2981 // 设置文本的宽度约束 2994 // 设置文本的宽度约束
2982 ParagraphConstraints pc = ui.ParagraphConstraints(width: 500); 2995 ParagraphConstraints pc = ui.ParagraphConstraints(width: 500);
2983 ui.Paragraph paragraph = pb.build()..layout(pc); 2996 ui.Paragraph paragraph = pb.build()..layout(pc);
2984 - canvas.drawParagraph(paragraph, Offset(10, 150)); 2997 + canvas.drawParagraph(paragraph, Offset(10, 160));
2985 2998
2986 // 绘制文字 2999 // 绘制文字
2987 ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle( 3000 ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle(
2988 textAlign: TextAlign.center, 3001 textAlign: TextAlign.center,
  3002 + height: 1,
2989 fontWeight: FontWeight.bold, 3003 fontWeight: FontWeight.bold,
2990 fontStyle: FontStyle.normal, 3004 fontStyle: FontStyle.normal,
2991 - fontSize: 42));  
2992 - pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 42)); 3005 + fontSize: 36));
  3006 + pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 36));
2993 pb3.addText(week); 3007 pb3.addText(week);
2994 3008
2995 // 设置文本的宽度约束 3009 // 设置文本的宽度约束
2996 ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 500); 3010 ParagraphConstraints pc3 = ui.ParagraphConstraints(width: 500);
2997 ui.Paragraph paragraph3 = pb3.build()..layout(pc3); 3011 ui.Paragraph paragraph3 = pb3.build()..layout(pc3);
2998 - canvas.drawParagraph(paragraph3, Offset(10, 230)); 3012 + canvas.drawParagraph(paragraph3, Offset(10, 260));
2999 3013
3000 //下面的代码是生成图片的关键代码,以上绘制文字和圆圈的代码可以忽略不计 3014 //下面的代码是生成图片的关键代码,以上绘制文字和圆圈的代码可以忽略不计
3001 - var picture = await pictureRecorder  
3002 - .endRecording()  
3003 - .toImage(w(210).toInt(), w(168).toInt()); //设置生成图片的宽和高 3015 + // var picture = await pictureRecorder
  3016 + // .endRecording()
  3017 + // .toImage(w(210).toInt(), w(168).toInt()); //设置生成图片的宽和高
  3018 + // var pngImageBytes =
  3019 + // (await picture.toByteData(format: ui.ImageByteFormat.png))!;
  3020 + // // var imgBytes = Uint8List.view(pngImageBytes.buffer); //这一行和下面这一行都是生成Uint8List格式的图片(原理还不知道)
  3021 + // Uint8List pngBytes = pngImageBytes.buffer.asUint8List();
  3022 + // print(pngBytes); //pngBytes可以放在Image.memory()中预览
  3023 +
  3024 + // Uint8List result = await realComporessList(pngBytes); //压缩图片
  3025 + // return result;
  3026 + //下面的代码是生成图片的关键代码,以上绘制文字和圆圈的代码可以忽略不计
  3027 + var picture =
  3028 + await pictureRecorder.endRecording().toImage(500, 400); //设置生成图片的宽和高
3004 var pngImageBytes = 3029 var pngImageBytes =
3005 (await picture.toByteData(format: ui.ImageByteFormat.png))!; 3030 (await picture.toByteData(format: ui.ImageByteFormat.png))!;
3006 // var imgBytes = Uint8List.view(pngImageBytes.buffer); //这一行和下面这一行都是生成Uint8List格式的图片(原理还不知道) 3031 // var imgBytes = Uint8List.view(pngImageBytes.buffer); //这一行和下面这一行都是生成Uint8List格式的图片(原理还不知道)
@@ -3217,50 +3242,61 @@ class Utils { @@ -3217,50 +3242,61 @@ class Utils {
3217 //画图 3242 //画图
3218 // 4种情况的图分别画出来 3243 // 4种情况的图分别画出来
3219 if (liteStyle == '1' || liteStyle == '2' || liteStyle == '3') { 3244 if (liteStyle == '1' || liteStyle == '2' || liteStyle == '3') {
3220 - liteStyle = '2-4';  
3221 - }  
3222 - List<String> subType = liteStyle!.split('-');  
3223 - String subType0 = subType[0]; //几号模版  
3224 - if (subType0 == '1') {  
3225 - _thumbnailUint8List = await canvas( 3245 + String month =
  3246 + '${Utils.addZeroNumber(dateTime.month)}月${Utils.addZeroNumber(dateTime.day)}日';
  3247 + String weekAndDsolt = returnWeek(dateTime, context) +
  3248 + _getDsoltStrShow(ddateSolt, isCan: liteStyle == '1' ? false : true);
  3249 + _thumbnailUint8List = await canvasold(
3226 context, 3250 context,
3227 sellerImage == null || sellerImage == '' 3251 sellerImage == null || sellerImage == ''
3228 ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png' 3252 ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
3229 : sellerImage, 3253 : sellerImage,
3230 - dateTime,  
3231 - liteStyle,  
3232 - ddateSolt,  
3233 - ddateHm);  
3234 - } else if (subType0 == '2') {  
3235 - _thumbnailUint8List = await canvas2(  
3236 - context,  
3237 - sellerImage == null || sellerImage == ''  
3238 - ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'  
3239 - : sellerImage,  
3240 - dateTime,  
3241 - liteStyle,  
3242 - ddateSolt,  
3243 - ddateHm);  
3244 - } else if (subType0 == '3') {  
3245 - _thumbnailUint8List = await canvas3(  
3246 - context,  
3247 - sellerImage == null || sellerImage == ''  
3248 - ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'  
3249 - : sellerImage,  
3250 - dateTime,  
3251 - liteStyle,  
3252 - ddateSolt,  
3253 - ddateHm); 3254 + month,
  3255 + weekAndDsolt);
3254 } else { 3256 } else {
3255 - _thumbnailUint8List = await canvas4(  
3256 - context,  
3257 - sellerImage == null || sellerImage == ''  
3258 - ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'  
3259 - : sellerImage,  
3260 - dateTime,  
3261 - liteStyle,  
3262 - ddateSolt,  
3263 - ddateHm); 3257 + List<String> subType = liteStyle!.split('-');
  3258 + String subType0 = subType[0]; //几号模版
  3259 + if (subType0 == '1') {
  3260 + _thumbnailUint8List = await canvas(
  3261 + context,
  3262 + sellerImage == null || sellerImage == ''
  3263 + ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
  3264 + : sellerImage,
  3265 + dateTime,
  3266 + liteStyle,
  3267 + ddateSolt,
  3268 + ddateHm);
  3269 + } else if (subType0 == '2') {
  3270 + _thumbnailUint8List = await canvas2(
  3271 + context,
  3272 + sellerImage == null || sellerImage == ''
  3273 + ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
  3274 + : sellerImage,
  3275 + dateTime,
  3276 + liteStyle,
  3277 + ddateSolt,
  3278 + ddateHm);
  3279 + } else if (subType0 == '3') {
  3280 + _thumbnailUint8List = await canvas3(
  3281 + context,
  3282 + sellerImage == null || sellerImage == ''
  3283 + ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
  3284 + : sellerImage,
  3285 + dateTime,
  3286 + liteStyle,
  3287 + ddateSolt,
  3288 + ddateHm);
  3289 + } else {
  3290 + _thumbnailUint8List = await canvas4(
  3291 + context,
  3292 + sellerImage == null || sellerImage == ''
  3293 + ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
  3294 + : sellerImage,
  3295 + dateTime,
  3296 + liteStyle,
  3297 + ddateSolt,
  3298 + ddateHm);
  3299 + }
3264 } 3300 }
3265 } 3301 }
3266 String _title = liteStyleTitle ?? 3302 String _title = liteStyleTitle ??