Skip to content

Commit

Permalink
chore(neon_framework): Remove unused NeonImageWrapper widget
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Aug 30, 2024
1 parent ee4b9f5 commit 5c6b788
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions packages/neon_framework/lib/src/widgets/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ typedef ErrorWidgetBuilder = Widget? Function(BuildContext context, Object? erro
/// See:
/// * [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.
Expand Down Expand Up @@ -157,7 +156,6 @@ class NeonImage extends StatelessWidget {
/// See:
/// * [NeonImage] for a customized image
/// * [NeonUriImage] for an image widget from an arbitrary URL.
/// * [NeonImageWrapper] for a wrapping widget for images
class NeonApiImage extends StatefulWidget {
/// Creates a new Neon API image fetching the image with the currently active account.
const NeonApiImage({
Expand Down Expand Up @@ -272,7 +270,6 @@ class _NeonApiImageState extends State<NeonApiImage> {
/// See:
/// * [NeonImage] for a customized image
/// * [NeonApiImage] for an image widget from an Nextcloud API endpoint.
/// * [NeonImageWrapper] for a wrapping widget for images
class NeonUriImage extends StatefulWidget {
/// Creates a new Neon URL image with the active account.
const NeonUriImage({
Expand Down Expand Up @@ -390,57 +387,3 @@ class _NeonUriImageState extends State<NeonUriImage> {
);
}
}

/// Nextcloud image wrapper widget.
///
/// Wraps a child (most commonly an image) into a uniformly styled container.
///
/// See:
/// * [NeonImage] for a customized image
/// * [NeonApiImage] for an image widget from an Nextcloud API endpoint.
/// * [NeonUriImage] for an image widget from an arbitrary URL.
class NeonImageWrapper extends StatelessWidget {
/// Creates a new image wrapper.
const NeonImageWrapper({
required this.child,
this.color = Colors.white,
this.size,
this.borderRadius,
super.key,
});

/// The widget below this widget in the tree.
///
/// {@macro flutter.widgets.ProxyWidget.child}
final Widget child;

/// The color to paint the background area with.
final Color color;

/// The size of the widget.
final Size? size;

/// The corners of this box are rounded by this [BorderRadius].
///
/// If null defaults to `const BorderRadius.all(Radius.circular(8))`.
///
/// The shape or the [borderRadius] won't clip the children of the decorated [Container].
/// If the clip is required, insert a clip widget (e.g., [ClipRect], [ClipRRect], [ClipPath])
/// as the child of the [Container]. Be aware that clipping may be costly in terms of performance.
final BorderRadius? borderRadius;

@override
Widget build(BuildContext context) {
return Container(
height: size?.height,
width: size?.width,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: borderRadius ?? const BorderRadius.all(Radius.circular(8)),
color: color,
),
clipBehavior: Clip.antiAlias,
child: child,
);
}
}

0 comments on commit 5c6b788

Please sign in to comment.