|
1 |
| -String androidResFolder(String? flavor) => |
2 |
| - "android/app/src/${flavor ?? 'main'}/res/"; |
3 |
| -String androidColorsFile(String? flavor) => |
4 |
| - "android/app/src/${flavor ?? 'main'}/res/values/colors.xml"; |
| 1 | +import 'package:path/path.dart' as path; |
| 2 | + |
| 3 | +String androidResFolder(String? flavor) => "android/app/src/${flavor ?? 'main'}/res/"; |
| 4 | +String androidColorsFile(String? flavor) => "android/app/src/${flavor ?? 'main'}/res/values/colors.xml"; |
5 | 5 | const String androidManifestFile = 'android/app/src/main/AndroidManifest.xml';
|
6 | 6 | const String androidGradleFile = 'android/app/build.gradle';
|
7 | 7 | const String androidLocalPropertiesFile = 'android/local.properties';
|
8 | 8 | const String androidFileName = 'ic_launcher.png';
|
9 | 9 | const String androidAdaptiveForegroundFileName = 'ic_launcher_foreground.png';
|
10 | 10 | const String androidAdaptiveBackgroundFileName = 'ic_launcher_background.png';
|
11 |
| -String androidAdaptiveXmlFolder(String? flavor) => |
12 |
| - androidResFolder(flavor) + 'mipmap-anydpi-v26/'; |
| 11 | +String androidAdaptiveXmlFolder(String? flavor) => androidResFolder(flavor) + 'mipmap-anydpi-v26/'; |
13 | 12 | const String androidDefaultIconName = 'ic_launcher';
|
14 | 13 |
|
15 |
| -const String iosDefaultIconFolder = |
16 |
| - 'ios/Runner/Assets.xcassets/AppIcon.appiconset/'; |
| 14 | +const String iosDefaultIconFolder = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/'; |
17 | 15 | const String iosAssetFolder = 'ios/Runner/Assets.xcassets/';
|
18 | 16 | const String iosConfigFile = 'ios/Runner.xcodeproj/project.pbxproj';
|
19 | 17 | const String iosDefaultIconName = 'Icon-App';
|
20 | 18 |
|
| 19 | +// web |
| 20 | +const int kFaviconSize = 16; |
| 21 | +String webDirPath = path.join('web'); |
| 22 | +String webIconsDirPath = path.join(webDirPath, 'icons'); |
| 23 | +String webManifestFilePath = path.join(webDirPath, 'manifest.json'); |
| 24 | +// todo: support for other images formats |
| 25 | +String webFaviconFilePath = path.join(webDirPath, 'favicon.png'); |
| 26 | +String webIndexFilePath = path.join(webDirPath, 'index.html'); |
| 27 | +String pubspecFilePath = path.join('pubspec.yaml'); |
| 28 | + |
21 | 29 | const String errorMissingImagePath =
|
22 | 30 | 'Missing "image_path" or "image_path_android" + "image_path_ios" within configuration';
|
23 |
| -const String errorMissingPlatform = |
24 |
| - 'No platform specified within config to generate icons for.'; |
25 |
| -const String errorMissingRegularAndroid = |
26 |
| - 'Adaptive icon config found but no regular Android config. ' |
| 31 | +const String errorMissingPlatform = 'No platform specified within config to generate icons for.'; |
| 32 | +const String errorMissingRegularAndroid = 'Adaptive icon config found but no regular Android config. ' |
27 | 33 | 'Below API 26 the regular Android config is required';
|
28 |
| -const String errorMissingMinSdk = |
29 |
| - 'Cannot not find minSdk from android/app/build.gradle or android/local.properties' |
| 34 | +const String errorMissingMinSdk = 'Cannot not find minSdk from android/app/build.gradle or android/local.properties' |
30 | 35 | 'Specify minSdk in either android/app/build.gradle or android/local.properties';
|
31 |
| -const String errorIncorrectIconName = |
32 |
| - 'The icon name must contain only lowercase a-z, 0-9, or underscore: ' |
| 36 | +const String errorIncorrectIconName = 'The icon name must contain only lowercase a-z, 0-9, or underscore: ' |
33 | 37 | 'E.g. "ic_my_new_icon"';
|
34 | 38 |
|
35 | 39 | String introMessage(String currentVersion) => '''
|
|
0 commit comments