Skip to content

Commit

Permalink
Fixed white fragments on semitransparent pixels in application images
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Nov 8, 2024
1 parent b1a187c commit 72b594d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
46 changes: 38 additions & 8 deletions lib/model/extensions/enums/image_file_type_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,43 @@ import '../../enums/image_file_type.dart';

extension ImageFileTypeX on ImageFileType {
Widget buildImageWidget(Uint8List imageData) => switch (this) {
ImageFileType.svg => SvgPicture.memory(imageData),
ImageFileType.svgz => SvgPicture.memory(imageData),
ImageFileType.png => Image.memory(imageData),
ImageFileType.jpg => Image.memory(imageData),
ImageFileType.jpeg => Image.memory(imageData),
ImageFileType.gif => Image.memory(imageData),
ImageFileType.bmp => Image.memory(imageData),
ImageFileType.webp => Image.memory(imageData),
ImageFileType.svg => SvgPicture.memory(
imageData,
colorFilter: ColorFilter.mode(
Colors.transparent,
BlendMode.srcOver,
),
),
ImageFileType.svgz => SvgPicture.memory(
imageData,
colorFilter: ColorFilter.mode(
Colors.transparent,
BlendMode.srcOver,
),
),
ImageFileType.png => Image.memory(
imageData,
colorBlendMode: BlendMode.srcOver,
),
ImageFileType.jpg => Image.memory(
imageData,
colorBlendMode: BlendMode.srcOver,
),
ImageFileType.jpeg => Image.memory(
imageData,
colorBlendMode: BlendMode.srcOver,
),
ImageFileType.gif => Image.memory(
imageData,
colorBlendMode: BlendMode.srcOver,
),
ImageFileType.bmp => Image.memory(
imageData,
colorBlendMode: BlendMode.srcOver,
),
ImageFileType.webp => Image.memory(
imageData,
colorBlendMode: BlendMode.srcOver,
),
};
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ publish_to: none
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 4.4.2+404202 # TODO Set the right version number
version: 4.4.2+404203 # TODO Set the right version number

# version: major.minor.build + 2x major|2x minor|3x build
# version: version number + build number (optional)
Expand Down

0 comments on commit 72b594d

Please sign in to comment.