This is a reland of https://github.com/flutter/flutter/pull/140806 which had an issue with package versions.