minSdk function

int minSdk()

Retrieves the minSdk value from the

  • flutter.gradle: '$FLUTTER_ROOT/packages/flutter_tools/gradle/flutter.gradle'
  • build.gradle: 'android/app/build.gradle'
  • local.properties: 'android/local.properties'

If found none returns constants.androidDefaultAndroidMinSDK

Implementation

int minSdk() {
  final androidGradleFile = File(constants.androidGradleFile);
  final androidLocalPropertiesFile = File(constants.androidLocalPropertiesFile);

  // looks for minSdk value in build.gradle, flutter.gradle & local.properties.
  // this should always be order
  // first check build.gradle, then local.properties, then flutter.gradle
  return _getMinSdkFromFile(androidGradleFile) ??
      _getMinSdkFromFile(androidLocalPropertiesFile) ??
      _getMinSdkFlutterGradle(androidLocalPropertiesFile) ??
      constants.androidDefaultAndroidMinSDK;
}