diff --git a/starport_template/ios/fastlane/Fastfile b/starport_template/ios/fastlane/Fastfile index e61c591c..d69849ac 100644 --- a/starport_template/ios/fastlane/Fastfile +++ b/starport_template/ios/fastlane/Fastfile @@ -43,7 +43,7 @@ platform :ios do ) increment_build_number( - build_number: ENV["$GITHUB_RUN_NUMBER"] + build_number: ENV["GITHUB_RUN_NUMBER"] ) build_app( diff --git a/starport_template/lib/utils/base_env.dart b/starport_template/lib/utils/base_env.dart index 77b4ae0d..8138ffb8 100644 --- a/starport_template/lib/utils/base_env.dart +++ b/starport_template/lib/utils/base_env.dart @@ -27,16 +27,30 @@ class BaseEnv { final String baseApiUrl; } +// DO NOT USE String.fromEnvironment without 'const'!!! +// https://github.com/flutter/flutter/issues/55870#issuecomment-620776138 String get envLcdPort => const String.fromEnvironment('LCD_PORT', defaultValue: '1317'); +// DO NOT USE String.fromEnvironment without 'const'!!! +// https://github.com/flutter/flutter/issues/55870#issuecomment-620776138 String get envGrpcPort => const String.fromEnvironment('GRPC_PORT', defaultValue: '9090'); -String get envLcdUrl => String.fromEnvironment( - 'LCD_URL', - defaultValue: Platform.isAndroid ? 'http://10.0.2.2' : 'http://localhost', - ); +String get envLcdUrl { + // DO NOT USE String.fromEnvironment without 'const'!!! + // https://github.com/flutter/flutter/issues/55870#issuecomment-620776138 + const result = String.fromEnvironment('LCD_URL'); + if (result.isEmpty) { + return Platform.isAndroid ? 'http://10.0.2.2' : 'http://localhost'; + } + return result; +} -String get envGrpcUrl => String.fromEnvironment( - 'GRPC_URL', - defaultValue: Platform.isAndroid ? 'http://10.0.2.2' : 'http://localhost', - ); +String get envGrpcUrl { + // DO NOT USE String.fromEnvironment without 'const'!!! + // https://github.com/flutter/flutter/issues/55870#issuecomment-620776138 + const result = String.fromEnvironment('GRPC_URL'); + if (result.isEmpty) { + return Platform.isAndroid ? 'http://10.0.2.2' : 'http://localhost'; + } + return result; +}