1

Context

I am currently working on a project that requires the use of Dartpad.dev, and I'm looking to modify the Flutter/Dart SDK version for my specific needs.

In a typical environment, altering the SDK version can be achieved by updating the pubspec.yaml file like so:

environment:
  sdk: ">=2.11.0 <3.0.0"

However, I'm uncertain how this can be accomplished within Dartpad.dev, given its unique environment.

What I tried:

In an attempt to change the SDK version, I added the following line at the beginning of my dartpad file:

// @dart=2.9

Unfortunately, this resulted in an error message stating:

The language version must be >=2.12.0.

This leads me to wonder if it's even possible to downgrade the SDK version in this environment.

The question

  • Is there a way to change the Flutter/Dart SDK version on Dartpad.dev? If so, what is the process?

Side note

I recall that in the pre-null-safety era, when the feature was still experimental, it was possible to alter a query parameter in the Dartpad link to allow for null safety.

However, my requirement goes beyond this, I am interested in changing the actual Dart SDK version, not just enabling or disabling null safety. Is this level of customization possible on Dartpad.dev?

Related
MendelG
  • 14,885
  • 4
  • 25
  • 52
  • 1
    You can downgrade the language using the comments, just not lower than `2.12.0`. The dartpad website no longer supports those versions of dart. See https://github.com/dart-lang/dart-pad/issues/2115 – mmcdon20 Aug 02 '23 at 19:56
  • Does your project require using the public, official version of Dartpad? If not, then you probably could just host your own, older version: https://github.com/dart-lang/dart-pad – jamesdlin Aug 03 '23 at 05:38

1 Answers1

-1

This might work, you can change the channel and run your code.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 07 '23 at 05:10