Commit 81d0314a76a15abc307d7c0fd8454d3b9f446e87

Authored by 蓋亞光
1 parent 3cf97eb0

历史录入联系人弹框

  1 +import 'package:json_annotation/json_annotation.dart';
  2 +
  3 +part 'user_history_entity.g.dart';
  4 +
  5 +
  6 +@JsonSerializable()
  7 +class UserHistoryEntity extends Object {
  8 +
  9 + @JsonKey(name: 'id')
  10 + String id;
  11 +
  12 + @JsonKey(name: 'sid')
  13 + String sid;
  14 +
  15 + @JsonKey(name: 'rname')
  16 + String rname;
  17 +
  18 + @JsonKey(name: 'sex')
  19 + String sex;
  20 +
  21 + @JsonKey(name: 'phone')
  22 + String phone;
  23 +
  24 + @JsonKey(name: 'cusdem')
  25 + String cusdem;
  26 +
  27 + UserHistoryEntity(this.id,this.sid,this.rname,this.sex,this.phone,this.cusdem,);
  28 +
  29 + factory UserHistoryEntity.fromJson(Map<String, dynamic> srcJson) => _$UserHistoryEntityFromJson(srcJson);
  30 +
  31 + Map<String, dynamic> toJson() => _$UserHistoryEntityToJson(this);
  32 +
  33 +}
  34 +
  35 +
  1 +// GENERATED CODE - DO NOT MODIFY BY HAND
  2 +
  3 +part of 'user_history_entity.dart';
  4 +
  5 +// **************************************************************************
  6 +// JsonSerializableGenerator
  7 +// **************************************************************************
  8 +
  9 +UserHistoryEntity _$UserHistoryEntityFromJson(Map<String, dynamic> json) {
  10 + return UserHistoryEntity(
  11 + json['id'] as String,
  12 + json['sid'] as String,
  13 + json['rname'] as String,
  14 + json['sex'] as String,
  15 + json['phone'] as String,
  16 + json['cusdem'] as String);
  17 +}
  18 +
  19 +Map<String, dynamic> _$UserHistoryEntityToJson(UserHistoryEntity instance) =>
  20 + <String, dynamic>{
  21 + 'id': instance.id,
  22 + 'sid': instance.sid,
  23 + 'rname': instance.rname,
  24 + 'sex': instance.sex,
  25 + 'phone': instance.phone,
  26 + 'cusdem': instance.cusdem
  27 + };
@@ -53,4 +53,7 @@ class HttpUrl { @@ -53,4 +53,7 @@ class HttpUrl {
53 53
54 static const String add_custom_remark= 54 static const String add_custom_remark=
55 "?service=App.User.AddCustomRemark"; //添加常用备注 55 "?service=App.User.AddCustomRemark"; //添加常用备注
  56 +
  57 + static const String get_reserve_user=
  58 + "?service=App.Reserve.GetReserveUser"; //获取历史录入联系人
56 } 59 }
@@ -2,6 +2,7 @@ import 'dart:convert'; @@ -2,6 +2,7 @@ import 'dart:convert';
2 import 'dart:ui'; 2 import 'dart:ui';
3 3
4 import 'package:common_utils/common_utils.dart'; 4 import 'package:common_utils/common_utils.dart';
  5 +
5 // import 'package:contacts_service/contacts_service.dart'; 6 // import 'package:contacts_service/contacts_service.dart';
6 import 'package:flutter/material.dart'; 7 import 'package:flutter/material.dart';
7 import 'package:flutter/services.dart'; 8 import 'package:flutter/services.dart';
@@ -18,6 +19,7 @@ import 'package:one_key/utils/dialog_util.dart'; @@ -18,6 +19,7 @@ import 'package:one_key/utils/dialog_util.dart';
18 import 'package:one_key/utils/event_bus.dart'; 19 import 'package:one_key/utils/event_bus.dart';
19 import 'package:one_key/utils/misc.dart'; 20 import 'package:one_key/utils/misc.dart';
20 import 'package:one_key/utils/navigator_util.dart'; 21 import 'package:one_key/utils/navigator_util.dart';
  22 +import 'package:one_key/utils/triangle_custom_painter.dart';
