周睿 пре 2 година
родитељ
комит
bfc2b2d844

BIN
android/app/src/main/jniLibs/arm64-v8a/libappcore.so


BIN
android/app/src/main/jniLibs/armeabi-v7a/libappcore.so


BIN
android/app/src/main/jniLibs/x86_64/libappcore.so


+ 2 - 2
build_appcore.ps1

@@ -1,5 +1,5 @@
 $projectRoot = $PSScriptRoot
 $cmd = "flutter_rust_bridge_codegen --class-name AppCoreApi --rust-crate-dir "+ 
-        $projectRoot + "\third_party\appcore"  + " --rust-input " + $projectRoot + "\third_party\appcore\src\api.rs" +
-     " --dart-output "+ $projectRoot + "\lib\appcore\bridge_generated.dart" + " -c " + $projectRoot + "\ios/Runner/bridge_generated.h"
+        $projectRoot + "/third_party/appcore"  + " --rust-input " + $projectRoot + "/third_party/appcore/src/api.rs" +
+     " --dart-output "+ $projectRoot + "/lib/appcore/bridge_generated.dart" + " -c " + $projectRoot + "/ios/Runner/bridge_generated.h"
 Invoke-Expression $cmd

+ 3 - 0
lib/app_init_page.dart

@@ -8,6 +8,8 @@ import 'package:trackoffical_app/service/app.dart';
 import 'package:trackoffical_app/utils.dart';
 import 'package:rive/rive.dart';
 import 'package:vector_math/vector_math.dart' as vec;
+import 'package:common_pub/prelude.dart' as screen;
+
 
 final _duration = 2.seconds;
 
@@ -31,6 +33,7 @@ class AppInitPageController extends GetxController {
     App.to.devicePixelRatio = pixelRatio;
     App.to.screenSize = Size(context.width, context.height);
     SizeFit.screenInit(context);
+    screen.init(context);
 
     debug(msg);
   }

+ 1 - 1
lib/appcore/bridge_generated.dart

@@ -1,5 +1,5 @@
 // AUTO GENERATED FILE, DO NOT EDIT.
-// Generated by `flutter_rust_bridge`@ 1.77.1.
+// Generated by `flutter_rust_bridge`@ 1.80.1.
 // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const
 
 import 'dart:convert';

+ 4 - 4
lib/logger.dart

@@ -20,17 +20,17 @@ final _loggerNoStack = Logger(
 
 
 void debug(dynamic message, [dynamic error, StackTrace? stackTrace]){
-  _logger.d(message, error, stackTrace);
+  _logger.d(message, error: error, stackTrace: stackTrace);
 }
 
 void info(dynamic message, [dynamic error, StackTrace? stackTrace]){
-  _loggerNoStack.i(message, error, stackTrace);
+  _loggerNoStack.i(message, error: error, stackTrace: stackTrace);
 }
 
 void warn(dynamic message, [dynamic error, StackTrace? stackTrace]){
-  _logger.w(message, error, stackTrace);
+  _logger.w(message, error: error, stackTrace: stackTrace);
 }
 
 void error(dynamic message, [dynamic error, StackTrace? stackTrace]){
-  _logger.e(message, error, stackTrace);
+  _logger.e(message, error: error, stackTrace: stackTrace);
 }

+ 9 - 9
lib/screen.dart

@@ -58,15 +58,15 @@ extension MNumFit on num {
     return SizeFit.setRpx(toDouble());
   }
 
-  /// 屏幕宽度百分比
-  double get wp{
-    return SizeFit._screenWidthD * (toDouble()/100);
-  }
-
-  /// 屏幕高度百分比
-  double get hp{
-    return SizeFit._screenHeightD * (toDouble()/100);
-  }
+  // /// 屏幕宽度百分比
+  // double get wp{
+  //   return SizeFit._screenWidthD * (toDouble()/100);
+  // }
+  //
+  // /// 屏幕高度百分比
+  // double get hp{
+  //   return SizeFit._screenHeightD * (toDouble()/100);
+  // }
 
 }
 

+ 1 - 1
lib/view/ask_premissions_view.dart

@@ -3,7 +3,7 @@ import 'package:trackoffical_app/generated/assets.dart';
 import 'package:trackoffical_app/route.dart';
 import 'package:trackoffical_app/screen.dart';
 import 'package:get/get.dart';
