Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: formatted and fixed documentations #534

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
---
name: Bug report
about: Create a report to help us fix any issues you are having
title: ''
labels: 'bug'
assignees: ''

title: ""
labels: "bug"
assignees: ""
---

### :information_source: Info
<!--- Please enter what version of Flutter Launcher Icons you were using so we can identify if this is a problem with a certain version of the package --->


<!--- Please enter what version of Flutter Launcher Icons you were using so we can identify if this is a problem with a certain version of the package --->

### :speech_balloon: Description
<!--- What is the issue? Does it fail during execution? Does it produce incorrect / wrong icons? Please include all details here --->


<!--- What is the issue? Does it fail during execution? Does it produce incorrect / wrong icons? Please include all details here --->

### :scroll: Pubspec.yaml

<!--- Please insert your flutter_launcher_icons yaml configuration here --->

```yaml
flutter_launcher_icons:
android:
ios:
image_path:
android:
ios:
image_path:
```
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea to improve Flutter Launcher Icons
title: ''
title: ""
labels: improvement
assignees: ''

assignees: ""
---

### :speech_balloon: Description
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd-pub-deploy-published-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
uses: k-paxian/[email protected]
with:
accessToken: ${{ secrets.PUB_ACCESS_TOKEN }}
refreshToken: ${{ secrets.PUB_REFRESH_TOKEN}}
refreshToken: ${{ secrets.PUB_REFRESH_TOKEN}}
2 changes: 1 addition & 1 deletion .github/workflows/ci-open-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: run tests & analyzer for new pr

on:
pull_request:
branches: [ master ]
branches: [master]

# allows for this workflow to be run manually from the Actions tab
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ pubspec.lock
# Directory created by dartdoc
doc/api/

.DS_Store
.DS_Store
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
## 0.13.1 (15th April 2023)