21 import 'package:one_key/utils/utils.dart'; 23 import 'package:one_key/utils/utils.dart';
22 import 'package:one_key/widgets/MyDivider.dart'; 24 import 'package:one_key/widgets/MyDivider.dart';
23 import 'package:one_key/widgets/app_bar.dart'; 25 import 'package:one_key/widgets/app_bar.dart';
@@ -40,6 +42,7 @@ class NoteBookChangePage extends StatefulWidget { @@ -40,6 +42,7 @@ class NoteBookChangePage extends StatefulWidget {
40 42
41 const NoteBookChangePage({Key key, this.detailEntity, this.rid}) 43 const NoteBookChangePage({Key key, this.detailEntity, this.rid})
42 : super(key: key); 44 : super(key: key);
  45 +
43 @override 46 @override
44 _NoteBookChangePageState createState() => _NoteBookChangePageState(); 47 _NoteBookChangePageState createState() => _NoteBookChangePageState();
45 } 48 }
@@ -55,6 +58,12 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -55,6 +58,12 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
55 RemarkManagerModel remarkManagerModel; 58 RemarkManagerModel remarkManagerModel;
56 String currentRemark = ''; 59 String currentRemark = '';
57 60
  61 + bool showPhoneHistory = false; //显示客户历史记录
  62 +
  63 + String sid = ""; //商户id
  64 +
  65 + ScrollController _controller = ScrollController();
  66 +
58 @override 67 @override
59 void initState() { 68 void initState() {
60 super.initState(); 69 super.initState();
@@ -62,6 +71,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -62,6 +71,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
62 WidgetsBinding.instance.addPostFrameCallback((timeStamp) { 71 WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
63 // _notebookDetailChangeModel = 72 // _notebookDetailChangeModel =
64 // Provider.of<NotebookDetailChangeModel>(context, listen: false); 73 // Provider.of<NotebookDetailChangeModel>(context, listen: false);
  74 + sid = Provider.of<UserModel>(context, listen: false).user.sellerid;
65 _notebookDetailChangeModel.initDateHourMinuteList(context); 75 _notebookDetailChangeModel.initDateHourMinuteList(context);
66 String ddate = widget.detailEntity.ddate.toString() + '000'; 76 String ddate = widget.detailEntity.ddate.toString() + '000';
67 _notebookDetailChangeModel.getNewTableList( 77 _notebookDetailChangeModel.getNewTableList(
@@ -75,23 +85,6 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -75,23 +85,6 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
75 "uid": Provider.of<UserModel>(context, listen: false).user.openid 85 "uid": Provider.of<UserModel>(context, listen: false).user.openid
76 }; 86 };
77 remarkManagerModel.getRemarks(context, params); 87 remarkManagerModel.getRemarks(context, params);
78 - // //输入框焦点  
79 - // _nameNode.addListener(() {  
80 - // if (!_nameNode.hasFocus) {  
81 - // print('失去焦点');  
82 - // } else {  
83 - // print('得到焦点');  
84 - // _phoneNode.unfocus();  
85 - // }  
86 - // });  
87 - // //输入框焦点  
88 - // _phoneNode.addListener(() {  
89 - // if (!_phoneNode.hasFocus) {  
90 - // print('失去焦点');  
91 - // } else {  
92 - // print('得到焦点');  
93 - // }  
94 - // });  
95 }); 88 });
96 } 89 }
97 90
@@ -598,11 +591,34 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -598,11 +591,34 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
598 // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)), 591 // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
599 border: InputBorder.none, 592 border: InputBorder.none,
600 ), 593 ),
601 - onChanged: (value) {}, 594 + onChanged: (value) {
  595 + LogUtil.v("value:$value");
  596 + if (value.isEmpty || value.length >= 11) {
  597 + //内容为空,或 超过11位
  598 + setState(() {
  599 + showPhoneHistory = false;
  600 + _notebookDetailChangeModel.userHistorys.clear();
  601 + });
  602 + return;
  603 + }
  604 + Map<String, String> params = {
  605 + "keywords": value,
  606 + "sid": sid
  607 + };
  608 + _notebookDetailChangeModel.getUserHistorys(context, params);
  609 + },
