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