- Can now use `flutter_launcher_icons` instead of `flutter_icons` [#478](https://github.com/fluttercommunity/flutter_launcher_icons/pull/478)
- Can use command `flutter pub run flutter_launcher_icons:generate` to automatically generate config file [#475](https://github.com/fluttercommunity/flutter_launcher_icons/pull/475)

- Can use command `dart run flutter_launcher_icons:generate` to automatically generate config file [#475](https://github.com/fluttercommunity/flutter_launcher_icons/pull/475)

## 0.13.0 (7th April 2023)

Expand All @@ -36,7 +35,7 @@
- Updated image package and other packages [#447](https://github.com/fluttercommunity/flutter_launcher_icons/pull/447)

## 0.11.0 (27th September 2022)

- Support for Macos Icons [#407](https://github.com/fluttercommunity/flutter_launcher_icons/pull/407)
- Cli-improvement [#400](https://github.com/fluttercommunity/flutter_launcher_icons/pull/400)
- Add `repository` and `issue_tracker` [#411](https://github.com/fluttercommunity/flutter_launcher_icons/pull/411) (thanks to [@patelpathik](https://github.com/patelpathik))
Expand Down Expand Up @@ -156,7 +155,7 @@

## 0.3.0 (1st May 2018)

- Fixed issue where icons produced weren't the correct size (Due to images not with a 1:1 aspect r ation)
- Fixed issue where icons produced weren't the correct size (Due to images not with a 1:1 aspect ratio)
- Improved quality of smaller icons produced (Thanks to PR #17 - Thank you!)
- Updated console printed messages to keep them consistent
- Added example folder to GitHub project
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ Shown below is the full list of attributes which you can specify within your Flu
- `image_path`: The location of the icon image file which you want to use as the app launcher icon
- `image_path_android`: The location of the icon image file specific for Android platform (optional - if not defined then the image_path is used)
- `min_sdk_android`: Specify android min sdk value
**The next two attributes are only used when generating Android launcher icon**
**The next two attributes are only used when generating Android launcher icon**

- `adaptive_icon_background`: The color (E.g. `"#ffffff"`) or image asset (E.g. `"assets/images/christmas-background.png"`) which will
be used to fill out the background of the adaptive icon.
- `adaptive_icon_foreground`: The image asset which will be used for the icon foreground of the adaptive icon
*Note: Adaptive Icons will only be generated when both adaptive_icon_background and adaptive_icon_foreground are specified. (the image_path is not automatically taken as foreground)*
be used to fill out the background of the adaptive icon.
- `adaptive_icon_foreground`: The image asset which will be used for the icon foreground of the adaptive icon
_Note: Adaptive Icons will only be generated when both adaptive_icon_background and adaptive_icon_foreground are specified. (the image_path is not automatically taken as foreground)_
- `adaptive_icon_foreground_inset`: This is used to add padding to the icon when applying an adaptive icon. The default value is `16`.
- `adaptive_icon_monochrome`: The image asset which will be used for the icon
foreground of the Android 13+ themed icon. For more information see [Android Adaptive Icons](https://developer.android.com/develop/ui/views/launch/icon_design_adaptive#user-theming)
foreground of the Android 13+ themed icon. For more information see [Android Adaptive Icons](https://developer.android.com/develop/ui/views/launch/icon_design_adaptive#user-theming)

### IOS

Expand All @@ -117,33 +117,33 @@ foreground of the Android 13+ themed icon. For more information see [Android Ada
- `icon/path/here.png`: This will generate a new launcher icons for the platform with the name you specify, without removing the old default existing Flutter launcher icon.
- `image_path_ios`: The location of the icon image file specific for iOS platform (optional - if not defined then the image_path is used)
- `remove_alpha_ios`: Removes alpha channel for IOS icons
- `image_path_ios_dark_transparent`: The location of the dark mode icon image file specific for iOS 18+ platform. *Note: Apple recommends this icon to be transparent. For more information see [Apple Human Interface Guidelines for App Icons](https://developer.apple.com/design/human-interface-guidelines/app-icons#iOS-iPadOS)*
- `image_path_ios_tinted_grayscale`: The location of the tinted mode icon image file specific for iOS 18+ platform. *Note: This icon should be an grayscale image. Use `desaturate_tinted_to_grayscale_ios: true` to automatically desaturate the image provided here.*
- `desaturate_tinted_to_grayscale_ios`: Automatically desaturates tinted mode icon image to grayscale, *defaults to false*
- `image_path_ios_dark_transparent`: The location of the dark mode icon image file specific for iOS 18+ platform. _Note: Apple recommends this icon to be transparent. For more information see [Apple Human Interface Guidelines for App Icons](https://developer.apple.com/design/human-interface-guidelines/app-icons#iOS-iPadOS)_
- `image_path_ios_tinted_grayscale`: The location of the tinted mode icon image file specific for iOS 18+ platform. _Note: This icon should be an grayscale image. Use `desaturate_tinted_to_grayscale_ios: true` to automatically desaturate the image provided here._
- `desaturate_tinted_to_grayscale_ios`: Automatically desaturates tinted mode icon image to grayscale, _defaults to false_
- `background_color_ios`: The color (in the format "#RRGGBB") to be used as the background when removing the alpha channel. It is used only when the `remove_alpha_ios` property is set to true. (optional - if not defined then `#ffffff` is used)

### Web

- `web`: Add web related configs
- `generate`: Specifies whether to generate icons for this platform or not
- `image_path`: Path to web icon.png
- `background_color`: Updates *background_color* in `web/manifest.json`
- `theme_color`: Updates *theme_color* in `web/manifest.json`
- `background_color`: Updates _background_color_ in `web/manifest.json`
- `theme_color`: Updates _theme_color_ in `web/manifest.json`

### Windows

- `windows`: Add Windows related configs
- `generate`: Specifies whether to generate icons for Windows platform or not
- `image_path`: Path to web icon.png
- `icon_size`: Windows app icon size. Icon size should be within this constrains *48<=icon_size<=256, defaults to 48*
- `icon_size`: Windows app icon size. Icon size should be within this constrains _48<=icon_size<=256, defaults to 48_

### MacOS

- `macos`: Add MacOS related configs
- `generate`: Specifies whether to generate icons for MacOS platform or not
- `image_path`: Path to macos icon.png file

*Note: iOS icons should [fill the entire image](https://stackoverflow.com/questions/26014461/black-border-on-my-ios-icon) and not contain transparent borders.*
_Note: iOS icons should [fill the entire image](https://stackoverflow.com/questions/26014461/black-border-on-my-ios-icon) and not contain transparent borders._

## Flavor support

Expand Down
2 changes: 0 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ linter:
- always_declare_return_types
- always_put_control_body_on_new_line

- always_require_non_null_named_parameters
- annotate_overrides
- avoid_empty_else
- avoid_field_initializers_in_const_classes
Expand Down Expand Up @@ -70,7 +69,6 @@ linter:
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_final_locals
- prefer_foreach
Expand Down
6 changes: 3 additions & 3 deletions bin/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const _defaultConfigFileName = './flutter_launcher_icons.yaml';
/// The function will be called from command line
/// using the following command:
/// ```sh
/// flutter pub run flutter_launcher_icons:generate
/// dart run flutter_launcher_icons:generate
/// ```
///
/// Calling this function will generate a flutter_launcher_icons.yaml file
Expand Down Expand Up @@ -73,7 +73,7 @@ void _generateConfigFile(File configFile) {
print('\nConfig file generated successfully 🎉');
print(
'You can now use this new config file by using the command below:\n\n'
'flutter pub run flutter_launcher_icons'
'dart run flutter_launcher_icons'
'${configFile.path == _defaultConfigFileName ? '' : ' -f ${configFile.path}'}\n',
);
} on Exception catch (e) {
Expand All @@ -82,7 +82,7 @@ void _generateConfigFile(File configFile) {
}

const _configFileTemplate = '''
# flutter pub run flutter_launcher_icons
# dart run flutter_launcher_icons
flutter_launcher_icons:
image_path: "assets/icon/icon.png"

Expand Down
2 changes: 1 addition & 1 deletion bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'flutter_launcher_icons.dart' as flutter_launcher_icons;

void main(List<String> arguments) {
print(
'This command is deprecated and replaced with "flutter pub run flutter_launcher_icons"',
'This command is deprecated and replaced with "dart run flutter_launcher_icons"',
);
flutter_launcher_icons.main(arguments);
}
2 changes: 1 addition & 1 deletion example/default_example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A new Flutter project to quickly test flutter_launcher_icons.
version: 1.0.0+1

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: '>=2.17.0 <3.0.0'

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion example/flavors/flutter_launcher_icons-production.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flutter_launcher_icons:
android: true
ios: true
image_path: "assets/launcher_icon/demo-icon.png"
image_path: "assets/launcher_icon/demo-icon.png"
2 changes: 1 addition & 1 deletion example/flavors/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter project.
version: 1.0.0+1

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
Expand Down
10 changes: 4 additions & 6 deletions flutter_launcher_icons.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
"[dart]": {
"editor.formatOnSave": true,
// "editor.formatOnType": true,
"editor.rulers": [
120
],
"editor.rulers": [120],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false,
"editor.wordBasedSuggestions": "off",
"files.insertFinalNewline": true
},
"dart.lineLength": 120,
"dart.lineLength": 120
}
}
}
2 changes: 1 addition & 1 deletion lib/android.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void updateColorsXmlFile(String backgroundConfig, String? flavor) {
}
}

/// creates adaptive background using png image
/// Creates adaptive background using png image
void _createAdaptiveBackgrounds(
Config config,
String adaptiveIconBackgroundImagePath,
Expand Down
16 changes: 8 additions & 8 deletions lib/config/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ class Config {
@JsonKey(name: 'image_path_ios_tinted_grayscale')
final String? imagePathIOSTintedGrayscale;

/// android adaptive_icon_foreground image
/// Android adaptive_icon_foreground image path
@JsonKey(name: 'adaptive_icon_foreground')
final String? adaptiveIconForeground;

/// android adaptive_icon_foreground inset
/// Android adaptive_icon_foreground inset
@JsonKey(name: 'adaptive_icon_foreground_inset')
final int adaptiveIconForegroundInset;

/// android adaptive_icon_background image
/// Android adaptive_icon_background image path
@JsonKey(name: 'adaptive_icon_background')
final String? adaptiveIconBackground;

/// android adaptive_icon_background image
/// Android adaptive_icon_monochrome image path
@JsonKey(name: 'adaptive_icon_monochrome')
final String? adaptiveIconMonochrome;

Expand Down Expand Up @@ -176,13 +176,13 @@ class Config {
/// Creates [Config] icons from [json]
factory Config.fromJson(Map json) => _$ConfigFromJson(json);

/// whether or not there is configuration for adaptive icons for android
/// Whether or not there is configuration for adaptive icons for android
bool get hasAndroidAdaptiveConfig =>
isNeedingNewAndroidIcon &&
adaptiveIconForeground != null &&
adaptiveIconBackground != null;

/// whether or not there is configuration for monochrome icons for android
/// Whether or not there is configuration for monochrome icons for android
bool get hasAndroidAdaptiveMonochromeConfig {
return isNeedingNewAndroidIcon && adaptiveIconMonochrome != null;
}
Expand Down Expand Up @@ -210,10 +210,10 @@ class Config {
/// bool - override the default flutter project icon
bool get isCustomAndroidFile => android is String;

/// if we are needing a new Android icon
/// If we are needing a new Android icon
bool get isNeedingNewAndroidIcon => android != false;

/// if we are needing a new iOS icon
/// If we are needing a new iOS icon
bool get isNeedingNewIOSIcon => ios != false;

/// Method for the retrieval of the Android icon path
Expand Down
4 changes: 2 additions & 2 deletions lib/config/web_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class WebConfig {
@JsonKey(name: 'image_path')
final String? imagePath;

/// manifest.json's background_color
/// `manifest.json`'s background_color
@JsonKey(name: 'background_color')
final String? backgroundColor;

/// manifest.json's theme_color
/// `manifest.json`'s theme_color
@JsonKey(name: 'theme_color')
final String? themeColor;

Expand Down
2 changes: 1 addition & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const String iosConfigFile = 'ios/Runner.xcodeproj/project.pbxproj';
const String iosDefaultIconName = 'Icon-App';

// web
/// favicon.ico size
/// `favicon.ico` size
const int kFaviconSize = 16;

/// Relative web direcotry path
Expand Down
12 changes: 6 additions & 6 deletions lib/ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import 'package:image/image.dart';

/// File to handle the creation of icons for iOS platform
class IosIconTemplate {
/// constructs an instance of [IosIconTemplate]
/// Constructs an instance of [IosIconTemplate]
IosIconTemplate({required this.size, required this.name});

/// suffix of the icon name
/// Suffix of the icon name
final String name;

/// the size of the icon
/// The size of the icon
final int size;
}

/// details of the ios icons which need to be generated
/// Details of the ios icons which need to be generated
List<IosIconTemplate> legacyIosIcons = <IosIconTemplate>[
IosIconTemplate(name: '-20x20@1x', size: 20),
IosIconTemplate(name: '-20x20@2x', size: 40),
Expand Down Expand Up @@ -65,7 +65,7 @@ List<IosIconTemplate> iosIcons = <IosIconTemplate>[
IosIconTemplate(name: '-1024x1024@1x', size: 1024),
];

/// create the ios icons
/// Create the ios icons
void createIcons(Config config, String? flavor) {
// TODO(p-mazhnik): support prefixPath
final String? filePath = config.getImagePathIOS();
Expand Down Expand Up @@ -236,7 +236,7 @@ void saveNewIcons(IosIconTemplate template, Image image, String newIconName) {
});
}

/// create resized icon image
/// Create resized icon image
Image createResizedImage(IosIconTemplate template, Image image) {
if (image.width >= template.size) {
return copyResize(
Expand Down
Loading
Loading