This relands flutter/flutter#31701 with missing const added This reverts commit 549b412656.
549b412656