flutterdartcodemagicpubspec

Is the Flutter SDK Version defined anywhere in code?


I see that in the pubspec the Dart SDK version is specified/constrained but is there anywhere to specify the Flutter SDK version? Maybe I'm missing something obvious but coming from other tech stacks like Java/Gradle I believe normally SDK versions are explicit?

What got me thinking about this is that I'm using Codemagic and have my Flutter version at "default" but I can't even tell what that is from their docs or their build logs.

enter image description here


Solution

  • Look like it's easy to limit it like this - I just missed it in the doc.

    If I say I need ^4.0.0 then I get a meaningful error:

    environment:
      sdk: '>=2.18.6 <3.0.0'
      flutter: ^4.0.0
    

    Running "flutter pub get" in XXXX... Resolving dependencies... The current Flutter SDK version is 3.7.1.

    Because XXXX requires Flutter SDK version >=4.0.0, version solving failed. pub get failed command: "/opt/homebrew/Caskroom/flutter/3.3.10/flutter/bin/cache/dart-sdk/bin/dart __deprecated_pub --directory . get --example" pub env: { "FLUTTER_ROOT": "/opt/homebrew/Caskroom/flutter/3.3.10/flutter",
    "PUB_ENVIRONMENT": "flutter_cli:get", "PUB_CACHE": "/Users/DENNCH3/.pub-cache", } exit code: 1