From f461f1c9c8377b2ce90e4dbdfc7b93daeb8cc62d Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Thu, 7 Jan 2021 18:09:04 -0600 Subject: [PATCH] Remove deprecated WidgetsBinding.[deferFirstFrameReport, allowFirstFrameReport] (#72893) --- packages/flutter/lib/fix_data.yaml | 22 ++++++++++++++ packages/flutter/lib/src/widgets/binding.dart | 30 ------------------- packages/flutter/test_fixes/cupertino.dart | 5 ++++ .../flutter/test_fixes/cupertino.dart.expect | 5 ++++ packages/flutter/test_fixes/material.dart | 5 ++++ .../flutter/test_fixes/material.dart.expect | 5 ++++ packages/flutter/test_fixes/widgets.dart | 5 ++++ .../flutter/test_fixes/widgets.dart.expect | 5 ++++ 8 files changed, 52 insertions(+), 30 deletions(-) diff --git a/packages/flutter/lib/fix_data.yaml b/packages/flutter/lib/fix_data.yaml index 867a2b8ea79..52d64a4a7ee 100644 --- a/packages/flutter/lib/fix_data.yaml +++ b/packages/flutter/lib/fix_data.yaml @@ -11,6 +11,28 @@ version: 1 transforms: + # Changes made in https://github.com/flutter/flutter/pull/45941 + - title: 'Rename to deferFirstFrame' + date: 2020-12-23 + element: + uris: [ 'material.dart', 'cupertino.dart', 'widgets.dart' ] + method: 'deferFirstFrameReport' + inClass: 'WidgetsBinding' + changes: + - kind: 'rename' + newName: 'deferFirstFrame' + + # Changes made in https://github.com/flutter/flutter/pull/45941 + - title: 'Rename to allowFirstFrame' + date: 2020-12-23 + element: + uris: [ 'material.dart', 'cupertino.dart', 'widgets.dart' ] + method: 'allowFirstFrameReport' + inClass: 'WidgetsBinding' + changes: + - kind: 'rename' + newName: 'allowFirstFrame' + # Changes made in https://github.com/flutter/flutter/pull/44189 - title: 'Rename to dependOnInheritedElement' date: 2020-12-23 diff --git a/packages/flutter/lib/src/widgets/binding.dart b/packages/flutter/lib/src/widgets/binding.dart index 6723cb663eb..2ed61f99b35 100644 --- a/packages/flutter/lib/src/widgets/binding.dart +++ b/packages/flutter/lib/src/widgets/binding.dart @@ -731,36 +731,6 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB /// * [firstFrameRasterized], whether the first frame has finished rendering. bool get debugDidSendFirstFrameEvent => !_needToReportFirstFrame; - /// Tell the framework not to report the frame it is building as a "useful" - /// first frame until there is a corresponding call to [allowFirstFrameReport]. - /// - /// Deprecated. Use [deferFirstFrame]/[allowFirstFrame] to delay rendering the - /// first frame. - @Deprecated( - 'Use deferFirstFrame/allowFirstFrame to delay rendering the first frame. ' - 'This feature was deprecated after v1.12.4.' - ) - void deferFirstFrameReport() { - if (!kReleaseMode) { - deferFirstFrame(); - } - } - - /// When called after [deferFirstFrameReport]: tell the framework to report - /// the frame it is building as a "useful" first frame. - /// - /// Deprecated. Use [deferFirstFrame]/[allowFirstFrame] to delay rendering the - /// first frame. - @Deprecated( - 'Use deferFirstFrame/allowFirstFrame to delay rendering the first frame. ' - 'This feature was deprecated after v1.12.4.' - ) - void allowFirstFrameReport() { - if (!kReleaseMode) { - allowFirstFrame(); - } - } - void _handleBuildScheduled() { // If we're in the process of building dirty elements, then changes // should not trigger a new frame. diff --git a/packages/flutter/test_fixes/cupertino.dart b/packages/flutter/test_fixes/cupertino.dart index 483e236465f..6bb1a8cb531 100644 --- a/packages/flutter/test_fixes/cupertino.dart +++ b/packages/flutter/test_fixes/cupertino.dart @@ -9,6 +9,11 @@ void main() { const CupertinoTextThemeData themeData = CupertinoTextThemeData(brightness: Brightness.dark); themeData.copyWith(brightness: Brightness.light); + // Changes made in https://github.com/flutter/flutter/pull/45941 + final WidgetsBinding binding = WidgetsBinding.instance!; + binding.deferFirstFrameReport(); + binding.allowFirstFrameReport(); + // Changes made in https://github.com/flutter/flutter/pull/44189 const StatefulElement statefulElement = StatefulElement(myWidget); statefulElement.inheritFromElement(ancestor); diff --git a/packages/flutter/test_fixes/cupertino.dart.expect b/packages/flutter/test_fixes/cupertino.dart.expect index fba66ab8eab..50a87a60aaa 100644 --- a/packages/flutter/test_fixes/cupertino.dart.expect +++ b/packages/flutter/test_fixes/cupertino.dart.expect @@ -9,6 +9,11 @@ void main() { const CupertinoTextThemeData themeData = CupertinoTextThemeData(); themeData.copyWith(); + // Changes made in https://github.com/flutter/flutter/pull/45941 + final WidgetsBinding binding = WidgetsBinding.instance!; + binding.deferFirstFrame(); + binding.allowFirstFrame(); + // Changes made in https://github.com/flutter/flutter/pull/44189 const StatefulElement statefulElement = StatefulElement(myWidget); statefulElement.dependOnInheritedElement(ancestor); diff --git a/packages/flutter/test_fixes/material.dart b/packages/flutter/test_fixes/material.dart index 30d0e358581..eb84fea84bc 100644 --- a/packages/flutter/test_fixes/material.dart +++ b/packages/flutter/test_fixes/material.dart @@ -8,6 +8,11 @@ void main() { // Change made in https://github.com/flutter/flutter/pull/15303 showDialog(child: Text('Fix me.')); + // Changes made in https://github.com/flutter/flutter/pull/45941 + final WidgetsBinding binding = WidgetsBinding.instance!; + binding.deferFirstFrameReport(); + binding.allowFirstFrameReport(); + // Changes made in https://github.com/flutter/flutter/pull/44189 const StatefulElement statefulElement = StatefulElement(myWidget); statefulElement.inheritFromElement(ancestor); diff --git a/packages/flutter/test_fixes/material.dart.expect b/packages/flutter/test_fixes/material.dart.expect index f62668c05d8..256fef873e8 100644 --- a/packages/flutter/test_fixes/material.dart.expect +++ b/packages/flutter/test_fixes/material.dart.expect @@ -8,6 +8,11 @@ void main() { // Change made in https://github.com/flutter/flutter/pull/15303 showDialog(builder: (context) => Text('Fix me.')); + // Changes made in https://github.com/flutter/flutter/pull/45941 + final WidgetsBinding binding = WidgetsBinding.instance!; + binding.deferFirstFrame(); + binding.allowFirstFrame(); + // Changes made in https://github.com/flutter/flutter/pull/44189 const StatefulElement statefulElement = StatefulElement(myWidget); statefulElement.dependOnInheritedElement(ancestor); diff --git a/packages/flutter/test_fixes/widgets.dart b/packages/flutter/test_fixes/widgets.dart index b8c197a417b..f89f7d54f01 100644 --- a/packages/flutter/test_fixes/widgets.dart +++ b/packages/flutter/test_fixes/widgets.dart @@ -5,6 +5,11 @@ import 'package:flutter/widgets.dart'; void main() { + // Changes made in https://github.com/flutter/flutter/pull/45941 + final WidgetsBinding binding = WidgetsBinding.instance!; + binding.deferFirstFrameReport(); + binding.allowFirstFrameReport(); + // Changes made in https://github.com/flutter/flutter/pull/44189 const StatefulElement statefulElement = StatefulElement(myWidget); statefulElement.inheritFromElement(ancestor); diff --git a/packages/flutter/test_fixes/widgets.dart.expect b/packages/flutter/test_fixes/widgets.dart.expect index 0659a8ba8d0..2b6b7b45cea 100644 --- a/packages/flutter/test_fixes/widgets.dart.expect +++ b/packages/flutter/test_fixes/widgets.dart.expect @@ -5,6 +5,11 @@ import 'package:flutter/widgets.dart'; void main() { + // Changes made in https://github.com/flutter/flutter/pull/45941 + final WidgetsBinding binding = WidgetsBinding.instance!; + binding.deferFirstFrame(); + binding.allowFirstFrame(); + // Changes made in https://github.com/flutter/flutter/pull/44189 const StatefulElement statefulElement = StatefulElement(myWidget); statefulElement.dependOnInheritedElement(ancestor);