Skip to content

Commit

Permalink
feat(web): constants for web platform
Browse files Browse the repository at this point in the history
  • Loading branch information
RatakondalaArun committed Jul 8, 2022
1 parent 9087923 commit 3a5cbff
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions lib/constants.dart
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
String androidResFolder(String? flavor) =>
"android/app/src/${flavor ?? 'main'}/res/";
String androidColorsFile(String? flavor) =>
"android/app/src/${flavor ?? 'main'}/res/values/colors.xml";
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/';
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 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. '
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'
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: '
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) => '''
Expand Down

0 comments on commit 3a5cbff

Please sign in to comment.