-
+import 'package:common_pub/prelude.dart';
 import '../service/app.dart';
 
 class AskPermissionsView extends StatelessWidget {

+ 1 - 0
lib/view/game_settings.dart

@@ -8,6 +8,7 @@ import 'package:trackoffical_app/view/sport_wear_select_view.dart';
 import '../service/sport_wear.dart';
 import '../widget/app_top_bar.dart';
 import 'package:get/get.dart';
+import 'package:common_pub/prelude.dart';
 
 class GameSettingsView extends StatefulWidget {
   const GameSettingsView({super.key, this.isInGame = false});

+ 1 - 1
lib/view/login/common.dart

@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
 import 'package:trackoffical_app/generated/assets.dart';
 import 'package:trackoffical_app/screen.dart';
 import 'package:get/get.dart';
-
+import 'package:common_pub/prelude.dart';
 import 'login_controller.dart';
 
 class AppTopBar extends StatelessWidget implements PreferredSizeWidget {

+ 1 - 0
lib/view/login/login_view.dart

@@ -11,6 +11,7 @@ import '../../utils.dart';
 import 'login_controller.dart';
 import 'common.dart';
 import 'package:vector_math/vector_math.dart' as vec;
+import 'package:common_pub/prelude.dart';
 
 final _duration = 2.seconds;
 

+ 0 - 765
lib/view/map/layer_map.dart

@@ -1,765 +0,0 @@
-import 'dart:math';
-import 'package:bubble/bubble.dart';
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-import 'package:trackoffical_app/screen.dart';
-import 'package:trackoffical_app/service/game/game_model.dart';
-// import 'package:trackoffical_app/view/ingame/widget_ruler.dart';
-import 'package:trackoffical_app/widget/compass2.dart';
-import 'dart:ui' as ui;
-import '../../model/game_map.dart';
-import '../../model/m_control_point.dart';
-import '../../service/map/map.dart';
-// import 'in_game_controller.dart';
-
-const cpRadius = 15.0;
-
-class LayerMap extends StatelessWidget {
-  const LayerMap({super.key});
-
-  @override
-  Widget build(BuildContext context) {
-    return Stack(
-      children: [
-        _LayerMapRotateStatic(),
-        _Trajectory(),
-        _LayerMapRuler(),
-        _LayerMapFrontDraw(),
-        _LayerCPNum(),
-        // _LayerCPStartBubble(),
-        _LayerCompass(),
-      ],
-    );
-  }
-}
-
-/// 地图图层,所有元素静态跟随整体旋转
-class _LayerMapRotateStatic extends GetView<GameModel> {
-  @override
-  Widget build(BuildContext context) {
-    return Obx(() {
-      final model = controller;
-      // model.mapRotateCenter = Offset(context.width / 2, context.height / 2);
-      var tran = model.mapTransformMatrix.value;
-
-      return Center(
-        child: Transform(
-          transform: tran,
-          // alignment: Alignment.center,
-          child: SizedBox(
-              height: context.height,
-              width: context.width,
-              child: Stack(
-                children: [
-                  _StaticMap(),
-                  _RoutePoints(tran, model.startAt == null),
-                ],
-              )),
-        ),
-      );
-    });
-  }
-}
-
-class _RoutePoints extends StatefulWidget {
-  const _RoutePoints(this.tran, this.isOnlyStart);
-
-  final Matrix4 tran;
-  final bool isOnlyStart;
-
-  @override
-  State<StatefulWidget> createState() {
-    return _RoutePointsState();
-  }
-}
-
-class _RoutePointsState extends State<_RoutePoints>
-    with SingleTickerProviderStateMixin {
-  final model = Get.find<GameModel>();
-  final controller = Get.find<MapService>();
-  late AnimationController _animationController;
-  late Animation<int?> _animation;
-
-  @override
-  void initState() {
-    super.initState();
-
-    _animationController = AnimationController(
-      vsync: this,
-      duration: const Duration(milliseconds: 500),
-      reverseDuration: const Duration(milliseconds: 500),
-    )..repeat(reverse: true);
-    _animation = IntTween(begin: 255, end: 0).animate(_animationController)
-      ..addListener(() {
-        setState(() {
-          // The state that has changed here is the animation object’s value.
-        });
-      });
-  }
-
-  @override
-  Widget build(BuildContext context) {
-    final radiusPx = controller.mapStatus.mapScaleSrc * cpRadius;
-
-    final info = controller.mapStatus.gameMapData;
-    final matrix = widget.tran;
-
-    return Obx(() {
-      var points = controller.controlPointWantSequence;
-
-      return SizedBox(
-        height: context.height,
-        width: context.width,
-        child: CustomPaint(
-          painter: _RoutePointsPainter(
-            points,
-            info,
-            matrix,
-            radiusPx,
-            _animation.value ?? 255,
-            widget.isOnlyStart,
-            model.nextPlanPointIndex.value,
-          ),
-        ),
-      );
-    });
-  }
-
-  @override
-  void dispose() {
-    _animationController.dispose();
-    super.dispose();
-  }
-}
-
-class _RoutePointsPainter extends CustomPainter {
-  final List<MControlPoint> _points;
-  final GameMap info;
-  final Matrix4 matrix;
-  final service = MapService.to;
-  final double radiusPx;
-  final int nextAlpha;
-  static const nextColor = Colors.red;
-  final bool isOnlyStart;
-  final int? nextPlanIndex;
-
-  _RoutePointsPainter(this._points, this.info, this.matrix, this.radiusPx,
-      this.nextAlpha, this.isOnlyStart, this.nextPlanIndex);
-
-  @override
-  void paint(Canvas canvas, Size size) {
-    final paint = Paint();
-    final strokeWidthColor = radiusPx * 0.15;
-    final strokeWidthWhite = strokeWidthColor * 2;
-
-    paint.strokeWidth = strokeWidthColor;
-    final picFirstScale = service.mapStatus.picFirstScale;
-    // final textSize = radiusPx * 0.6;
-    final textSize = -22.0 / matrix[0];
-    // const textSize = 5.0;
-
-    const isShowText = false;
-
-    var lastXY = Offset.zero;
-    for (var i = _points.length - 1; i >= 0; i--) {
-      if (isOnlyStart && i != 0) {
-        continue;
-      }
-
-      final one = _points[i];
-      if (one.onMap != Offset.zero) {
-        // var xy = service.mapStatus.picOffsetToScreen(one.onMap);
-        var xy =
-            Offset(one.onMap.dx * picFirstScale, one.onMap.dy * picFirstScale);
-        var x = xy.dx;
-        var y = xy.dy;
-
-        var isNext = false;
-        var isJumped = false;
-        if (nextPlanIndex == null) {
-          isNext = one.isNext;
-        } else {
-          isNext = i == nextPlanIndex;
-          isJumped = !one.isSuccess && i < nextPlanIndex!;
-        }
-
-        var color = const Color(0xffff00f7);
-
-        var strokeColor = Colors.white;
-        if (one.isSuccess) {
-          color = Colors.green;
-        }
-        if (isNext) {
-          color = nextColor.withAlpha(nextAlpha);
-          strokeColor = Colors.white.withAlpha(nextAlpha);
-          // paint.color = const Color(0xffff4d00);
-        }
-        if (isJumped) {
-          color = Colors.grey;
-        }
-
-        paint.style = PaintingStyle.fill;
-        final thisXY = Offset(x, y);
-        // canvas.drawCircle(thisXY, 2, paint);
-
-        // if (lastXY != Offset.zero) {
-        if (i - 1 >= 0) {
-          final next = _points[i - 1];
-          lastXY = Offset(
-              next.onMap.dx * picFirstScale, next.onMap.dy * picFirstScale);
-
-          final dx = thisXY.dx - lastXY.dx;
-          final dy = thisXY.dy - lastXY.dy;
-          final len = sqrt(dx * dx + dy * dy);
-
-          final dx1 = dx / len * radiusPx;
-          final dy1 = dy / len * radiusPx;
-
-          var p1 = lastXY + Offset(dx1, dy1);
-          var p2 = thisXY - Offset(dx1, dy1);
-
-          if (p1.dx.isNaN || p1.dy.isNaN || p2.dx.isNaN || p2.dy.isNaN) {
-            continue;
-          }
-          paint.color = strokeColor;
-          paint.strokeWidth = strokeWidthWhite;
-          canvas.drawLine(p1, p2, paint);
-
-          paint.color = color;
-          paint.strokeWidth = strokeWidthColor;
-          canvas.drawLine(p1, p2, paint);
-        }
-        lastXY = thisXY;
-
-        if (one.isStart) {
-          final path = Path();
-          final widthLeft = radiusPx * 0.9;
-          final widthRight = radiusPx * 1.1;
-          final heightHalf = radiusPx;
-
-          path.moveTo(x - widthLeft, y - heightHalf);
-          path.lineTo(x + widthRight, y);
-          path.lineTo(x - widthLeft, y + heightHalf);
-          path.close();
-
-          paint.style = PaintingStyle.stroke;
-          paint.color = strokeColor;
-          paint.strokeWidth = strokeWidthWhite;
-          canvas.drawPath(path, paint);
-
-          paint.color = color;
-          paint.strokeWidth = strokeWidthColor;
-          canvas.drawPath(path, paint);
-        } else if (one.isFinish) {
-          paint.style = PaintingStyle.stroke;
-          paint.color = strokeColor;
-          paint.strokeWidth = strokeWidthWhite;
-          canvas.drawCircle(thisXY, radiusPx, paint);
-          canvas.drawCircle(thisXY, radiusPx * 0.7, paint);
-
-          paint.color = color;
-          paint.strokeWidth = strokeWidthColor;
-          canvas.drawCircle(thisXY, radiusPx, paint);
-          canvas.drawCircle(thisXY, radiusPx * 0.7, paint);
-        } else {
-          paint.style = PaintingStyle.stroke;
-
-          paint.color = strokeColor;
-          paint.strokeWidth = strokeWidthWhite;
-          canvas.drawCircle(thisXY, radiusPx, paint);
-
-          paint.color = color;
-          paint.strokeWidth = strokeWidthColor;
-          canvas.drawCircle(thisXY, radiusPx, paint);
-        }
-
-        if (!one.isStart && !one.isFinish && isShowText) {
-          var textPainter = TextPainter(
-            text: TextSpan(
-                text: one.sn,
-                style: TextStyle(
-                    color: paint.color,
-                    fontSize: textSize,
-                    fontWeight: FontWeight.w700)),
-            textDirection: TextDirection.rtl,
-            textWidthBasis: TextWidthBasis.longestLine,
-            maxLines: 1,
-          )..layout();
-
-          textPainter.paint(
-              canvas,
-              Offset(x - textPainter.width / 2,
-                  y - textPainter.height - radiusPx));
-        }
-      }
-    }
-  }
-
-  @override
-  bool shouldRepaint(_RoutePointsPainter oldDelegate) => false;
-}
-
-class _LayerMapFrontDraw extends GetView<MapService> {
-  final model = Get.find<GameModel>();
-
-
-  @override
-  Widget build(BuildContext context) {
-    return Obx(() {
-      var points = controller.controlPointWantSequence;
-
-      final info = controller.mapStatus.gameMapData;
-      final matrix = controller.mapStatus.matrix.value;
-
-      var showLocationAlpha = 255;
-      // if (controller.isOutBoundary || model.isEnableUserLocation) {
-      //   showLocationAlpha = 255;
-      // }
-      if (!model.isEnableUserLocation) {
-        showLocationAlpha = 0;
-      }
-
-      return SizedBox(
-        height: context.height,
-        width: context.width,
-        child: CustomPaint(
-          painter: _LayerMapFrontDrawPainter(
-              points,
-              info,
-              matrix,
-              controller.positionOnMap ?? Offset.zero,
-              controller.mapStatus.compassAngle,
-              controller.mapStatus.rotateRadian,
-              showLocationAlpha),
-        ),
-      );
-    });
-  }
-}
-
-class _LayerMapFrontDrawPainter extends CustomPainter {
-  final List<MControlPoint> _points;
-  final GameMap info;
-  final Matrix4 matrix;
-  final Offset myPositionOnMap;
-  final service = MapService.to;
-  final double northRadians;
-  final double mapRadians;
-  final int showLocationAlpha;
-
-  _LayerMapFrontDrawPainter(
-      this._points,
-      this.info,
-      this.matrix,
-      this.myPositionOnMap,
-      this.northRadians,
-      this.mapRadians,
-      this.showLocationAlpha);
-
-  @override
-  void paint(Canvas canvas, Size size) {
-    final paint = Paint();
-    drawMyLocation(canvas, paint);
-    // drawRouteNumber(canvas, paint);
-  }
-
-  @override
-  bool shouldRepaint(_LayerMapFrontDrawPainter oldDelegate) => false;
-
-  drawMyLocation(Canvas canvas, Paint paint) {
-    var myXY = service.mapStatus.picOffsetToScreen(myPositionOnMap);
-    // final myXY = myPositionOnMap;
-
-    final color = (const Color(0xFFFF0000)).withAlpha(showLocationAlpha);
-    final color2 = (const Color(0xFFFFA1A1)).withAlpha(showLocationAlpha);
-    paint.color = color;
-    var rect = Rect.fromLTRB(myXY.dx - 12, myXY.dy - 40, myXY.dx + 12, myXY.dy);
-    paint.shader = ui.Gradient.linear(rect.topCenter, rect.bottomCenter, [
-      const Color(0x00FFFFFF),
-      color2
-    ], [
-      0,
-      1,
-    ]);
-
-    final path = Path();
-
-    path.moveTo(rect.topLeft.dx, rect.topLeft.dy);
-    path.lineTo(rect.topRight.dx, rect.topRight.dy);
-    path.lineTo(rect.bottomCenter.dx, rect.bottomCenter.dy);
-
-    canvas.drawPath(path, paint);
-    paint.shader = null;
-
-    paint.color = Colors.white.withAlpha(showLocationAlpha);
-    canvas.drawCircle(myXY, 8, paint);
-    paint.color = color;
-    canvas.drawCircle(myXY, 5, paint);
-  }
-
-  drawRouteNumber(Canvas canvas, Paint paint) {
-    var h0 = service.mapStatus.picOffsetToScreen(const Offset(0, 0));
-    var h1 = service.mapStatus.picOffsetToScreen(const Offset(0, 60));
-    final dx = h1.dx - h0.dx;
-    final dy = h1.dy - h0.dy;
-    var h = sqrt(dx * dx + dy * dy);
-
-    for (var one in _points) {
-      if (one.onMap != Offset.zero) {
-        var xy = service.mapStatus.picOffsetToScreen(one.onMap);
-        var x = xy.dx;
-        var y = xy.dy;
-
-        if (!one.isStart && !one.isFinish) {
-          var textPainter = TextPainter(
-            text: TextSpan(
-                text: one.sn,
-                style: const TextStyle(
-                    color: Colors.white,
-                    fontSize: 27,
-                    fontWeight: FontWeight.w900,
-                    letterSpacing: -3)),
-            textDirection: TextDirection.rtl,
-            textWidthBasis: TextWidthBasis.longestLine,
-            maxLines: 1,
-          )..layout();
-
-          // textPainter.paint(canvas, Offset(x - textPainter.width / 2 -1 , y - textPainter.height -h + 3));
-
-          textPainter = TextPainter(
-            text: TextSpan(
-                text: one.sn,
-                style: const TextStyle(
-                    color: Color(0xffff00f7),
-                    fontSize: 22,
-                    fontWeight: FontWeight.w700)),
-            textDirection: TextDirection.rtl,
-            textWidthBasis: TextWidthBasis.longestLine,
-            maxLines: 1,
-          )..layout();
-
-          textPainter.paint(canvas,
-              Offset(x - textPainter.width / 2, y - textPainter.height - h));
-        }
-      }
-    }
-  }
-
-  drawRoutes(Canvas canvas, Paint paint) {
-    const radiusPx = 19.0;
-    paint.strokeWidth = 2.18;
-
-    var lastXY = Offset.zero;
-    for (var one in _points) {
-      if (one.onMap != Offset.zero) {
-        var xy = service.mapStatus.picOffsetToScreen(one.onMap);
-        var x = xy.dx;
-        var y = xy.dy;
-
-        paint.color = const Color(0xffff00f7);
-        if (one.isSuccess) {
-          paint.color = Colors.green;
-        }
-        if (one.isNext) {
-          paint.color = const Color(0xffffcb00);
-        }
-        paint.style = PaintingStyle.fill;
-        final thisXY = Offset(x, y);
-        // canvas.drawCircle(thisXY, 2, paint);
-
-        if (lastXY != Offset.zero) {
-          final dx = thisXY.dx - lastXY.dx;
-          final dy = thisXY.dy - lastXY.dy;
-          final len = sqrt(dx * dx + dy * dy);
-
-          final dx1 = dx / len * radiusPx;
-          final dy1 = dy / len * radiusPx;
-
-          var p1 = lastXY + Offset(dx1, dy1);
-          var p2 = thisXY - Offset(dx1, dy1);
-
-          if (p1.dx.isNaN || p1.dy.isNaN || p2.dx.isNaN || p2.dy.isNaN) {
-            continue;
-          }
-
-          canvas.drawLine(p1, p2, paint);
-        }
-        lastXY = thisXY;
-
-        if (one.isStart) {
-          paint.style = PaintingStyle.stroke;
-          final path = Path();
-          const widthLeft = 12;
-          const widthRight = 18;
-          const heightHalf = 17;
-
-          path.moveTo(x - widthLeft, y - heightHalf);
-          path.lineTo(x + widthRight, y);
-          path.lineTo(x - widthLeft, y + heightHalf);
-          path.close();
-
-          canvas.drawPath(path, paint);
-        } else if (one.isFinish) {
-          paint.style = PaintingStyle.stroke;
-          canvas.drawCircle(thisXY, radiusPx, paint);
-          canvas.drawCircle(thisXY, 13.0, paint);
-        } else {
-          paint.style = PaintingStyle.stroke;
-          canvas.drawCircle(thisXY, radiusPx, paint);
-        }
-
-        if (!one.isStart && !one.isFinish) {
-          var textPainter = TextPainter(
-            text: TextSpan(
-                text: one.sn,
-                style: TextStyle(color: paint.color, fontSize: 14)),
-            textDirection: TextDirection.rtl,
-            textWidthBasis: TextWidthBasis.longestLine,
-            maxLines: 1,
-          )..layout();
-
-          textPainter.paint(canvas, Offset(x - textPainter.width / 2, y + 20));
-        }
-      }
-    }
-  }
-}
-
-// class _LayerCPStartBubble extends GetView<MapService> {
-//   final service = MapService.to;
-//
-//   @override
-//   Widget build(BuildContext context) {
-//     return Obx(() {
-//       var points = controller.controlPointWantSequence;
-//
-//       if (service.startAt != null || points.isEmpty) {
-//         return const SizedBox();
-//       }
-//       final start = points[0];
-//
-//       var xy = service.mapStatus
-//           .picOffsetToScreen(Offset(start.onMap.dx, start.onMap.dy));
-//
-//       var x = xy.dx;
-//       var y = xy.dy;
-//       var h0 = service.mapStatus.picOffsetToScreen(const Offset(0, 0));
-//       var h1 = service.mapStatus.picOffsetToScreen(const Offset(0, 60));
-//       final dx = h1.dx - h0.dx;
-//       final dy = h1.dy - h0.dy;
-//       var h = sqrt(dx * dx + dy * dy);
-//
-//       return Positioned(
-//         top: y,
-//         left: x + h + 1.0.wp,
-//         child: Bubble(
-//           nip: BubbleNip.leftTop,
-//           alignment: Alignment.topRight,
-//           child: const Text('打开始点后计时', style: TextStyle(color: Colors.red)),
-//         ),
-//       );
-//     });
-//   }
-// }
-
-class _LayerCPNum extends GetView<MapService> {
-  final model = Get.find<GameModel>();
-  final service = MapService.to;
-  static const style = TextStyle(
-      color: Color(0xffff00f7), fontSize: 22, fontWeight: FontWeight.w700);
-  final ingame = Get.find<InGameController>();
-
-  @override
-  Widget build(BuildContext context) {
-    final radiusPx = controller.mapStatus.mapScaleSrc * cpRadius;
-
-    return Obx(() {
-      // if (service.startAt == null) {
-      //   return const SizedBox();
-      // }
-      final scale = service.mapStatus.matrix.value[0].abs();
-
-
-      var h0 = service.mapStatus.picOffsetToScreen(const Offset(0, 0));
-      var h1 = service.mapStatus.picOffsetToScreen(Offset(0, radiusPx));
-      final dx = h1.dx - h0.dx;
-      final dy = h1.dy - h0.dy;
-      var h = sqrt(dx * dx + dy * dy);
-      final children = <Widget>[];
-      h = radiusPx*scale*2;
-      h = controller.mapStatus.mapScale.value * cpRadius + 4;
-
-      var points = controller.controlPointWantSequence;
-      for (var one in points) {
-        if (one.onMap != Offset.zero) {
-          var xy = service.mapStatus.picOffsetToScreen(one.onMap);
-          var x = xy.dx;
-          var y = xy.dy;
-
-          if (!one.isStart && !one.isFinish) {
-            final height = h + 24;
-            children.add(Positioned(
-              top: y - height,
-              left: x - 40,
-              width: 80,
-              height: height,
-              child: Transform.rotate(
-                  angle: model.compassPlantRadian,
-                  alignment: Alignment.bottomCenter,
-                  child: Container(
-                      alignment: Alignment.topCenter,
-                      // color: Colors.white,
-                      child: Text(one.sn, style: style))),
-            ));
-          }
-        }
-      }
-
-      return Stack(
-        children: children,
-      );
-    });
-  }
-}
-
-class _StaticMap extends GetView<MapService> {
-  @override
-  Widget build(BuildContext context) {
-    return Obx(() {
-      final data = controller.mapStatus.gameMapData;
-      final pic = controller.mapStatus.mapImageData.value;
-      final geoInfo = data.mapPackage;
-      if (pic.isNotEmpty && geoInfo != null) {
-        // var fit = BoxFit.fitWidth;
-        // if(data.width > data.height){
-        //   fit = BoxFit.fitHeight;
-        // }
-        return Image.memory(controller.mapStatus.gameMapData.pic!,
-            fit: BoxFit.contain);
-      } else {
-        return Container(
-            width: context.width,
-            height: context.height,
-            decoration: const BoxDecoration(color: Colors.white));
-      }
-    });
-  }
-}
-
-class _LayerCompass extends GetView<InGameController> {
-  @override
-  Widget build(BuildContext context) {
-    GameModel model = Get.find();
-
-    return Obx(() {
-      if (controller.isShowCompass) {
-        final diameter = controller.compassDiameter;
-        final left = (context.width - diameter) / 2;
-
-        return Positioned(
-            left: left,
-            top: controller.compassCenter.dy - diameter / 2,
-            child: Compass2(
-              compassRadians: model.compassRadiansFused.value,
-              mapNorthRadians: model.compassPlantRadian,
-              nextPointRadians: controller.isShowNextCPRadians.value
-                  ? model.compassPlantRadian
-                  : null,
-              level: controller.compassLevel.value,
-              showDegrees: model.compassShowDegrees,
-              diameter: diameter,
-            ));
-      } else {
-        return Container();
-      }
-    });
-  }
-}
-
-class _LayerMapRuler extends GetView<InGameController> {
-  final service = MapService.to;
-
-  @override
-  Widget build(BuildContext context) {
-    return Obx(() {
-      if (controller.isShowRuler.value) {
-        final mapScale = service.mapStatus.mapScale.value;
-        if (mapScale == 0) {
-          return const SizedBox();
-        }
-
-        var height = context.height / 2;
-        var hideHeight = 0.0;
-
-        if (controller.isMapRotateAtCompassCenter.value) {
-          height = controller.compassCenter.dy;
-          hideHeight = controller.compassDiameter / 2 + 1;
-        }
-
-        return Container(
-            alignment: Alignment.topCenter,
-            padding: EdgeInsets.only(top: context.mediaQueryPadding.top),
-            height: height,
-            child: Ruler(hideHeight: hideHeight, mapScale: mapScale));
-      } else {
-        return const SizedBox();
-      }
-    });
-  }
-}
-
-class _Trajectory extends GetView<GameModel> {
-  @override
-  Widget build(BuildContext context) {
-    return Obx(() {
-      return SizedBox(
-        height: context.height,
-        width: context.width,
-        child: CustomPaint(
-          painter: _TrajectoryPainter(
-              controller.trajectoryPoints, controller.isDrawTrajectory),
-        ),
-      );
-    });
-  }
-}
-
-class _TrajectoryPainter extends CustomPainter {
-  final bool isShow;
-  final List<Offset> _points;
-  final painter = Paint()
-    ..strokeWidth = 3
-    ..color = const Color(0xFF309EF9)
-    ..style = PaintingStyle.stroke
-    ..isAntiAlias = true;
-
-  final service = MapService.to;
-
-  _TrajectoryPainter(this._points, this.isShow);
-
-  @override
-  void paint(Canvas canvas, Size size) {
-    if (_points.length > 1 && isShow) {
-      var alpha = 255;
-      final lineCount = _points.length - 1;
-      final alphaStep = (alpha / lineCount).round();
-
-      for (var i = 1; i < _points.length; i++) {
-        final one = _points[i];
-        final last = _points[i - 1];
-        final p1 = service.mapStatus.picOffsetToScreen(last);
-        final p2 = service.mapStatus.picOffsetToScreen(one);
-
-        painter.color = Color.fromARGB(alpha, 255, 0, 0);
-        canvas.drawLine(p1, p2, painter);
-        alpha -= alphaStep;
-        if (alpha < 0) {
-          alpha = 0;
-        }
-      }
-    }
-  }
-
-  @override
-  bool shouldRepaint(_TrajectoryPainter oldDelegate) => false;
-}

+ 52 - 0
lib/view/map/map_controller.dart

@@ -0,0 +1,52 @@
+import 'dart:typed_data';
+import 'package:common_pub/model.dart';
+import 'package:common_pub/plug_view/plug_view.dart';
+import 'package:get/get.dart';
+import 'package:trackoffical_app/service/api.dart' as api;
+import '../../utils.dart';
+
+
+
+class MapController extends GetxController{
+  final plugMap = PlugMap();
+  final plugManager = PlugManager();
+  final isLoading = true.obs;
+
+  @override
+  void onReady() {
+    super.onReady();
+    _load();
+  }
+
+
+  Future<void> _load() async {
+    plugManager.addPlugs([
+      plugMap
+    ]);
+    final args = Get.arguments;
+
+    tryCatchApi(() async {
+
+      // TODO 获取地图md5
+      final md5 = Uint8List(0);
+
+      plugMap.gameMap.md5=md5;
+      plugMap.gameMap.readerBuilder=()async{
+        final bin = await api.ApiService.to.getBinReaderByMd5(md5);
+        return BinReader(
+          data: bin.reader.data,
+          length: bin.reader.length,
+          ext: bin.ext,
+          nonce: bin.nonce,);
+      };
+
+      plugManager.init();
+      isLoading.value = false;
+    }, onError: (e) {
+      Get.back();
+      return false;
+    });
+  }
+
+
+}

+ 19 - 11
lib/view/map/map_view.dart

@@ -1,21 +1,29 @@
+import 'package:common_pub/plug_view/plug_view.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
-import '../../generated/assets.dart';
-import '../../screen.dart';
+import 'map_controller.dart';
 
-class MapView extends GetView {
+class MapView extends GetView<MapController> {
   const MapView({super.key});
 
   @override
   Widget build(BuildContext context) {
-    // final PageTopController c = Get.find();
-    return Container(
-      color: Colors.lightGreen,
-      width: context.width,
-      height: context.height,
-      // margin: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
-      child: Text("MapView"),
-    );
+    final plug = controller.plugMap;
+
+    return ViewMapStack(plug: plug, children: [
+      ViewMapImage(plug),
+      // ViewMapCP(
+      //   plug,
+      //   cpList,
+      //   isHideRouteBeforeStart: false,
+      //   isShowPath: false,
+      // ),
+      // ViewMapTrace(plug, controller.traceList,
+      //     controller: controller.viewMapTraceController, autoScale: true),
+      ViewMapTouch(plug),
+      // ViewMapCPTouch(
+      //     plug: plug, cpList: cpList, onTouchCP: controller.onTouchCP),
+    ]);
   }
 
 }

+ 1 - 1
lib/view/maplist/map_list_view.dart

@@ -12,7 +12,7 @@ import '../../widget/hard_level.dart';
 import '../../widget/page_frame.dart';
 import '../mapto/map_to_view.dart';
 import 'map_list_controller.dart';
-
+import 'package:common_pub/prelude.dart';
 class MapListView extends GetView<MapListController> {
   const MapListView({super.key});
 

+ 1 - 1
lib/view/mapto/activity_view.dart

@@ -5,7 +5,7 @@ import 'package:trackoffical_app/view/mapto/map_to_controller.dart';
 import '../../generated/app_api.pb.dart';
 import '../../generated/assets.dart';
 import '../../generated/to_app_api.pb.dart';
-import '../../screen.dart';
+import 'package:common_pub/prelude.dart';
 import 'package:trackoffical_app/pb.dart' as pb;
 
 import '../../widget/common.dart';

+ 1 - 1
lib/view/mapto/message_view.dart

@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:trackoffical_app/utils.dart';
 import '../../generated/assets.dart';
-import '../../screen.dart';
+import 'package:common_pub/prelude.dart';
 import '../../widget/common.dart';
 
 class ModelItem {

+ 1 - 1
lib/view/sportdata/pace_view.dart

@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:trackoffical_app/utils.dart';
 import '../../generated/assets.dart';
-import '../../screen.dart';
+import 'package:common_pub/prelude.dart';
 import '../../widget/common.dart';
 
 class ModelItem {

+ 1 - 0
lib/widget/common.dart

@@ -1,6 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:trackoffical_app/screen.dart';
 import 'package:trackoffical_app/utils.dart';
+import 'package:common_pub/prelude.dart';
 
 Widget wUserMark(int userid) {
   return Container(

+ 1 - 1
lib/widget/my_position_point.dart

@@ -1,7 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:trackoffical_app/screen.dart';
 import 'dart:ui' as ui;
-
+import 'package:common_pub/prelude.dart';
 
 class MyPositionPoint extends StatelessWidget{
   const MyPositionPoint({

+ 2 - 1
lib/widget/page_frame.dart

@@ -3,6 +3,7 @@ import 'package:get/get.dart';
 import '../generated/assets.dart';
 import '../route.dart';
 import '../screen.dart';
+import 'package:common_pub/prelude.dart';
 
 class PageFrame extends GetView {
   // final List<Widget> children;
@@ -40,7 +41,7 @@ class PageTopController extends GetxController {
 
 class PageTop extends GetView<PageTopController> {
   const PageTop({super.key});
-  static TextStyle textStyle = TextStyle(color: Colors.white, fontSize: 11.rpx);
+  static TextStyle textStyle = TextStyle(color: Colors.white, fontSize: 11);
 
   static Bindings bindings() {
     return BindingsBuilder(() {

+ 1 - 1
lib/widget/ruler_picker.dart

@@ -1,7 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:flutter_ruler_picker/flutter_ruler_picker.dart' as r;
 import 'package:get/get.dart';
-import 'package:trackoffical_app/screen.dart';
+import 'package:common_pub/prelude.dart';
 
 
 typedef ValueChangedCallback = void Function(int value);

+ 12 - 11
pubspec.lock

@@ -209,14 +209,15 @@ packages:
       url: "https://pub.flutter-io.cn"
     source: hosted
     version: "1.17.1"
-  colorize:
-    dependency: transitive
+  common_pub:
+    dependency: "direct main"
     description:
-      name: colorize
-      sha256: "584746cd6ba1cba0633b6720f494fe6f9601c4170f0666c1579d2aa2a61071ba"
-      url: "https://pub.flutter-io.cn"
-    source: hosted
-    version: "3.0.0"
+      path: "."
+      ref: "v0.0.0"
+      resolved-ref: "482f0f515baf6047420828ed925a34313a6e3744"
+      url: "git@git.beswell.com:Orienteering/common_pub.git"
+    source: git
+    version: "0.0.1"
   convert:
     dependency: transitive
     description:
@@ -471,10 +472,10 @@ packages:
     dependency: "direct main"
     description:
       name: flutter_rust_bridge
-      sha256: "6960d0843f6f7b4eac28f2531eb0024f01c49bf9eec798327fbbafa084c1f535"
+      sha256: ff90d5ddd0cda6d94ed048cc9c4a4d993d1a4bb11605d60a1282fc1bbf173c77
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "1.78.0"
+    version: "1.80.1"
   flutter_svg:
     dependency: "direct main"
     description:
@@ -803,10 +804,10 @@ packages:
     dependency: "direct main"
     description:
       name: logger
-      sha256: "7ad7215c15420a102ec687bb320a7312afd449bac63bfb1c60d9787c27b9767f"
+      sha256: "66cb048220ca51cf9011da69fa581e4ee2bed4be6e82870d9e9baae75739da49"
       url: "https://pub.flutter-io.cn"
     source: hosted
-    version: "1.4.0"
+    version: "2.0.1"
   logging:
     dependency: transitive
     description:

+ 7 - 1
pubspec.yaml

@@ -38,7 +38,7 @@ dependencies:
   nfc_manager: ^3.2.0
   permission_handler: ^10.2.0
   get: ^4.6.5
-  logger: ^1.1.0
+  logger: ^2.0.1
   mocktail: ^0.3.0
   mobile_scanner: ^3.2.0
   geolocator: ^9.0.2
@@ -88,6 +88,11 @@ dependencies:
   meta: ^1.9.1
   syncfusion_flutter_charts: ^22.1.34
   f_cache: ^3.1.1
+  common_pub:
+    git:
+      url: git@git.beswell.com:Orienteering/common_pub.git
+      ref: v0.0.0
+
 
 dev_dependencies:
   integration_test:
@@ -106,6 +111,7 @@ dev_dependencies:
   freezed: ^2.3.2
   ffigen: ^8.0.2
 
+
 # For information on the generic Dart part of this file, see the
 # following page: https://dart.dev/tools/pub/pubspec
 

+ 109 - 76
third_party/appcore/src/bridge_generated.rs

@@ -9,10 +9,11 @@
     clippy::too_many_arguments
 )]
 // AUTO GENERATED FILE, DO NOT EDIT.
-// Generated by `flutter_rust_bridge`@ 1.77.1.
+// Generated by `flutter_rust_bridge`@ 1.80.1.
 
 use crate::api::*;
 use core::panic::UnwindSafe;
+use flutter_rust_bridge::rust2dart::IntoIntoDart;
 use flutter_rust_bridge::*;
 use std::ffi::c_void;
 use std::sync::Arc;
@@ -22,7 +23,7 @@ use std::sync::Arc;
 // Section: wire functions
 
 fn wire_parse_map_package_impl(port_: MessagePort, data: impl Wire2Api<Vec<u8>> + UnwindSafe) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, RustOpaque<RwLock<GeoMapInfo>>>(
         WrapInfo {
             debug_name: "parse_map_package",
             port: Some(port_),
@@ -38,7 +39,7 @@ fn wire_run_map_package_map_ext_opaque_impl(
     port_: MessagePort,
     map_package: impl Wire2Api<RustOpaque<RwLock<GeoMapInfo>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, String>(
         WrapInfo {
             debug_name: "run_map_package_map_ext_opaque",
             port: Some(port_),
@@ -55,7 +56,7 @@ fn wire_run_map_package_set_dst_size_opaque_impl(
     map_package: impl Wire2Api<RustOpaque<RwLock<GeoMapInfo>>> + UnwindSafe,
     dst_size: impl Wire2Api<Size> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>(
         WrapInfo {
             debug_name: "run_map_package_set_dst_size_opaque",
             port: Some(port_),
@@ -77,7 +78,7 @@ fn wire_run_map_package_get_dst_size_opaque_impl(
     port_: MessagePort,
     map_package: impl Wire2Api<RustOpaque<RwLock<GeoMapInfo>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, mirror_Size>(
         WrapInfo {
             debug_name: "run_map_package_get_dst_size_opaque",
             port: Some(port_),
@@ -85,11 +86,7 @@ fn wire_run_map_package_get_dst_size_opaque_impl(
         },
         move || {
             let api_map_package = map_package.wire2api();
-            move |task_callback| {
-                Ok(mirror_Size(run_map_package_get_dst_size_opaque(
-                    api_map_package,
-                )))
-            }
+            move |task_callback| Ok(run_map_package_get_dst_size_opaque(api_map_package))
         },
     )
 }
@@ -98,7 +95,7 @@ fn wire_run_map_package_pic_to_position_opaque_impl(
     map_package: impl Wire2Api<RustOpaque<RwLock<GeoMapInfo>>> + UnwindSafe,
     on_pic: impl Wire2Api<Offset> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, mirror_Position>(
         WrapInfo {
             debug_name: "run_map_package_pic_to_position_opaque",
             port: Some(port_),
@@ -108,10 +105,10 @@ fn wire_run_map_package_pic_to_position_opaque_impl(
             let api_map_package = map_package.wire2api();
             let api_on_pic = on_pic.wire2api();
             move |task_callback| {
-                Ok(mirror_Position(run_map_package_pic_to_position_opaque(
+                Ok(run_map_package_pic_to_position_opaque(
                     api_map_package,
                     api_on_pic,
-                )))
+                ))
             }
         },
     )
@@ -121,7 +118,7 @@ fn wire_run_map_package_position_to_pic_opaque_impl(
     map_package: impl Wire2Api<RustOpaque<RwLock<GeoMapInfo>>> + UnwindSafe,
     position: impl Wire2Api<Position> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, mirror_Offset>(
         WrapInfo {
             debug_name: "run_map_package_position_to_pic_opaque",
             port: Some(port_),
@@ -131,10 +128,10 @@ fn wire_run_map_package_position_to_pic_opaque_impl(
             let api_map_package = map_package.wire2api();
             let api_position = position.wire2api();
             move |task_callback| {
-                Ok(mirror_Offset(run_map_package_position_to_pic_opaque(
+                Ok(run_map_package_position_to_pic_opaque(
                     api_map_package,
                     api_position,
-                )))
+                ))
             }
         },
     )
@@ -143,7 +140,7 @@ fn wire_run_map_package_map_image_data_opaque_impl(
     port_: MessagePort,
     map_package: impl Wire2Api<RustOpaque<RwLock<GeoMapInfo>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, Vec<u8>>(
         WrapInfo {
             debug_name: "run_map_package_map_image_data_opaque",
             port: Some(port_),
@@ -160,7 +157,7 @@ fn wire_run_map_package_is_in_hot_zone_opaque_impl(
     map_package: impl Wire2Api<RustOpaque<RwLock<GeoMapInfo>>> + UnwindSafe,
     position: impl Wire2Api<Position> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, Option<ZoneType>>(
         WrapInfo {
             debug_name: "run_map_package_is_in_hot_zone_opaque",
             port: Some(port_),
@@ -196,7 +193,7 @@ fn wire_distance_meter_between_impl(
     )
 }
 fn wire_new_exercise_impl(port_: MessagePort) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, RustOpaque<RwLock<Exercise>>>(
         WrapInfo {
             debug_name: "new_exercise",
             port: Some(port_),
@@ -214,7 +211,7 @@ fn wire_run_exercise_set_impl(
     height_cm: impl Wire2Api<f64> + UnwindSafe,
     rhr: impl Wire2Api<f64> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>(
         WrapInfo {
             debug_name: "run_exercise_set",
             port: Some(port_),
@@ -245,7 +242,7 @@ fn wire_run_exercise_hr_push_impl(
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
     hr: impl Wire2Api<HR> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>(
         WrapInfo {
             debug_name: "run_exercise_hr_push",
             port: Some(port_),
@@ -263,7 +260,7 @@ fn wire_run_exercise_hr_list_add_impl(
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
     hr_list: impl Wire2Api<Vec<HR>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>(
         WrapInfo {
             debug_name: "run_exercise_hr_list_add",
             port: Some(port_),
@@ -280,7 +277,7 @@ fn wire_run_exercise_clear_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>(
         WrapInfo {
             debug_name: "run_exercise_clear",
             port: Some(port_),
@@ -296,7 +293,7 @@ fn wire_run_exercise_chart_hr_history_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, Vec<mirror_ChartPoint>>(
         WrapInfo {
             debug_name: "run_exercise_chart_hr_history",
             port: Some(port_),
@@ -304,12 +301,7 @@ fn wire_run_exercise_chart_hr_history_impl(
         },
         move || {
             let api_exercise = exercise.wire2api();
-            move |task_callback| {
-                Ok(run_exercise_chart_hr_history(api_exercise)
-                    .into_iter()
-                    .map(|v| mirror_ChartPoint(v))
-                    .collect::<Vec<_>>())
-            }
+            move |task_callback| Ok(run_exercise_chart_hr_history(api_exercise))
         },
     )
 }
@@ -317,7 +309,7 @@ fn wire_run_exercise_chart_ei_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, Vec<mirror_ChartPoint>>(
         WrapInfo {
             debug_name: "run_exercise_chart_ei",
             port: Some(port_),
@@ -325,12 +317,7 @@ fn wire_run_exercise_chart_ei_impl(
         },
         move || {
             let api_exercise = exercise.wire2api();
-            move |task_callback| {
-                Ok(run_exercise_chart_ei(api_exercise)
-                    .into_iter()
-                    .map(|v| mirror_ChartPoint(v))
-                    .collect::<Vec<_>>())
-            }
+            move |task_callback| Ok(run_exercise_chart_ei(api_exercise))
         },
     )
 }
@@ -338,7 +325,7 @@ fn wire_run_exercise_chart_ei_5min_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, Vec<mirror_ChartPoint>>(
         WrapInfo {
             debug_name: "run_exercise_chart_ei_5min",
             port: Some(port_),
@@ -346,12 +333,7 @@ fn wire_run_exercise_chart_ei_5min_impl(
         },
         move || {
             let api_exercise = exercise.wire2api();
-            move |task_callback| {
-                Ok(run_exercise_chart_ei_5min(api_exercise)
-                    .into_iter()
-                    .map(|v| mirror_ChartPoint(v))
-                    .collect::<Vec<_>>())
-            }
+            move |task_callback| Ok(run_exercise_chart_ei_5min(api_exercise))
         },
     )
 }
@@ -359,7 +341,7 @@ fn wire_run_exercise_hr_min_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, i32>(
         WrapInfo {
             debug_name: "run_exercise_hr_min",
             port: Some(port_),
@@ -375,7 +357,7 @@ fn wire_run_exercise_hr_max_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, i32>(
         WrapInfo {
             debug_name: "run_exercise_hr_max",
             port: Some(port_),
@@ -391,7 +373,7 @@ fn wire_run_exercise_hr_mean_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, i32>(
         WrapInfo {
             debug_name: "run_exercise_hr_mean",
             port: Some(port_),
@@ -408,7 +390,7 @@ fn wire_run_exercise_hr_percent_impl(
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
     hr: impl Wire2Api<i32> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, f64>(
         WrapInfo {
             debug_name: "run_exercise_hr_percent",
             port: Some(port_),
@@ -425,7 +407,7 @@ fn wire_run_exercise_kcal_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, f64>(
         WrapInfo {
             debug_name: "run_exercise_kcal",
             port: Some(port_),
@@ -441,7 +423,7 @@ fn wire_run_exercise_exercise_kcal_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, f64>(
         WrapInfo {
             debug_name: "run_exercise_exercise_kcal",
             port: Some(port_),
@@ -457,7 +439,7 @@ fn wire_run_exercise_ck_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, f64>(
         WrapInfo {
             debug_name: "run_exercise_ck",
             port: Some(port_),
@@ -473,7 +455,7 @@ fn wire_run_exercise_ei_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, f64>(
         WrapInfo {
             debug_name: "run_exercise_ei",
             port: Some(port_),
@@ -489,7 +471,7 @@ fn wire_run_exercise_hr_percent_range_list_impl(
     port_: MessagePort,
     exercise: impl Wire2Api<RustOpaque<RwLock<Exercise>>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, Vec<mirror_CalHrPercentRange>>(
         WrapInfo {
             debug_name: "run_exercise_hr_percent_range_list",
             port: Some(port_),
@@ -497,12 +479,7 @@ fn wire_run_exercise_hr_percent_range_list_impl(
         },
         move || {
             let api_exercise = exercise.wire2api();
-            move |task_callback| {
-                Ok(run_exercise_hr_percent_range_list(api_exercise)
-                    .into_iter()
-                    .map(|v| mirror_CalHrPercentRange(v))
-                    .collect::<Vec<_>>())
-            }
+            move |task_callback| Ok(run_exercise_hr_percent_range_list(api_exercise))
         },
     )
 }
@@ -511,7 +488,7 @@ fn wire_encrypt__method__Crypto_impl(
     that: impl Wire2Api<Crypto> + UnwindSafe,
     data: impl Wire2Api<Vec<u8>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, mirror_EncryptData>(
         WrapInfo {
             debug_name: "encrypt__method__Crypto",
             port: Some(port_),
@@ -520,7 +497,7 @@ fn wire_encrypt__method__Crypto_impl(
         move || {
             let api_that = that.wire2api();
             let api_data = data.wire2api();
-            move |task_callback| Ok(mirror_EncryptData(Crypto::encrypt(&api_that, api_data)))
+            move |task_callback| Ok(Crypto::encrypt(&api_that, api_data))
         },
     )
 }
@@ -530,7 +507,7 @@ fn wire_decrypt__method__Crypto_impl(
     nonce: impl Wire2Api<Vec<u8>> + UnwindSafe,
     data: impl Wire2Api<Vec<u8>> + UnwindSafe,
 ) {
-    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
+    FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, Vec<u8>>(
         WrapInfo {
             debug_name: "decrypt__method__Crypto",
             port: Some(port_),
@@ -547,22 +524,22 @@ fn wire_decrypt__method__Crypto_impl(
 // Section: wrapper structs
 
 #[derive(Clone)]
-struct mirror_CalHrPercentRange(CalHrPercentRange);
+pub struct mirror_CalHrPercentRange(CalHrPercentRange);
 
 #[derive(Clone)]
-struct mirror_ChartPoint(ChartPoint);
+pub struct mirror_ChartPoint(ChartPoint);
 
 #[derive(Clone)]
-struct mirror_EncryptData(EncryptData);
+pub struct mirror_EncryptData(EncryptData);
 
 #[derive(Clone)]
-struct mirror_Offset(Offset);
+pub struct mirror_Offset(Offset);
 
 #[derive(Clone)]
-struct mirror_Position(Position);
+pub struct mirror_Position(Position);
 
 #[derive(Clone)]
-struct mirror_Size(Size);
+pub struct mirror_Size(Size);
 
 // Section: static checks
 
@@ -656,49 +633,99 @@ impl Wire2Api<u8> for u8 {
 impl support::IntoDart for mirror_CalHrPercentRange {
     fn into_dart(self) -> support::DartAbi {
         vec![
-            self.0.start.into_dart(),
-            self.0.end.into_dart(),
-            self.0.percent.into_dart(),
+            self.0.start.into_into_dart().into_dart(),
+            self.0.end.into_into_dart().into_dart(),
+            self.0.percent.into_into_dart().into_dart(),
         ]
         .into_dart()
     }
 }
 impl support::IntoDartExceptPrimitive for mirror_CalHrPercentRange {}
+impl rust2dart::IntoIntoDart<mirror_CalHrPercentRange> for CalHrPercentRange {
+    fn into_into_dart(self) -> mirror_CalHrPercentRange {
+        mirror_CalHrPercentRange(self)
+    }
+}
 
 impl support::IntoDart for mirror_ChartPoint {
     fn into_dart(self) -> support::DartAbi {
-        vec![self.0.x.into_dart(), self.0.y.into_dart()].into_dart()
+        vec![
+            self.0.x.into_into_dart().into_dart(),
+            self.0.y.into_into_dart().into_dart(),
+        ]
+        .into_dart()
     }
 }
 impl support::IntoDartExceptPrimitive for mirror_ChartPoint {}
+impl rust2dart::IntoIntoDart<mirror_ChartPoint> for ChartPoint {
+    fn into_into_dart(self) -> mirror_ChartPoint {
+        mirror_ChartPoint(self)
+    }
+}
 
 impl support::IntoDart for mirror_EncryptData {
     fn into_dart(self) -> support::DartAbi {
-        vec![self.0.nonce.into_dart(), self.0.data.into_dart()].into_dart()
+        vec![
+            self.0.nonce.into_into_dart().into_dart(),
+            self.0.data.into_into_dart().into_dart(),
+        ]
+        .into_dart()
     }
 }
 impl support::IntoDartExceptPrimitive for mirror_EncryptData {}
+impl rust2dart::IntoIntoDart<mirror_EncryptData> for EncryptData {
+    fn into_into_dart(self) -> mirror_EncryptData {
+        mirror_EncryptData(self)
+    }
+}
 
 impl support::IntoDart for mirror_Offset {
     fn into_dart(self) -> support::DartAbi {
-        vec![self.0.x.into_dart(), self.0.y.into_dart()].into_dart()
+        vec![
+            self.0.x.into_into_dart().into_dart(),
+            self.0.y.into_into_dart().into_dart(),
+        ]
+        .into_dart()
     }
 }
 impl support::IntoDartExceptPrimitive for mirror_Offset {}
+impl rust2dart::IntoIntoDart<mirror_Offset> for Offset {
+    fn into_into_dart(self) -> mirror_Offset {
+        mirror_Offset(self)
+    }
+}
 
 impl support::IntoDart for mirror_Position {
     fn into_dart(self) -> support::DartAbi {
-        vec![self.0.latitude.into_dart(), self.0.longitude.into_dart()].into_dart()
+        vec![
+            self.0.latitude.into_into_dart().into_dart(),
+            self.0.longitude.into_into_dart().into_dart(),
+        ]
+        .into_dart()
     }
 }
 impl support::IntoDartExceptPrimitive for mirror_Position {}
+impl rust2dart::IntoIntoDart<mirror_Position> for Position {
+    fn into_into_dart(self) -> mirror_Position {
+        mirror_Position(self)
+    }
+}
 
 impl support::IntoDart for mirror_Size {
     fn into_dart(self) -> support::DartAbi {
-        vec![self.0.width.into_dart(), self.0.height.into_dart()].into_dart()
+        vec![
+            self.0.width.into_into_dart().into_dart(),
+            self.0.height.into_into_dart().into_dart(),
+        ]
+        .into_dart()
     }
 }
 impl support::IntoDartExceptPrimitive for mirror_Size {}
+impl rust2dart::IntoIntoDart<mirror_Size> for Size {
+    fn into_into_dart(self) -> mirror_Size {
+        mirror_Size(self)
+    }
+}
 
 impl support::IntoDart for ZoneType {
     fn into_dart(self) -> support::DartAbi {
@@ -714,6 +741,12 @@ impl support::IntoDart for ZoneType {
     }
 }
 impl support::IntoDartExceptPrimitive for ZoneType {}
+impl rust2dart::IntoIntoDart<ZoneType> for ZoneType {
+    fn into_into_dart(self) -> Self {
+        self
+    }
+}
+
 // Section: executor
 
 support::lazy_static! {