{"id":365867,"date":"2024-05-21T02:47:10","date_gmt":"2024-05-21T02:47:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=365867"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T02:47:10","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=365867","title":{"rendered":"<span>\u041a\u0430\u043a \u044f \u043f\u043e\u0432\u044b\u0441\u0438\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c flutter \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e FragmentShader. \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042f flutter \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0441\u044c \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u0434 iOS \u0438 Android. \u041d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u0444\u0435\u0440\u044b \u0440\u0430\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0439 \u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0444\u0438\u0447\u0430, \u0433\u0434\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u044f \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u043f\u043e \u044d\u043a\u0440\u0430\u043d\u0443 \u0440\u0438\u0441\u0443\u0435\u0448\u044c \u043b\u0438\u043d\u0438\u044e:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/26f\/81c\/ba5\/26f81cba5f0502e1db4fd630edbd936f.gif\" width=\"296\" height=\"640\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/26f\/81c\/ba5\/26f81cba5f0502e1db4fd630edbd936f.gif\"\/><\/figure>\n<p>\u041d\u0430\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u0434\u0443\u043c\u0430\u043b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043b\u0438\u043d\u0438\u0438 (\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u0435\u043a, \u0446\u0432\u0435\u0442 \u0438 \u0442\u043e\u043b\u0449\u0438\u043d\u0430)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"dart\">class LineObject {   final List&lt;Offset> points;   final Color color;   final double strokeWidth;    const LineObject({     required this.points,     this.color = Colors.red,     this.strokeWidth = 20.0,   }); }<\/code><\/pre>\n<ul>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b <code>FingerPainter<\/code> \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 <code>CustomPaint<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043b \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u043d\u0438\u0439<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"dart\">class FingerPainter extends CustomPainter {   final List&lt;LineObject> lines;   const FingerPainter({     required this.lines,   });    @override   void paint(Canvas canvas, Size size) {     for (int index = 0; index &lt; lines.length; index++) {       final line = lines[index];       final paint = Paint()         ..style = PaintingStyle.stroke         ..color = line.color         ..strokeWidth = line.strokeWidth         ..strokeCap = StrokeCap.round;        for (var i = 0; i &lt; line.points.length - 1; i++) {         canvas.drawLine(line.points[i], line.points[i + 1], paint);       }     }   }    @override   bool shouldRepaint(FingerPainter oldDelegate) => true; }<\/code><\/pre>\n<ul>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0441\u0430\u043c \u044d\u043a\u0440\u0430\u043d \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"dart\">class FingerPainterScreen extends StatefulWidget {   const FingerPainterScreen({super.key});    @override   State&lt;FingerPainterScreen> createState() => _FingerPainterScreenState(); }  class _FingerPainterScreenState extends State&lt;FingerPainterScreen> {   final List&lt;LineObject> lines = [];    void _onClearLines() {     setState(() {       lines.clear();     });   }    void _onPanUpdate(DragUpdateDetails details) {     setState(() {       lines.last.points.add(details.localPosition);     });   }    void _onPanStart(DragStartDetails details) {     setState(() {       lines.add(LineObject(points: [details.localPosition]));     });   }    @override   Widget build(BuildContext context) {     return Scaffold(       floatingActionButton: FloatingActionButton(         onPressed: _onClearLines,         child: const Icon(Icons.clear),       ),       body: GestureDetector(         onPanStart: _onPanStart,         onPanUpdate: _onPanUpdate,         child: CustomPaint(           size: MediaQuery.sizeOf(context),           painter: FingerPainter(             lines: lines,           ),         ),       ),     );   } }<\/code><\/pre>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430. \u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c, \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u2026<\/p>\n<hr\/>\n<h4>\u041a\u0430\u043a\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438?<\/h4>\n<p>\u041f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u0434-\u0440\u0435\u0432\u044c\u044e \u0441\u0432\u043e\u0435\u0433\u043e \u0436\u0435 \u043a\u043e\u0434\u0430.\u00a0<\/p>\n<p><strong>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u0440\u0438\u0441\u0443\u0435\u043c \u0432\u0441\u0435 \u043b\u0438\u043d\u0438\u0438 \u0441\u0440\u0430\u0437\u0443.<\/strong> \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 <code>paint<\/code> \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0446\u0438\u043a\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u0430\u044f \u043b\u0438\u043d\u0438\u044f \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0437\u0430\u0434\u0430\u0447\u0443 <code>FingerPainter<\/code> \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043b\u0438\u043d\u0438\u044e:<\/p>\n<pre><code class=\"dart\">class FingerPainter extends CustomPainter {   final LineObject line;   const FingerPainter({     required this.line,   });    @override   void paint(Canvas canvas, Size size) {     final paint = Paint()       ..style = PaintingStyle.stroke       ..color = line.color       ..strokeWidth = line.strokeWidth       ..strokeCap = StrokeCap.round;      for (var i = 0; i &lt; line.points.length - 1; i++) {       canvas.drawLine(line.points[i], line.points[i + 1], paint);     }   }    @override   bool shouldRepaint(FingerPainter oldDelegate) => true; }<\/code><\/pre>\n<p>\u041f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435:<\/p>\n<pre><code class=\"dart\">  @override   Widget build(BuildContext context) {     return Scaffold(       floatingActionButton: FloatingActionButton(         onPressed: _onClearLines,         child: const Icon(Icons.clear),       ),       body: GestureDetector(         behavior: HitTestBehavior.opaque,         onPanStart: _onPanStart,         onPanUpdate: _onPanUpdate,         child: Stack(           children: [             for (int index = 0; index &lt; lines.length; index++)               CustomPaint(                 size: MediaQuery.sizeOf(context),                 painter: FingerPainter(                   line: lines[index],                 ),               ),           ],         ),       ),     );   }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0446\u0438\u043a\u043b \u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0435 <code>Stack<\/code>. \u0412 <code>GestureDetector<\/code> \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043e \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 <code>behavior<\/code> \u043d\u0430 <code>HitTestBehavior.opaque<\/code>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, <code>GestureDetector<\/code> \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 child, \u0438\u043b\u0438 \u0436\u0435 children \u0432 \u0441\u0442\u0435\u043a\u0435. \u0415\u0441\u043b\u0438 children \u043d\u0435\u0442, \u0442\u043e \u0438 \u043d\u043e\u0432\u044b\u0435 \u043b\u0438\u043d\u0438\u0438 \u0442\u043e\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442. <br \/>\u041f\u043e\u0447\u0435\u043c\u0443 \u043b\u0443\u0447\u0448\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0446\u0438\u043a\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0441\u0442\u0435\u043a\u0435? \u042f \u0432\u0435\u0440\u043d\u0443\u0441\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p><strong>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, shouldRepaint \u0432\u0441\u0435\u0433\u0434\u0430 true.<\/strong> \u042d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c, \u043a\u043e\u0433\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442 (\u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>paint<\/code>). \u0415\u0441\u043b\u0438 \u043e\u043d \u0432\u0441\u0435\u0433\u0434\u0430 <code>true<\/code>, \u0442\u043e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0447\u0438\u0445\u0435 \u0438\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0437\u043e\u0432\u0435 build \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043a\u0430, \u0438 \u0432\u0441\u0435 N \u043b\u0438\u043d\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043e\u0447\u0435\u043a \u0432 \u043b\u0438\u043d\u0438\u0438.<\/p>\n<pre><code class=\"dart\">  @override   bool shouldRepaint(FingerPainter oldDelegate) {     return line.points.length != oldDelegate.line.points.length;   }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e, \u043a\u0430\u043a \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0442\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043e\u043f\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0443\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u0438\u043d\u0438\u0438. \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 false.\u00a0<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e class <code>LineObject<\/code> \u043d\u0435 \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0439, \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 <code>List&lt;Offset> points<\/code> \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0443\u0433\u0440\u044b\u0437\u0435\u043d\u0438\u0439 \u0441\u043e\u0432\u0435\u0441\u0442\u0438. \u0412\u0440\u043e\u0434\u0435, \u0432 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u043d\u0435\u0442 \u0434\u043e \u043f\u043e\u0440\u044b \u0434\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <code>LineObject<\/code>, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0435\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 (\u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441) \u043d\u0430 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u0441\u0435\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 points, \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0435, \u0432 \u0442\u043e\u043c \u0436\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u0438.\u00a0<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 <code>FingerPainter<\/code> \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 <code>LineObject<\/code>, \u0442\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>shouldRepaint<\/code>, \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0443. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 <code>points<\/code> \u0438\u043c\u0435\u0435\u0442 \u0442\u0443 \u0436\u0435 \u0434\u043b\u0438\u043d\u0443.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 freezed. \u0422\u043e\u0433\u0434\u0430 \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0434\u0443\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043f\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043c\u0435\u0442\u043e\u0434 <code>copyWith<\/code>:<\/p>\n<pre><code class=\"dart\">class LineObject {   final List&lt;Offset> points;   final Color color;   final double strokeWidth;    const LineObject({     required this.points,     this.color = Colors.red,     this.strokeWidth = 20.0,   });    LineObject copyWith({     List&lt;Offset>? points,     Color? color,     double? strokeWidth,   }) {     return LineObject(       points: points ?? this.points,       color: color ?? this.color,       strokeWidth: strokeWidth ?? this.strokeWidth,     );   } }<\/code><\/pre>\n<p>\u0421\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b <code>_onPanStart<\/code> \u0438 <code>_onPanUpdate<\/code><\/p>\n<pre><code class=\"dart\">  void _onPanStart(DragStartDetails details) {     setState(() {       lines.add(         LineObject(           points: [details.localPosition],         ),       );     });   }    void _onPanUpdate(DragUpdateDetails details) {     setState(() {       lines.last = lines.last.copyWith(         points: [...lines.last.points, details.localPosition],       );     });   }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <code>lines<\/code>.\u00a0<\/p>\n<p><strong>\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u043d\u0435 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e.<\/strong> \u0415\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>RepaintBoundary<\/code>. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0432\u0438\u0434\u0436\u0435\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445, \u043a\u0430\u043a \u0431\u044b \u201c\u0437\u0430\u0449\u0438\u0449\u0430\u044f\u201d \u043e\u0442 \u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0439 \u0438 \u0441\u0435\u0431\u044f \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432, \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0435\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e.<\/p>\n<pre><code class=\"dart\">  @override   Widget build(BuildContext context) {     return Scaffold(       floatingActionButton: FloatingActionButton(         onPressed: _onClearLines,         child: const Icon(Icons.clear),       ),       body: GestureDetector(         behavior: HitTestBehavior.opaque,         onPanStart: _onPanStart,         onPanUpdate: _onPanUpdate,         child: Stack(           children: [             for (int index = 0; index &lt; lines.length; index++)               RepaintBoundary(                 child: CustomPaint(                   size: MediaQuery.sizeOf(context),                   painter: FingerPainter(                     line: lines[index],                   ),                 ),               ),           ],         ),       ),     );   }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u0435 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>\u041a\u0430\u043a \u044f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0440\u0430\u043d\u0435\u0435, \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0446\u0438\u043a\u043b \u0432 <code>Stack<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0448\u0435.<\/p>\n<p><strong>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>\u041c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0439 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u043c \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u043a\u0435\u0439\u0441\u0430\u0445. <br \/>\u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/787786\/\" rel=\"noopener noreferrer nofollow\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/787782\/\"> https:\/\/habr.com\/ru\/articles\/787782\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042f flutter \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0441\u044c \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u0434 iOS \u0438 Android. \u041d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u0444\u0435\u0440\u044b \u0440\u0430\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0439 \u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0444\u0438\u0447\u0430, \u0433\u0434\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u044f \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u043f\u043e \u044d\u043a\u0440\u0430\u043d\u0443 \u0440\u0438\u0441\u0443\u0435\u0448\u044c \u043b\u0438\u043d\u0438\u044e:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041d\u0430\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u0434\u0443\u043c\u0430\u043b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043b\u0438\u043d\u0438\u0438 (\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u0435\u043a, \u0446\u0432\u0435\u0442 \u0438 \u0442\u043e\u043b\u0449\u0438\u043d\u0430)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"dart\">class LineObject {   final List&lt;Offset> points;   final Color color;   final double strokeWidth;    const LineObject({     required this.points,     this.color = Colors.red,     this.strokeWidth = 20.0,   }); }<\/code><\/pre>\n<ul>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b <code>FingerPainter<\/code> \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 <code>CustomPaint<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043b \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u043d\u0438\u0439<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"dart\">class FingerPainter extends CustomPainter {   final List&lt;LineObject> lines;   const FingerPainter({     required this.lines,   });    @override   void paint(Canvas canvas, Size size) {     for (int index = 0; index &lt; lines.length; index++) {       final line = lines[index];       final paint = Paint()         ..style = PaintingStyle.stroke         ..color = line.color         ..strokeWidth = line.strokeWidth         ..strokeCap = StrokeCap.round;        for (var i = 0; i &lt; line.points.length - 1; i++) {         canvas.drawLine(line.points[i], line.points[i + 1], paint);       }     }   }    @override   bool shouldRepaint(FingerPainter oldDelegate) => true; }<\/code><\/pre>\n<ul>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0441\u0430\u043c \u044d\u043a\u0440\u0430\u043d \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"dart\">class FingerPainterScreen extends StatefulWidget {   const FingerPainterScreen({super.key});    @override   State&lt;FingerPainterScreen> createState() => _FingerPainterScreenState(); }  class _FingerPainterScreenState extends State&lt;FingerPainterScreen> {   final List&lt;LineObject> lines = [];    void _onClearLines() {     setState(() {       lines.clear();     });   }    void _onPanUpdate(DragUpdateDetails details) {     setState(() {       lines.last.points.add(details.localPosition);     });   }    void _onPanStart(DragStartDetails details) {     setState(() {       lines.add(LineObject(points: [details.localPosition]));     });   }    @override   Widget build(BuildContext context) {     return Scaffold(       floatingActionButton: FloatingActionButton(         onPressed: _onClearLines,         child: const Icon(Icons.clear),       ),       body: GestureDetector(         onPanStart: _onPanStart,         onPanUpdate: _onPanUpdate,         child: CustomPaint(           size: MediaQuery.sizeOf(context),           painter: FingerPainter(             lines: lines,           ),         ),       ),     );   } }<\/code><\/pre>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430. \u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c, \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u2026<\/p>\n<hr\/>\n<h4>\u041a\u0430\u043a\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438?<\/h4>\n<p>\u041f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u0434-\u0440\u0435\u0432\u044c\u044e \u0441\u0432\u043e\u0435\u0433\u043e \u0436\u0435 \u043a\u043e\u0434\u0430.\u00a0<\/p>\n<p><strong>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u0440\u0438\u0441\u0443\u0435\u043c \u0432\u0441\u0435 \u043b\u0438\u043d\u0438\u0438 \u0441\u0440\u0430\u0437\u0443.<\/strong> \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 <code>paint<\/code> \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0446\u0438\u043a\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u0430\u044f \u043b\u0438\u043d\u0438\u044f \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0437\u0430\u0434\u0430\u0447\u0443 <code>FingerPainter<\/code> \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043b\u0438\u043d\u0438\u044e:<\/p>\n<pre><code class=\"dart\">class FingerPainter extends CustomPainter {   final LineObject line;   const FingerPainter({     required this.line,   });    @override   void paint(Canvas canvas, Size size) {     final paint = Paint()       ..style = PaintingStyle.stroke       ..color = line.color       ..strokeWidth = line.strokeWidth       ..strokeCap = StrokeCap.round;      for (var i = 0; i &lt; line.points.length - 1; i++) {       canvas.drawLine(line.points[i], line.points[i + 1], paint);     }   }    @override   bool shouldRepaint(FingerPainter oldDelegate) => true; }<\/code><\/pre>\n<p>\u041f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435:<\/p>\n<pre><code class=\"dart\">  @override   Widget build(BuildContext context) {     return Scaffold(       floatingActionButton: FloatingActionButton(         onPressed: _onClearLines,         child: const Icon(Icons.clear),       ),       body: GestureDetector(         behavior: HitTestBehavior.opaque,         onPanStart: _onPanStart,         onPanUpdate: _onPanUpdate,         child: Stack(           children: [             for (int index = 0; index &lt; lines.length; index++)               CustomPaint(                 size: MediaQuery.sizeOf(context),                 painter: FingerPainter(                   line: lines[index],                 ),               ),           ],         ),       ),     );   }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0446\u0438\u043a\u043b \u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0435 <code>Stack<\/code>. \u0412 <code>GestureDetector<\/code> \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043e \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 <code>behavior<\/code> \u043d\u0430 <code>HitTestBehavior.opaque<\/code>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, <code>GestureDetector<\/code> \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 child, \u0438\u043b\u0438 \u0436\u0435 children \u0432 \u0441\u0442\u0435\u043a\u0435. \u0415\u0441\u043b\u0438 children \u043d\u0435\u0442, \u0442\u043e \u0438 \u043d\u043e\u0432\u044b\u0435 \u043b\u0438\u043d\u0438\u0438 \u0442\u043e\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442. <br \/>\u041f\u043e\u0447\u0435\u043c\u0443 \u043b\u0443\u0447\u0448\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0446\u0438\u043a\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0441\u0442\u0435\u043a\u0435? \u042f \u0432\u0435\u0440\u043d\u0443\u0441\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p><strong>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, shouldRepaint \u0432\u0441\u0435\u0433\u0434\u0430 true.<\/strong> \u042d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c, \u043a\u043e\u0433\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442 (\u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>paint<\/code>). \u0415\u0441\u043b\u0438 \u043e\u043d \u0432\u0441\u0435\u0433\u0434\u0430 <code>true<\/code>, \u0442\u043e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0447\u0438\u0445\u0435 \u0438\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0437\u043e\u0432\u0435 build \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043a\u0430, \u0438 \u0432\u0441\u0435 N \u043b\u0438\u043d\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043e\u0447\u0435\u043a \u0432 \u043b\u0438\u043d\u0438\u0438.<\/p>\n<pre><code class=\"dart\">  @override   bool shouldRepaint(FingerPainter oldDelegate) {     return line.points.length != oldDelegate.line.points.length;   }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e, \u043a\u0430\u043a \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0442\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043e\u043f\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0443\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u0438\u043d\u0438\u0438. \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 false.\u00a0<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e class <code>LineObject<\/code> \u043d\u0435 \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0439, \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 <code>List&lt;Offset> points<\/code> \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0443\u0433\u0440\u044b\u0437\u0435\u043d\u0438\u0439 \u0441\u043e\u0432\u0435\u0441\u0442\u0438. \u0412\u0440\u043e\u0434\u0435, \u0432 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u043d\u0435\u0442 \u0434\u043e \u043f\u043e\u0440\u044b \u0434\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <code>LineObject<\/code>, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0435\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 (\u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441) \u043d\u0430 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u0441\u0435\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 points, \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0435, \u0432 \u0442\u043e\u043c \u0436\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u0438.\u00a0<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 <code>FingerPainter<\/code> \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 <code>LineObject<\/code>, \u0442\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>shouldRepaint<\/code>, \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0443. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 <code>points<\/code> \u0438\u043c\u0435\u0435\u0442 \u0442\u0443 \u0436\u0435 \u0434\u043b\u0438\u043d\u0443.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 freezed. \u0422\u043e\u0433\u0434\u0430 \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0434\u0443\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043f\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043c\u0435\u0442\u043e\u0434 <code>copyWith<\/code>:<\/p>\n<pre><code class=\"dart\">class LineObject {   final List&lt;Offset> points;   final Color color;   final double strokeWidth;    const LineObject({     required this.points,     this.color = Colors.red,     this.strokeWidth = 20.0,   });    LineObject copyWith({     List&lt;Offset>? points,     Color? color,     double? strokeWidth,   }) {     return LineObject(       points: points ?? this.points,       color: color ?? this.color,       strokeWidth: strokeWidth ?? this.strokeWidth,     );   } }<\/code><\/pre>\n<p>\u0421\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b <code>_onPanStart<\/code> \u0438 <code>_onPanUpdate<\/code><\/p>\n<pre><code class=\"dart\">  void _onPanStart(DragStartDetails details) {     setState(() {       lines.add(         LineObject(           points: [details.localPosition],         ),       );     });   }    void _onPanUpdate(DragUpdateDetails details) {     setState(() {       lines.last = lines.last.copyWith(         points: [...lines.last.points, details.localPosition],       );     });   }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <code>lines<\/code>.\u00a0<\/p>\n<p><strong>\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u043d\u0435 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e.<\/strong> \u0415\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>RepaintBoundary<\/code>. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0432\u0438\u0434\u0436\u0435\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445, \u043a\u0430\u043a \u0431\u044b \u201c\u0437\u0430\u0449\u0438\u0449\u0430\u044f\u201d \u043e\u0442 \u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0439 \u0438 \u0441\u0435\u0431\u044f \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432, \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0435\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e.<\/p>\n<pre><code class=\"dart\">  @override   Widget build(BuildContext context) {     return Scaffold(       floatingActionButton: FloatingActionButton(         onPressed: _onClearLines,         child: const Icon(Icons.clear),       ),       body: GestureDetector(         behavior: HitTestBehavior.opaque,         onPanStart: _onPanStart,         onPanUpdate: _onPanUpdate,         child: Stack(           children: [             for (int index = 0; index &lt; lines.length; index++)               RepaintBoundary(                 child: CustomPaint(                   size: MediaQuery.sizeOf(context),                   painter: FingerPainter(                     line: lines[index],                   ),                 ),               ),           ],         ),       ),     );   }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u0435 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>\u041a\u0430\u043a \u044f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0440\u0430\u043d\u0435\u0435, \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0446\u0438\u043a\u043b \u0432 <code>Stack<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0448\u0435.<\/p>\n<p><strong>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>\u041c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0439 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u043c \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u043a\u0435\u0439\u0441\u0430\u0445. <br \/>\u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/787786\/\" rel=\"noopener noreferrer nofollow\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/787782\/\"> https:\/\/habr.com\/ru\/articles\/787782\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-365867","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=365867"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365867\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=365867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=365867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=365867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}