diff --git a/images/field23small.png b/images/field23small.png deleted file mode 100644 index 2e4e0041..00000000 Binary files a/images/field23small.png and /dev/null differ diff --git a/lib/services/pplib_telemetry.dart b/lib/services/pplib_telemetry.dart index 50307623..9104fd28 100644 --- a/lib/services/pplib_telemetry.dart +++ b/lib/services/pplib_telemetry.dart @@ -93,7 +93,7 @@ class PPLibTelemetry { } Stream connectionStatusStream() { - return _client.connectionStatusStream(); + return _client.connectionStatusStream().asBroadcastStream(); } Stream?> targetPoseStream() { diff --git a/lib/widgets/field_image.dart b/lib/widgets/field_image.dart index d869f082..28cdcd3e 100644 --- a/lib/widgets/field_image.dart +++ b/lib/widgets/field_image.dart @@ -12,7 +12,6 @@ enum OfficialField { class FieldImage { late final Image image; - Image? imageSmall; late final ui.Size defaultSize; ui.Size? defaultSizeSmall; late num pixelsPerMeter; @@ -39,6 +38,7 @@ class FieldImage { image = Image.asset( 'images/field22.png', fit: BoxFit.contain, + filterQuality: FilterQuality.medium, ); defaultSize = const ui.Size(3240, 1620); pixelsPerMeter = 196.85; @@ -49,10 +49,7 @@ class FieldImage { image = Image.asset( 'images/field23.png', fit: BoxFit.contain, - ); - imageSmall = Image.asset( - 'images/field23small.png', - fit: BoxFit.contain, + filterQuality: FilterQuality.medium, ); defaultSize = const ui.Size(3256, 1578); defaultSizeSmall = const ui.Size(407, 197); @@ -109,11 +106,11 @@ class FieldImage { int get hashCode => Object.hash(image.hashCode, defaultSize.hashCode, pixelsPerMeter.hashCode, name.hashCode); - Widget getWidget({bool small = false}) { + Widget getWidget() { return AspectRatio( aspectRatio: defaultSize.width / defaultSize.height, child: SizedBox.expand( - child: (small && imageSmall != null) ? imageSmall : image, + child: image, ), ); } diff --git a/lib/widgets/mini_path_preview.dart b/lib/widgets/mini_path_preview.dart index 9b88aee5..e59248a6 100644 --- a/lib/widgets/mini_path_preview.dart +++ b/lib/widgets/mini_path_preview.dart @@ -19,7 +19,7 @@ class MiniPathsPreview extends StatelessWidget { Widget build(BuildContext context) { return Stack( children: [ - fieldImage.getWidget(small: true), + fieldImage.getWidget(), Positioned.fill( child: PathPreviewPainter( paths: paths, diff --git a/pubspec.yaml b/pubspec.yaml index a8c0c0fb..1f52a16c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -79,7 +79,6 @@ flutter: assets: - images/field22.png - images/field23.png - - images/field23small.png - images/icon.png - images/choreo.png - resources/default_navgrid.json diff --git a/test/widgets/mini_path_preview_test.dart b/test/widgets/mini_path_preview_test.dart index 49d5ff50..4a5dbe5d 100644 --- a/test/widgets/mini_path_preview_test.dart +++ b/test/widgets/mini_path_preview_test.dart @@ -30,7 +30,7 @@ void main() { )); expect(find.byType(PathPreviewPainter), findsOneWidget); - expect(find.image(fieldImage.imageSmall!.image), findsOneWidget); + expect(find.image(fieldImage.image.image), findsOneWidget); }); testWidgets('mini preview w/o small image', (widgetTester) async {