From 160d79de565f308640cfc4785121dcad195f9eea Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 20 Feb 2024 00:28:57 +0100 Subject: [PATCH] refactor(neon_framework): Hide NeonImage Signed-off-by: provokateurin --- packages/neon/neon_dashboard/test/widget_test.dart | 6 +++--- packages/neon_framework/lib/src/widgets/image.dart | 2 ++ packages/neon_framework/lib/widgets.dart | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/neon/neon_dashboard/test/widget_test.dart b/packages/neon/neon_dashboard/test/widget_test.dart index 1ec090ca324..de7b7783a34 100644 --- a/packages/neon/neon_dashboard/test/widget_test.dart +++ b/packages/neon/neon_dashboard/test/widget_test.dart @@ -86,7 +86,7 @@ void main() { BorderRadius.circular(largeIconSize), ), ); - expect(find.byType(NeonImage), findsNWidgets(2)); + expect(find.byType(NeonUriImage), findsNWidgets(2)); await expectLater(find.byType(DashboardWidgetItem), matchesGoldenFile('goldens/widget_item.png')); }); @@ -146,7 +146,7 @@ void main() { ), ); - expect(find.byType(NeonImage), findsOneWidget); + expect(find.byType(NeonUriImage), findsOneWidget); }); }); @@ -295,7 +295,7 @@ void main() { BorderRadius.circular(largeIconSize), ), ); - expect(find.byType(NeonImage), findsNWidgets(3)); + expect(find.byType(NeonUriImage), findsNWidgets(3)); expect(find.byType(DashboardWidgetItem), findsOneWidget); expect(find.bySubtype(), findsOneWidget); expect(find.byIcon(Icons.add), findsOneWidget); diff --git a/packages/neon_framework/lib/src/widgets/image.dart b/packages/neon_framework/lib/src/widgets/image.dart index c08ffbed2c0..80e6cb7fdf6 100644 --- a/packages/neon_framework/lib/src/widgets/image.dart +++ b/packages/neon_framework/lib/src/widgets/image.dart @@ -4,6 +4,7 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:meta/meta.dart'; import 'package:neon_framework/src/bloc/result.dart'; import 'package:neon_framework/src/blocs/accounts.dart'; import 'package:neon_framework/src/models/account.dart'; @@ -27,6 +28,7 @@ typedef ApiImageDownloader = DynamiteRawResponse Function(Ne /// * [NeonApiImage] for an image widget from an Nextcloud API endpoint. /// * [NeonUriImage] for an image widget from an arbitrary URL. /// * [NeonImageWrapper] for a wrapping widget for images +@internal class NeonImage extends StatelessWidget { /// Custom image implementation. const NeonImage({ diff --git a/packages/neon_framework/lib/widgets.dart b/packages/neon_framework/lib/widgets.dart index da828ef4f66..e68132aeace 100644 --- a/packages/neon_framework/lib/widgets.dart +++ b/packages/neon_framework/lib/widgets.dart @@ -1,7 +1,7 @@ export 'package:neon_framework/src/widgets/custom_background.dart'; export 'package:neon_framework/src/widgets/dialog.dart' hide NeonAccountSelectionDialog, NeonUnifiedPushDialog; export 'package:neon_framework/src/widgets/error.dart'; -export 'package:neon_framework/src/widgets/image.dart'; +export 'package:neon_framework/src/widgets/image.dart' hide NeonImage; export 'package:neon_framework/src/widgets/linear_progress_indicator.dart'; export 'package:neon_framework/src/widgets/list_view.dart'; export 'package:neon_framework/src/widgets/relative_time.dart';