602 onEditingComplete: () { 610 onEditingComplete: () {
603 print('fff'); 611 print('fff');
604 _phoneNode.unfocus(); 612 _phoneNode.unfocus();
605 }, 613 },
  614 + onTap: () {
  615 + setState(() {
  616 + showPhoneHistory = true;
  617 + });
  618 + Future.delayed(Duration(milliseconds: 300),(){
  619 + _controller.jumpTo(_controller.position.maxScrollExtent);
  620 + });
  621 + },
606 keyboardType: TextInputType.number, 622 keyboardType: TextInputType.number,
607 ), 623 ),
608 ), 624 ),
@@ -637,71 +653,166 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -637,71 +653,166 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
637 ) 653 )
638 ], 654 ],
639 ), 655 ),
640 - VEmptyView(40),  
641 - MyDivider(ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),  
642 - color: MyColours.color_F1F0F4),  
643 - VEmptyView(52),  
644 - Row( 656 + Stack(
645 children: [ 657 children: [
646 - Expanded(  
647 - child: TextField(  
648 - maxLines: 1,  
649 - inputFormatters: [LengthLimitingTextInputFormatter(25)],  
650 - //输入文本的样式  
651 - style: TextStyle(  
652 - fontSize: ScreenUtil().setSp(34),  
653 - color: MyColours.color_353535),  
654 - controller: _notebookDetailChangeModel.customController,  
655 - focusNode: _needNode,  
656 - // textAlignVertical: TextAlignVertical.top,  
657 - decoration: InputDecoration(  
658 - hintText: "客户要求(25字以内,选填)",  
659 - hintStyle: TextStyle(  
660 - color: MyColours.color_999999,  
661 - fontSize: ScreenUtil().setSp(34), 658 + Column(
  659 + mainAxisSize: MainAxisSize.min,
  660 + children: [
  661 + VEmptyView(40),
  662 + MyDivider(
  663 + ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),
  664 + color: MyColours.color_F1F0F4),
  665 + VEmptyView(52),
  666 + Row(
  667 + children: [
  668 + Expanded(
  669 + child: TextField(
  670 + maxLines: 1,
  671 + inputFormatters: [LengthLimitingTextInputFormatter(25)],
  672 + //输入文本的样式
  673 + style: TextStyle(
  674 + fontSize: ScreenUtil().setSp(34),
  675 + color: MyColours.color_353535),
  676 + controller: _notebookDetailChangeModel.customController,
  677 + focusNode: _needNode,
  678 + // textAlignVertical: TextAlignVertical.top,
  679 + decoration: InputDecoration(
  680 + hintText: "客户要求(25字以内,选填)",
  681 + hintStyle: TextStyle(
  682 + color: MyColours.color_999999,
  683 + fontSize: ScreenUtil().setSp(34),
  684 + ),
  685 + // contentPadding:
  686 + // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
  687 + border: InputBorder.none,
  688 + ),
  689 + onChanged: (value) {
  690 + print(value);
  691 + currentRemark = value;
  692 + // print();
  693 + },
  694 + onEditingComplete: () {
  695 + print('fff');
  696 + _needNode.unfocus();
  697 + },
  698 + // keyboardType: TextInputType.number,
  699 + )),
  700 + InkWell(
  701 + onTap: () {
  702 + DialogUtil.showRemarkDialog(
  703 + context, remarkManagerModel.remarks, (item) {
  704 + int index =
  705 + remarkManagerModel.remarks.indexOf(item);
  706 + _refreshRemark(remarkManagerModel.remarks, index);
  707 + });
  708 + },
  709 + child: Container(
  710 + margin:
  711 + EdgeInsets.only(left: ScreenUtil().setWidth(40)),
  712 + width: ScreenUtil().setWidth(122),
  713 + height: ScreenUtil().setWidth(42),
  714 + child: Text(
  715 + '快速备注',
  716 + style: TextStyle(
  717 + fontSize: ScreenUtil().setSp(30),
  718 + color: MyColours.color_199095),
  719 + ),
  720 + ),
  721 + ),
  722 + ],
662 ), 723 ),
663 - // contentPadding:  
664 - // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),  
665 - border: InputBorder.none,  
666 - ),  
667 - onChanged: (value) {  
668 - print(value);  
669 - currentRemark = value;  
670 - // print();  
671 - },  
672 - onEditingComplete: () {  
673 - print('fff');  
674 - _needNode.unfocus();  
675 - },  
676 - // keyboardType: TextInputType.number,  
677 - )),  
678 - InkWell(  
679 - onTap: () {  
680 - DialogUtil.showRemarkDialog(  
681 - context, remarkManagerModel.remarks, (item) {  
682 - int index = remarkManagerModel.remarks.indexOf(item);  
683 - _refreshRemark(remarkManagerModel.remarks, index);  
684 - });  
685 - }, 724 + VEmptyView(40),
  725 + MyDivider(
  726 + ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),
  727 + color: MyColours.color_F1F0F4),
  728 + VEmptyView(30),
  729 + _remarkListWidget()
  730 + ],
  731 + ),
  732 + Offstage(
  733 + offstage: !(showPhoneHistory &&
  734 + _notebookDetailChangeModel.userHistorys.length > 0),
686 child: Container( 735 child: Container(
687 - margin: EdgeInsets.only(left: ScreenUtil().setWidth(40)),  
688 - width: ScreenUtil().setWidth(122),  
689 - height: ScreenUtil().setWidth(42),  
690 - child: Text(  
691 - '快速备注',  
692 - style: TextStyle(  
693 - fontSize: ScreenUtil().setSp(30),  
694 - color: MyColours.color_199095), 736 + decoration: BoxDecoration(
  737 + borderRadius: BorderRadius.circular(8),
  738 + border: Border.all(color: Colors.white),
  739 + color: MyColours.color_ffffff,
  740 + boxShadow: [
  741 + BoxShadow(
  742 + color: MyColours.color_e5e5e5,
  743 + blurRadius: ScreenUtil().setWidth(20))
  744 + ]),
  745 + width: ScreenUtil().setWidth(440),
  746 + height: _notebookDetailChangeModel.userHistorys.length>1?ScreenUtil().setWidth(208):ScreenUtil().setWidth(104),
  747 + padding: EdgeInsets.symmetric(
  748 + horizontal: ScreenUtil().setWidth(30)),
  749 + child: Align(
  750 + alignment: Alignment.topCenter,
  751 + child: MediaQuery.removePadding(context: context, removeTop:true,child: ListView.builder(
  752 + itemBuilder: (context, index) {
  753 + return GestureDetector(
  754 + onTap: () {
  755 + setState(() {
  756 + showPhoneHistory = false;
  757 + _notebookDetailChangeModel
  758 + .phoneController.text =
  759 + _notebookDetailChangeModel
  760 + .userHistorys[index].phone;
  761 + _notebookDetailChangeModel.nameController.text =
  762 + _notebookDetailChangeModel
  763 + .userHistorys[index].rname;
  764 + _phoneNode.unfocus();
  765 + _notebookDetailChangeModel.userHistorys.clear();
  766 + });
  767 + },
  768 + child: Container(
  769 + width: double.infinity,
  770 + height: ScreenUtil().setWidth(102),
  771 + decoration: BoxDecoration(
  772 + border: Border(
  773 + bottom: (index !=
  774 + (_notebookDetailChangeModel
  775 + .userHistorys.length -
  776 + 1) &&
  777 + _notebookDetailChangeModel
  778 + .userHistorys.length >
  779 + 1)
  780 + ? BorderSide(
  781 + color: MyColours.color_e5e5e5,
  782 + width: ScreenUtil().setWidth(2))
  783 + : BorderSide.none)),
  784 + child: Row(
  785 + mainAxisAlignment:
  786 + MainAxisAlignment.spaceBetween,
  787 + children: [
  788 + Text(
  789 + _notebookDetailChangeModel
  790 + .userHistorys[index].phone,
  791 + style: TextStyle(
  792 + color: MyColours.color_333333,
  793 + fontSize: ScreenUtil().setSp(32)),
  794 + ),
  795 + Text(
  796 + _notebookDetailChangeModel
  797 + .userHistorys[index].rname,
  798 + style: TextStyle(
  799 + color: MyColours.color_333333,
  800 + fontSize: ScreenUtil().setSp(32)),
  801 + )
  802 + ],
  803 + ),
  804 + ),
  805 + );
  806 + },
  807 + itemExtent: ScreenUtil().setWidth(104),
  808 + itemCount:
  809 + _notebookDetailChangeModel.userHistorys.length,
  810 + ))
695 ), 811 ),
696 ), 812 ),
697 - ), 813 + )
698 ], 814 ],
699 - ),  
700 - VEmptyView(40),  
701 - MyDivider(ScreenUtil().setWidth(335 * 2), ScreenUtil().setWidth(2),  
702 - color: MyColours.color_F1F0F4),  
703 - VEmptyView(30),  
704 - _remarkListWidget() 815 + )
705 // VEmptyView(62), 816 // VEmptyView(62),
706 ], 817 ],
707 ), 818 ),
@@ -966,7 +1077,6 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -966,7 +1077,6 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
966 } else { 1077 } else {
967 fullName = contact.fullName; 1078 fullName = contact.fullName;
968 } 1079 }
969 -  
970 _notebookDetailChangeModel.phoneController.text = contact.phoneNumber; 1080 _notebookDetailChangeModel.phoneController.text = contact.phoneNumber;
971 _notebookDetailChangeModel.nameController.text = fullName; 1081 _notebookDetailChangeModel.nameController.text = fullName;
972 }); 1082 });
@@ -992,9 +1102,14 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { @@ -992,9 +1102,14 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
992 ), 1102 ),
993 Expanded( 1103 Expanded(
994 child: SingleChildScrollView( 1104 child: SingleChildScrollView(
  1105 + controller: _controller,
995 child: Column( 1106 child: Column(
996 - children: [_topWidget(), _middleWidget(), _bottomWidget()],  
997 - ))), 1107 + children: [
  1108 + _topWidget(),
  1109 + _middleWidget(),
  1110 + _bottomWidget()
  1111 + ],
  1112 + ))),
