|
2 | 2 |
|
3 | 3 | import 'dart:io';
|
4 | 4 |
|
| 5 | +import 'package:flutter_launcher_icons/config/config.dart'; |
5 | 6 | import 'package:flutter_launcher_icons/constants.dart';
|
6 | 7 | import 'package:flutter_launcher_icons/constants.dart' as constants;
|
7 | 8 | import 'package:flutter_launcher_icons/custom_exceptions.dart';
|
8 |
| -import 'package:flutter_launcher_icons/config/config.dart'; |
9 | 9 | import 'package:flutter_launcher_icons/utils.dart' as utils;
|
10 | 10 | import 'package:flutter_launcher_icons/xml_templates.dart' as xml_template;
|
11 | 11 | import 'package:image/image.dart';
|
@@ -95,10 +95,8 @@ void createAdaptiveIcons(
|
95 | 95 | utils.printStatus('Creating adaptive icons Android');
|
96 | 96 |
|
97 | 97 | // Retrieve the necessary Flutter Launcher Icons configuration from the pubspec.yaml file
|
98 |
| - final String? backgroundConfig = |
99 |
| - config.adaptiveIconBackground; |
100 |
| - final String? foregroundImagePath = |
101 |
| - config.adaptiveIconForeground; |
| 98 | + final String? backgroundConfig = config.adaptiveIconBackground; |
| 99 | + final String? foregroundImagePath = config.adaptiveIconForeground; |
102 | 100 | if (backgroundConfig == null || foregroundImagePath == null) {
|
103 | 101 | throw const InvalidConfigException(errorMissingImagePath);
|
104 | 102 | }
|
@@ -161,9 +159,7 @@ void createAdaptiveIconMipmapXmlFile(
|
161 | 159 | ) {
|
162 | 160 | if (config.isCustomAndroidFile) {
|
163 | 161 | File(
|
164 |
| - constants.androidAdaptiveXmlFolder(flavor) + |
165 |
| - config.android + |
166 |
| - '.xml', |
| 162 | + constants.androidAdaptiveXmlFolder(flavor) + config.android + '.xml', |
167 | 163 | ).create(recursive: true).then((File adaptiveIcon) {
|
168 | 164 | adaptiveIcon.writeAsString(xml_template.icLauncherXml);
|
169 | 165 | });
|
@@ -205,9 +201,7 @@ void _createAdaptiveBackgrounds(
|
205 | 201 | // FILE LOCATED HERE: res/mipmap-anydpi/{icon-name-from-yaml-config}.xml
|
206 | 202 | if (config.isCustomAndroidFile) {
|
207 | 203 | File(
|
208 |
| - constants.androidAdaptiveXmlFolder(flavor) + |
209 |
| - config.android + |
210 |
| - '.xml', |
| 204 | + constants.androidAdaptiveXmlFolder(flavor) + config.android + '.xml', |
211 | 205 | ).create(recursive: true).then((File adaptiveIcon) {
|
212 | 206 | adaptiveIcon.writeAsString(xml_template.icLauncherDrawableBackgroundXml);
|
213 | 207 | });
|
|
0 commit comments