skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    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


  2. You can get that from your terminal just run flutter --version, this will print out your current flutter SDK and dart SDK versions.

    flutter --version
    

    the result should be similar to this

    Flutter 3.7.0 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision b06b8b2710 (2 weeks ago) • 2023-01-23 16:55:55 -0800
    Engine • revision b24591ed32
    Tools • Dart 2.19.0 • DevTools 2.20.1
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search