Skip to content

Commit

Permalink
improvement docs and fixed pub.dev analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
mrrhak committed May 7, 2022
1 parent 5c7e8d2 commit e4c6809
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 36 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.1.5
- Fixed issue with pub.dev analysis

## 1.1.4
- Fixed android adaptive icon ([#3](https://github.com/mrrhak/icons_launcher/issues/3))
- Android files are generated to `mipmap` instead of `drawable` follow Android Studio
Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div align="center">
<h1 align="center">✨ Icons Launcher ✨</h1>

###### This package is forked from [Flutter Launcher Icons](https://pub.dev/packages/flutter_launcher_icons)
<p align="center">
A command-line tool that simplifies the task of updating your Flutter app's launcher icon. Full flexibility allows you to only update the launcher icon for specific platforms as needed.
</p>
</div>

<div align="center">
Expand All @@ -21,7 +22,7 @@
alt="Build Status" />
</a>
<a href="https://github.com/mrrhak/icons_launcher">
<img src="https://img.shields.io/github/languages/code-size/mrrhak/icons_launcher?logo=github&color=brown&label=Size"
<img src="https://img.shields.io/github/languages/code-size/mrrhak/icons_launcher?logo=github&color=blue&label=Size"
alt="Code size" />
</a>
<a href="https://opensource.org/licenses/MIT">
Expand All @@ -34,17 +35,15 @@
</a>
</div>

### **Platform Support**
---

| Android | iOS | MacOS | Web | Linux | Windows |
| :-----: | :---: | :---: | :---: | :---: | :-----: |
| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
### **Platform Support**

A command-line tool that simplifies the task of updating your Flutter app's launcher icon. Full flexibility allows you to only update the launcher icon for specific platforms as needed.
| Android | iOS | MacOS | Web | Linux | Windows |
| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: |
| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |

Want to see older changes? Be sure to check out the [Changelog](https://github.com/mrrhak/icons_launcher/blob/master/CHANGELOG.md).

---

## Guide

Expand All @@ -58,7 +57,7 @@ An example is shown below. More complex examples [here](https://github.com/mrrha

```yaml
dev_dependencies:
icons_launcher: "^1.1.4"
icons_launcher: ^1.1.5

flutter_icons:
image_path: 'assets/ic_logo_border.png'
Expand Down Expand Up @@ -147,7 +146,7 @@ The configuration file format is the same.

```yaml
dev_dependencies:
icons_launcher: "^1.1.4"
icons_launcher: ^1.1.5

flutter_icons:
# image_path: 'assets/ic_logo_border.png'
Expand Down Expand Up @@ -193,3 +192,8 @@ flutter_icons:
linux: false
web: false
```
---
<h6 align="center">This package is forked from <a href="https://pub.dev/packages/flutter_launcher_icons">flutter_launcher_icons</a></h2>
2 changes: 2 additions & 0 deletions bin/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'dart:async';
import 'package:icons_launcher/main.dart' as icons_launcher;

/// Run the main app
void main(List<String> arguments) {
// Start creating icons
unawaited(icons_launcher.createIconsFromArguments(arguments));
}
2 changes: 1 addition & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ String introMessage() {
return '''\n
═════════════════════════════════════════════
✨ ICONS LAUNCHER STARTING ✨
v1.1.4
v1.1.5
═════════════════════════════════════════════\n''';
}
5 changes: 3 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: icons_launcher
description: A command-line tool that simplifies the task of updating your Flutter app's launcher icon.
version: 1.1.4
maintainer: Mrr Hak
homepage: https://github.com/mrrhak/icons_launcher
homepage: https://mrrhak.com
repository: https://github.com/mrrhak/icons_launcher
version: 1.1.5

dependencies:
args: ^2.3.0
Expand Down
36 changes: 15 additions & 21 deletions test/main_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,21 @@ void main() {

// Read message constant
final message = introMessage();
expect(message, contains(yaml['version']));
expect(message, contains(yaml['version']),
reason: 'Version is not correct');
});

test('Description checker', () {
// Read yaml config file
final File file = File('pubspec.yaml');
final String content = file.readAsStringSync();
final Map yaml = loadYaml(content);

final length = yaml['description'].toString().length;
expect(length, greaterThan(60),
reason: 'Description should be greater than 60 characters');
expect(length, lessThan(180),
reason: 'Description should be less than 180 characters');
});

test('Android icon list is correct size', () {
Expand All @@ -37,18 +51,6 @@ void main() {
expect(ios.createImageList('blah').length, 25);
});

test('pubspec.yaml file exists', () async {
const String path = 'test/config/icons_launcher_test_pubspec.yaml';
final Map<String, dynamic> config = main_dart.loadConfigFile(path, null);
expect(config.length, isNotNull);
});

test('Incorrect pubspec.yaml path throws correct error message', () async {
const String incorrectPath = 'test/config/test_pubspec.yam';
expect(() => main_dart.loadConfigFile(incorrectPath, null),
throwsA(const TypeMatcher<FileSystemException>()));
});

test('image_path is in config', () {
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/ic_logo_border.png',
Expand Down Expand Up @@ -125,12 +127,4 @@ void main() {
};
expect(main_dart.isNeedingNewIOSIcon(flutterIconsConfig), false);
});

test('No new iOS icon needed - no iOS config', () {
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/ic_logo_border.png',
'android': true
};
expect(main_dart.isNeedingNewIOSIcon(flutterIconsConfig), false);
});
}

0 comments on commit e4c6809

Please sign in to comment.