fluttercommunity / fluttercommunity/flutter_launcher_icons

Mac icons request 824*824 safearea

Open
#655 5 comments 1 reaction 0 assignees View on GitHub
improvement
Dominant language
Dart
Stars
2.1k
Forks
426
PR merge metrics
No merged PRs in 30d

Description

The maximum requirement for Mac icons is 1024 * 1024, but it is recommended that the effective design area be 824 * 824

However, the unified requirement for plugins is a 1024 * 1024 image. If both Windows and Mac use the same image, the icon generated by Mac will be significantly larger than what Apple recommends.

Suggest adding a MAC parameter and adding a boolean padding to determine if a 100px transparent border needs to be automatically filled.

Modify the code as follows:
lib/macos/macos_icon_generator.dart
```
Image _processBaseImage(Image originalImage) {
// First resize the image to 824x824
final resizedImage = copyResize(
originalImage,
width: 824,
height: 824,
interpolation: Interpolation.cubic,
maintainAspect: true,
);

// Create a new image with transparent border (824 + 100*2 = 1024x1024)
final borderedImage = Image(width: 1024, height: 1024, numChannels: 4);

// Fill with transparent background
fill(borderedImage, color: ColorInt16.rgba(0, 0, 0, 0));
compositeImage(borderedImage, resizedImage, dstX: 100, dstY: 100);
return borderedImage;
}
```
lib/config/macos_config.dart
```
class MacOSConfig {
/// Specifies weather to generate icons for macos
@JsonKey()
final bool generate;

@JsonKey()
final bool padding;

/// Image path for macos
@JsonKey(name: 'image_path')
final String? imagePath;

/// Creates a instance of [MacOSConfig]
const MacOSConfig({
this.generate = false,
this.padding = false,
this.imagePath,
});
```

Increase during use
```
macos:
generate: true
padding: true
image_path: "assets/icons/cl02_1024.png"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.