@@ -74,8 +74,8 @@ enum FramePhase {
7474/// [SchedulerBinding.addTimingsCallback] to get this. It's preferred over using
7575/// [PlatformDispatcher.onReportTimings] directly because
7676/// [SchedulerBinding.addTimingsCallback] allows multiple callbacks. If
77- /// [SchedulerBinding] is unavailable, then see [PlatformDispatcher.onReportTimings]
78- /// for how to get this.
77+ /// [SchedulerBinding] is unavailable, then see
78+ /// [PlatformDispatcher.onReportTimings] for how to get this.
7979///
8080/// The metrics in debug mode (`flutter run` without any flags) may be very
8181/// different from those in profile and release modes due to the debug overhead.
@@ -88,7 +88,8 @@ class FrameTiming {
8888 /// [FramePhase.values] .
8989 ///
9090 /// This constructor is usually only called by the Flutter engine, or a test.
91- /// To get the [FrameTiming] of your app, see [PlatformDispatcher.onReportTimings] .
91+ /// To get the [FrameTiming] of your app, see
92+ /// [PlatformDispatcher.onReportTimings] .
9293 FrameTiming (List <int > timestamps)
9394 : assert (timestamps.length == FramePhase .values.length),
9495 _timestamps = timestamps;
@@ -101,9 +102,10 @@ class FrameTiming {
101102
102103 /// The duration to build the frame on the UI thread.
103104 ///
104- /// The build starts approximately when [PlatformDispatcher.onBeginFrame] is called. The
105- /// [Duration] in the [PlatformDispatcher.onBeginFrame] callback is exactly the
106- /// `Duration(microseconds: timestampInMicroseconds(FramePhase.buildStart))` .
105+ /// The build starts approximately when [PlatformDispatcher.onBeginFrame] is
106+ /// called. The [Duration] in the [PlatformDispatcher.onBeginFrame] callback
107+ /// is exactly the `Duration(microseconds:
108+ /// timestampInMicroseconds(FramePhase.buildStart))`.
107109 ///
108110 /// The build finishes when [FlutterView.render] is called.
109111 ///
@@ -674,9 +676,8 @@ abstract class FlutterView {
674676 ///
675677 /// When this property changes, [onMetricsChanged] is called.
676678 ///
677- /// The relationship between this [viewInsets] ,
678- /// [viewPadding] , and [padding] are described in
679- /// more detail in the documentation for [FlutterView] .
679+ /// The relationship between this [viewInsets] , [viewPadding] , and [padding]
680+ /// are described in more detail in the documentation for [FlutterView] .
680681 ///
681682 /// See also:
682683 ///
@@ -693,16 +694,14 @@ abstract class FlutterView {
693694 /// the display (e.g. overscan regions on television screens or phone sensor
694695 /// housings).
695696 ///
696- /// Unlike [padding] , this value does not change relative to
697- /// [viewInsets] . For example, on an iPhone X, it will not
698- /// change in response to the soft keyboard being visible or hidden, whereas
699- /// [padding] will.
697+ /// Unlike [padding] , this value does not change relative to [viewInsets] . For
698+ /// example, on an iPhone X, it will not change in response to the soft
699+ /// keyboard being visible or hidden, whereas [padding] will.
700700 ///
701701 /// When this property changes, [onMetricsChanged] is called.
702702 ///
703- /// The relationship between this [viewInsets] ,
704- /// [viewPadding] , and [padding] are described in
705- /// more detail in the documentation for [FlutterView] .
703+ /// The relationship between this [viewInsets] , [viewPadding] , and [padding]
704+ /// are described in more detail in the documentation for [FlutterView] .
706705 ///
707706 /// See also:
708707 ///
@@ -756,35 +755,6 @@ abstract class FlutterView {
756755 /// * [Scaffold] , which automatically applies the padding in material design
757756 /// applications.
758757 WindowPadding get padding => viewConfiguration.padding;
759-
760- /// Updates the view's rendering on the GPU with the newly provided
761- /// [Scene] .
762- ///
763- /// This function must be called within the scope of the
764- /// [PlatformDispatcher.onBeginFrame] or [PlatformDispatcher.onDrawFrame]
765- /// callbacks being invoked. If this function is called a second time during a
766- /// single [PlatformDispatcher.onBeginFrame] /[PlatformDispatcher.onDrawFrame]
767- /// callback sequence or called outside the scope of those callbacks, the call
768- /// will be ignored.
769- ///
770- /// To record graphical operations, first create a [PictureRecorder] , then
771- /// construct a [Canvas] , passing that [PictureRecorder] to its constructor.
772- /// After issuing all the graphical operations, call the
773- /// [PictureRecorder.endRecording] function on the [PictureRecorder] to obtain
774- /// the final [Picture] that represents the issued graphical operations.
775- ///
776- /// Next, create a [SceneBuilder] , and add the [Picture] to it using
777- /// [SceneBuilder.addPicture] . With the [SceneBuilder.build] method you can
778- /// then obtain a [Scene] object, which you can display to the user via this
779- /// [render] function.
780- ///
781- /// See also:
782- ///
783- /// * [SchedulerBinding] , the Flutter framework class which manages the
784- /// scheduling of frames.
785- /// * [RendererBinding] , the Flutter framework class which manages layout and
786- /// painting.
787- void render (Scene scene) => platformDispatcher.render (scene, this );
788758}
789759
790760/// A top-level platform window displaying a Flutter layer tree drawn from a
@@ -896,24 +866,8 @@ class SingletonFlutterWindow extends FlutterWindow {
896866 /// This method returns synchronously and is a direct call to
897867 /// platform specific APIs without invoking method channels.
898868 Locale ? computePlatformResolvedLocale (List <Locale > supportedLocales) {
899- final List <String ?> supportedLocalesData = < String ? > [];
900- for (Locale locale in supportedLocales) {
901- supportedLocalesData.add (locale.languageCode);
902- supportedLocalesData.add (locale.countryCode);
903- supportedLocalesData.add (locale.scriptCode);
904- }
905-
906- final List <String > result = _computePlatformResolvedLocale (supportedLocalesData);
907-
908- if (result.isNotEmpty) {
909- return Locale .fromSubtags (
910- languageCode: result[0 ],
911- countryCode: result[1 ] == '' ? null : result[1 ],
912- scriptCode: result[2 ] == '' ? null : result[2 ]);
913- }
914- return null ;
869+ platformDispatcher.computePlatformResolvedLocale (supportedLocales);
915870 }
916- List <String > _computePlatformResolvedLocale (List <String ?> supportedLocalesData) native 'Window_computePlatformResolvedLocale' ;
917871
918872 /// A callback that is invoked whenever [locale] changes value.
919873 ///
@@ -1149,6 +1103,34 @@ class SingletonFlutterWindow extends FlutterWindow {
11491103 /// scheduling of frames.
11501104 void scheduleFrame () => platformDispatcher.scheduleFrame ();
11511105
1106+ /// Updates the view's rendering on the GPU with the newly provided [Scene] .
1107+ ///
1108+ /// This function must be called within the scope of the
1109+ /// [PlatformDispatcher.onBeginFrame] or [PlatformDispatcher.onDrawFrame]
1110+ /// callbacks being invoked. If this function is called a second time during a
1111+ /// single [PlatformDispatcher.onBeginFrame] /[PlatformDispatcher.onDrawFrame]
1112+ /// callback sequence or called outside the scope of those callbacks, the call
1113+ /// will be ignored.
1114+ ///
1115+ /// To record graphical operations, first create a [PictureRecorder] , then
1116+ /// construct a [Canvas] , passing that [PictureRecorder] to its constructor.
1117+ /// After issuing all the graphical operations, call the
1118+ /// [PictureRecorder.endRecording] function on the [PictureRecorder] to obtain
1119+ /// the final [Picture] that represents the issued graphical operations.
1120+ ///
1121+ /// Next, create a [SceneBuilder] , and add the [Picture] to it using
1122+ /// [SceneBuilder.addPicture] . With the [SceneBuilder.build] method you can
1123+ /// then obtain a [Scene] object, which you can display to the user via this
1124+ /// [render] function.
1125+ ///
1126+ /// See also:
1127+ ///
1128+ /// * [SchedulerBinding] , the Flutter framework class which manages the
1129+ /// scheduling of frames.
1130+ /// * [RendererBinding] , the Flutter framework class which manages layout and
1131+ /// painting.
1132+ void render (Scene scene) => platformDispatcher.render (scene, this );
1133+
11521134 /// Whether the user has requested that [updateSemantics] be called when
11531135 /// the semantic contents of window changes.
11541136 ///
0 commit comments