withNitroSdkFloor function

String withNitroSdkFloor(
  1. String pubspec
)

Replaces the environment: sdk: constraint flutter create stamps (the SDK that happened to run it) with kNitroDartSdkFloor. The stamped one shuts out older Flutter releases and DartNative, which ships an earlier Dart, though nothing in a Nitro plugin needs the newer SDK.

Implementation

String withNitroSdkFloor(String pubspec) => pubspec.replaceFirst(RegExp(r'^  sdk: \S+$', multiLine: true), '  sdk: $kNitroDartSdkFloor');