andoriyaprashant / andoriyaprashant/OpSo

fix: correct fallback asset rendering in LinuxFoundationWidget

Open
#452 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
53
Forks
108
PR merge metrics
No merged PRs in 30d

Description

### Description
In `lib/widgets/linux_foundation_widget.dart`, if the `modal.imageUrl` is empty, the widget attempts to render a fallback asset:
```dart
modal.imageUrl == ""
? SvgPicture.asset(
'assets/logo.png',
fit: BoxFit.fitWidth,
height: 60,
)
```

There are two bugs here:
1. There is no file named `assets/logo.png` in the repository. The correct fallback asset should likely be `assets/linux_foundation_logo.png`.
2. The fallback asset is a PNG file, but it is being loaded using `SvgPicture.asset`. This will fail/crash at runtime because the SVG parser cannot parse PNG data.

### Solution
Replace `SvgPicture.asset('assets/logo.png')` with `Image.asset('assets/linux_foundation_logo.png')` for correct PNG asset rendering.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.