BuildTip typedef

BuildTip = Widget Function(ZTooltipState zTooltip)

create_user: zhengzaihong email:1096877329@qq.com create_date: 2024-04-30 create_time: 14:37 describe: 自定义任何可响应的提示组件 eg:

Implementation

//        ZTooltip(
//           color: Colors.black54,
//           width: 220,
//           height: 60,
//           fixedTip: true,
//           duration: const Duration(
//               milliseconds: 500
//           ),
//           length: 100,
//           buildTip: (tip) => Padding(
//             padding: const EdgeInsets.symmetric(vertical: 3,horizontal: 5),
//             child: Row(
//               children: [
//                 ...['翻译','查询','下载','取消']
//                     .map((e) =>GestureDetector(
//                   onTap: (){
//
//                     RenderBox renderBox = tip.context.findRenderObject() as RenderBox;
//                     final offset = renderBox.localToGlobal(Offset.zero);
//                     Toast.showCustomPoint(
//                     buildToastPoint: (context,style){
//                       return Positioned(
//                         child:style.call(context,'点击了$e'),
//                         left: offset.dx, top: offset.dy+60,);
//                     });
//
//                     tip.close();
//                   },
//                   child:  Row(
//                     children: [
//                       Text(e,style: TextStyle(color: Colors.white,fontSize: 16)),
//                       Visibility(
//                           visible: e != '取消',
//                           child: Container(
//                             margin: EdgeInsets.only(left: 10,top: 4,right: 10),
//                             color: Colors.white,
//                             height: 15,
//                             width: 1,
//                           ))
//                     ],
//                   ),
//                 )).toList(),
//               ],
//             ),
//           ),
//           //需要自定义位置可实现该方法。
//           layout: (zTooltip,offset,child,size){
//             return Positioned(
//                 left: offset.dx,
//                 top: offset.dy+size.height,
//                 child: child);
//           },
//         child: const Text('自定义Tooltip组件')
//       ),


typedef BuildTip = Widget Function(ZTooltipState zTooltip);