@@ -107,14 +107,14 @@ class RegularWindow extends StatefulWidget {
107107
108108class _RegularWindowState extends State <RegularWindow > {
109109 _WindowListener ? _listener;
110- Future <_RegularWindowMetadata >? _future;
110+ Future <RegularWindowMetadata >? _future;
111111 _WindowingAppState ? _app;
112112
113113 @override
114114 void initState () {
115115 super .initState ();
116116 _future = createRegular (size: widget._preferredSize);
117- _future! .then ((_RegularWindowMetadata metadata) async {
117+ _future! .then ((RegularWindowMetadata metadata) async {
118118 if (widget.controller != null ) {
119119 widget.controller! .view = metadata.view;
120120 widget.controller! .parentViewId = metadata.parentViewId;
@@ -160,11 +160,11 @@ class _RegularWindowState extends State<RegularWindow> {
160160
161161 @override
162162 Widget build (BuildContext context) {
163- return FutureBuilder <_RegularWindowMetadata >(
163+ return FutureBuilder <RegularWindowMetadata >(
164164 key: widget.key,
165165 future: _future,
166166 builder: (BuildContext context,
167- AsyncSnapshot <_RegularWindowMetadata > metadata) {
167+ AsyncSnapshot <RegularWindowMetadata > metadata) {
168168 if (! metadata.hasData) {
169169 return const ViewCollection (views: < Widget > []);
170170 }
@@ -196,17 +196,27 @@ class WindowContext extends InheritedWidget {
196196 }
197197}
198198
199- class _WindowMetadata {
200- _WindowMetadata ({required this .view, required this .size, this .parentViewId});
199+ /// Base class for window creation metadata.
200+ abstract class WindowMetadata {
201+ /// Creates generic window metadata.
202+ WindowMetadata ({required this .view, required this .size, this .parentViewId});
201203
204+ /// The view associated with the window.
202205 final FlutterView view;
206+
207+ /// The size of the created window.
203208 final Size size;
209+
210+ /// The parent view of the window, if any.
204211 final int ? parentViewId;
205212}
206213
207- class _RegularWindowMetadata extends _WindowMetadata {
208- _RegularWindowMetadata (
209- {required super .view, required super .size, super .parentViewId});
214+ /// Data object returned by [createRegular] .
215+ class RegularWindowMetadata extends WindowMetadata {
216+ /// Creates metadata for a regular window. This should only be initialized
217+ /// by [createRegular] .
218+ RegularWindowMetadata (
219+ {required super .view, required super .size});
210220}
211221
212222class _WindowCreationResult {
@@ -227,14 +237,14 @@ class _WindowCreationResult {
227237/// widget instead of this method.
228238///
229239/// [size] the size of the new [Window] in pixels
230- Future <_RegularWindowMetadata > createRegular ({required Size size}) async {
240+ Future <RegularWindowMetadata > createRegular ({required Size size}) async {
231241 final _WindowCreationResult metadata =
232242 await _createWindow (viewBuilder: (MethodChannel channel) async {
233243 return await channel.invokeMethod ('createWindow' , < String , dynamic > {
234244 'size' : < int > [size.width.toInt (), size.height.toInt ()],
235245 }) as Map <Object ?, Object ?>;
236246 });
237- return _RegularWindowMetadata (view: metadata.flView, size: metadata.size);
247+ return RegularWindowMetadata (view: metadata.flView, size: metadata.size);
238248}
239249
240250Future <_WindowCreationResult > _createWindow (
0 commit comments