Skip to content

Commit

Permalink
refactor(neon_framework): Hide NeonImage
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Feb 19, 2024
1 parent bdfe61f commit 160d79d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/neon/neon_dashboard/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});
Expand Down Expand Up @@ -146,7 +146,7 @@ void main() {
),
);

expect(find.byType(NeonImage), findsOneWidget);
expect(find.byType(NeonUriImage), findsOneWidget);
});
});

Expand Down Expand Up @@ -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<FilledButton>(), findsOneWidget);
expect(find.byIcon(Icons.add), findsOneWidget);
Expand Down
2 changes: 2 additions & 0 deletions packages/neon_framework/lib/src/widgets/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -27,6 +28,7 @@ typedef ApiImageDownloader = DynamiteRawResponse<Uint8List, dynamic> 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({
Expand Down
2 changes: 1 addition & 1 deletion packages/neon_framework/lib/widgets.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 160d79d

Please sign in to comment.