Flutter: Are we forced to use null safety on master branch?

Viewed 1052

I upgraded a project to latest master and it's lit up like a xmas tree with 144 errors because null-safety seems to be enabled by default.

I'm working on a desktop app, and need Master, but am not ready to migrate to null safety yet. Is it possible to turn this off?

2 Answers

You can set the language version in the entrypoint, which might be lib/main.dart as a comment on the first line

// @dart=2.11
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

Null safety starts in 2.12, so using the version below that should avoid it.

Related