998 Container( 1113 Container(
999 padding: EdgeInsets.symmetric( 1114 padding: EdgeInsets.symmetric(
1000 horizontal: ScreenUtil().setWidth(40), 1115 horizontal: ScreenUtil().setWidth(40),
@@ -1102,12 +1217,14 @@ class CustomButton extends StatefulWidget { @@ -1102,12 +1217,14 @@ class CustomButton extends StatefulWidget {
1102 this.model, 1217 this.model,
1103 this.height = 25, 1218 this.height = 25,
1104 }) : super(key: key); 1219 }) : super(key: key);
  1220 +
1105 @override 1221 @override
1106 _ButtonState createState() => _ButtonState(); 1222 _ButtonState createState() => _ButtonState();
1107 } 1223 }
1108 1224
1109 class _ButtonState extends State<CustomButton> { 1225 class _ButtonState extends State<CustomButton> {
1110 FocusNode _cancelNode = FocusNode(); 1226 FocusNode _cancelNode = FocusNode();
  1227 +
1111 @override 1228 @override
1112 Widget build(BuildContext context) { 1229 Widget build(BuildContext context) {
1113 String imgStrSelect = widget.isImage && !widget.isTextFiled 1230 String imgStrSelect = widget.isImage && !widget.isTextFiled
@@ -6,6 +6,7 @@ import 'package:one_key/models/notebook_detail.dart'; @@ -6,6 +6,7 @@ import 'package:one_key/models/notebook_detail.dart';
6 import 'package:one_key/models/reserve_info_model.dart'; 6 import 'package:one_key/models/reserve_info_model.dart';
7 import 'package:one_key/models/seller_info.dart'; 7 import 'package:one_key/models/seller_info.dart';
8 import 'package:one_key/models/table_list.dart'; 8 import 'package:one_key/models/table_list.dart';
  9 +import 'package:one_key/models/user_history_entity.dart';
9 import 'package:one_key/net/base_resp.dart'; 10 import 'package:one_key/net/base_resp.dart';
10 import 'package:one_key/net/dio_util.dart'; 11 import 'package:one_key/net/dio_util.dart';
11 import 'package:one_key/net/http_url.dart'; 12 import 'package:one_key/net/http_url.dart';
@@ -15,6 +16,7 @@ import 'package:one_key/utils/utils.dart'; @@ -15,6 +16,7 @@ import 'package:one_key/utils/utils.dart';
15 import 'package:provider/provider.dart'; 16 import 'package:provider/provider.dart';
16 17
17 class NotebookDetailChangeModel with ChangeNotifier { 18 class NotebookDetailChangeModel with ChangeNotifier {
  19 +
18 List dateList = []; //日期选择 月-日 某天 20 List dateList = []; //日期选择 月-日 某天
19 List sunDateList = []; // 早市、午市、晚市 21 List sunDateList = []; // 早市、午市、晚市
20 List personNumList = []; // 人数 22 List personNumList = []; // 人数
@@ -35,6 +37,8 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -35,6 +37,8 @@ class NotebookDetailChangeModel with ChangeNotifier {
35 bool isRecommend = false; //是否展示推荐 37 bool isRecommend = false; //是否展示推荐
36 List oldTableList = []; 38 List oldTableList = [];
37 39
  40 + List<UserHistoryEntity> userHistorys=[];//历史录入
  41 +
38 clearData() { 42 clearData() {
39 dateList = []; //日期选择 月-日 某天 43 dateList = []; //日期选择 月-日 某天
40 sunDateList = []; // 早市、午市、晚市 44 sunDateList = []; // 早市、午市、晚市
@@ -796,4 +800,20 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -796,4 +800,20 @@ class NotebookDetailChangeModel with ChangeNotifier {
796 return itemModel; 800 return itemModel;
797 } 801 }
798 } 802 }
  803 +
  804 + //获取历史录入
  805 + getUserHistorys(BuildContext context, Map<String, String> params) async {
  806 + BaseResp<List> baseResp = await DioUtil()
  807 + .request<List>(context, Method.get, HttpUrl.get_reserve_user,
  808 + data: params, showLoading: false)
  809 + .catchError((error) {
  810 + print(error.toString());
  811 + });
  812 + if (baseResp != null && baseResp.code == Constant.status_success) {
  813 + userHistorys = baseResp.data.map<UserHistoryEntity>((value) {
  814 + return UserHistoryEntity.fromJson(value);
  815 + }).toList();
  816 + notifyListeners();
  817 + }
  818 + }
799 } 819 }
  1 +import 'package:flutter/material.dart';
  2 +
  3 +//自定义 坐标
  4 +class Coordinate {
  5 + final double cx;
  6 + final double cy;
  7 + Coordinate({this.cx, this.cy});
  8 +}
  9 +
  10 +class TriangleCustomPainter extends CustomPainter {
  11 + Paint _paint = new Paint(); //画笔富含各种属性方法。仔细查看源码
  12 + final BuildContext context;
  13 + final List spots;
  14 + final Color color;
  15 +
  16 + TriangleCustomPainter(this.context, this.spots, {this.color});
  17 +
  18 + @override
  19 + void paint(Canvas canvas, Size size) {
  20 + Path path = new Path()..moveTo(spots[0].cx, spots[0].cy);
  21 + path.lineTo(spots[1].cx, spots[1].cy);
  22 + path.lineTo(spots[2].cx, spots[2].cy);
  23 + canvas.drawPath(
  24 + path,
  25 + _paint
  26 + ..style = PaintingStyle.fill
  27 + ..color = color);
  28 + }
  29 +
  30 + @override
  31 + bool shouldRepaint(CustomPainter oldDelegate) {
  32 + return true;
  33 + }
  34 +}