Fixes a warning introduced in https://github.com/flutter/flutter/pull/136780 and adds the other related function.