From 0dfdb4e07552423da31865a747e7d3c496e91e8a Mon Sep 17 00:00:00 2001 From: OutdatedGuy Date: Sat, 30 Dec 2023 00:41:50 +0530 Subject: [PATCH] refactor: using captitalized doc comments --- lib/android.dart | 2 +- lib/config/config.dart | 8 ++++---- lib/config/web_config.dart | 4 ++-- lib/constants.dart | 2 +- lib/ios.dart | 12 ++++++------ lib/pubspec_parser.dart | 6 +++--- test/package_version_test.dart | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/android.dart b/lib/android.dart index 30249890f4..2145c3345c 100644 --- a/lib/android.dart +++ b/lib/android.dart @@ -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, diff --git a/lib/config/config.dart b/lib/config/config.dart index 712efb40a2..81b33da21e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -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; } @@ -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 diff --git a/lib/config/web_config.dart b/lib/config/web_config.dart index c0130375c3..1488c20560 100644 --- a/lib/config/web_config.dart +++ b/lib/config/web_config.dart @@ -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; diff --git a/lib/constants.dart b/lib/constants.dart index 6ef7d01c6b..93ecfb026a 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -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 diff --git a/lib/ios.dart b/lib/ios.dart index 907e056b31..8868a5e41f 100644 --- a/lib/ios.dart +++ b/lib/ios.dart @@ -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 legacyIosIcons = [ IosIconTemplate(name: '-20x20@1x', size: 20), IosIconTemplate(name: '-20x20@2x', size: 40), @@ -65,7 +65,7 @@ List iosIcons = [ 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(); @@ -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( diff --git a/lib/pubspec_parser.dart b/lib/pubspec_parser.dart index c8b33819bc..a538862ddf 100644 --- a/lib/pubspec_parser.dart +++ b/lib/pubspec_parser.dart @@ -2,13 +2,13 @@ import 'dart:io'; import 'package:yaml/yaml.dart'; -/// helper class for parsing the contents of pubspec file +/// Helper class for parsing the contents of pubspec file class PubspecParser { - /// ensures unnamed constructor cannot be used as this class should only have + /// Ensures unnamed constructor cannot be used as this class should only have /// static methods PubspecParser._(); - /// parses the pubspec located at [path] to map + /// Parses the pubspec located at [path] to map static Map fromPathToMap(String path) { final File file = File(path); final String yamlString = file.readAsStringSync(); diff --git a/test/package_version_test.dart b/test/package_version_test.dart index 50a746fcbe..f43a50ec63 100644 --- a/test/package_version_test.dart +++ b/test/package_version_test.dart @@ -3,7 +3,7 @@ import 'package:flutter_launcher_icons/src/version.dart'; import 'package:test/test.dart'; void main() { - /// this helps avoid an issue where the pubspec version has been increased but + /// This helps avoid an issue where the pubspec version has been increased but /// build runner has not been run to up the version which is displayed /// when flutter_launcher_icons is run test('package version is correct', () {