<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chencwf on Medium]]></title>
        <description><![CDATA[Stories by Chencwf on Medium]]></description>
        <link>https://medium.com/@chencwf?source=rss-9618a351e251------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kXdumLNdJXpxtRGS</url>
            <title>Stories by Chencwf on Medium</title>
            <link>https://medium.com/@chencwf?source=rss-9618a351e251------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:12:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chencwf/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[About ‘Object Patterns’ in Dart]]></title>
            <link>https://medium.com/@chencwf/about-object-patterns-in-dart-735f8ca0019a?source=rss-9618a351e251------2</link>
            <guid isPermaLink="false">https://medium.com/p/735f8ca0019a</guid>
            <dc:creator><![CDATA[Chencwf]]></dc:creator>
            <pubDate>Sun, 17 Nov 2024 04:48:17 GMT</pubDate>
            <atom:updated>2024-11-17T04:48:17.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0UZuC944tmv3FuQ1R1E7g.jpeg" /></figure><p>in latest dart, we can use object patterns as following:</p><pre>String formatDate(DateTime dateTime) {<br> final today = DateTime.now();<br> final difference = dateTime.difference(today);<br>return switch (difference) {<br> Duration(inHours: 0) =&gt; &#39;1小时内&#39;,<br> Duration(inDays: 0) =&gt; &#39;today&#39;,<br> Duration(inDays: 1) =&gt; &#39;tomorrow&#39;,<br> Duration() =&gt; &#39;other&#39;, <br> };<br>}</pre><p>I placed breakpoints in the constructor body of Duration, as the official documents said, the constructor body is not executed.</p><p>more examples:</p><ol><li>failure: positional_field_in_object_pattern</li></ol><pre>void f(Object o) {<br> if (o case String(1)) {}<br>}</pre><p>2.success:</p><pre>void f(Object o) {<br> if (o case String(length: 1)) {}<br>}</pre><p>Conclusion:</p><p><strong>Dart only accesses the properties in the constructor in ‘object patterns’ to handle matching, not executing the body of constructor.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=735f8ca0019a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Completer: An Invaluable Class in Dart]]></title>
            <link>https://medium.com/@chencwf/completer-an-invaluable-class-in-dart-f5676434da71?source=rss-9618a351e251------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5676434da71</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[asynchronous]]></category>
            <dc:creator><![CDATA[Chencwf]]></dc:creator>
            <pubDate>Sun, 28 Apr 2024 06:21:53 GMT</pubDate>
            <atom:updated>2024-04-28T06:23:50.073Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6rc83BjU7GUAIRT9rA-FJA.png" /></figure><p>The Completer class is exceptionally useful in scenarios where you need to transform callback-based code or other asynchronous operations that do not use Future into ones that do.</p><p>Consider this example: you have a class named Service that exposes a public method called startService. This method initiates a service procedure. However, when the procedure is initiated, the caller cannot immediately receive a result. Instead, they must wait until someone notifies the Service that the procedure is complete and provides the result via a callback. So, how can you implement this Service class to allow the caller to use it with the familiar async/await style? The Completer can facilitate this. Here is the pseudocode to illustrate:</p><pre>import &#39;dart:async&#39;;<br><br>class Service {<br>  Completer&lt;String&gt; _completer;<br><br>  Future&lt;String&gt; startService() {<br>    _completer = Completer&lt;String&gt;();<br>    // Simulate starting the service and waiting for a callback<br>    _simulateAsyncOperation();<br>    return _completer.future;<br>  }<br><br>  void _simulateAsyncOperation() {<br>    // This function simulates asynchronous operation and callback<br>    Future.delayed(Duration(seconds: 3), () {<br>      _completer.complete(&#39;Service Completed Successfully&#39;);<br>      // If there&#39;s an error, you might use:<br>      // _completer.completeError(Exception(&#39;Failed to complete the service.&#39;));<br>    });<br>  }<br>}<br><br>void main() async {<br>  final service = Service();<br>  try {<br>    String result = await service.startService();<br>    print(result);<br>  } catch (e) {<br>    print(&#39;Error: $e&#39;);<br>  }<br>}</pre><p>In this example, the Service class uses a Completer to handle asynchronous operations effectively. When startService is called, it returns a Future that will eventually complete when the operation concludes. This pattern allows the caller to use asynchronous functions seamlessly with async/await, enhancing code readability and maintainability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5676434da71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling Data Overlap in Paginated Lists with Flutter’s infinite_scroll_pagination Package]]></title>
            <link>https://medium.com/@chencwf/handling-data-overlap-in-paginated-lists-with-flutters-infinite-scroll-pagination-package-ff75aa830c1f?source=rss-9618a351e251------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff75aa830c1f</guid>
            <dc:creator><![CDATA[Chencwf]]></dc:creator>
            <pubDate>Mon, 22 Apr 2024 13:42:18 GMT</pubDate>
            <atom:updated>2024-04-22T13:42:47.680Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R7AT3E88qY3l04J_bBXZqw.png" /></figure><p>In Flutter, the `infinite_scroll_pagination` package offers a streamlined and effective way to implement paginated lists. Here’s a general outline of how it works:</p><ul><li>1. Choose a Meaningful Page Key: Typically, this key is something like the page index, which helps keep track of the pagination progress.</li><li>2. Set Up the `PagingController`: Initialize a `PagingController` object, and use its `addPageRequestListener` to dictate how data for each page is loaded based on the page key.</li><li>3. Configure the Frontend: In the frontend, the concept of “pages” is abstracted away. Instead, you configure a `PagedListView` widget with an `itemBuilder` that constructs each cell in the list from the item’s data.</li></ul><p>This approach is not only simple but also elegant. However, I recently encountered some challenges with it.</p><h3>The Challenge</h3><p>In specific scenarios, such as when loading a sequence of event objects from a database to be grouped by days, data from a new page might not simply append to the existing list. For instance, the first item of a newly loaded page might need to merge with the last item of the previous page.</p><h3>Solution</h3><p>After delving into the package’s source code, I discovered an effective method to handle this overlap issue:</p><h4>Modified Step 2:</h4><p>When new page data is loaded from the backend, check if an overlap occurs. If so, merge the new data with the existing items in `_pagingController.itemList` to form an integrated list. Then, update the `PagingController` with:</p><pre><br>_pagingController.value = PagingState(<br> itemList: integratedList,<br> error: null,<br> nextPageKey: nextKey,<br>);<br></pre><p>This solution leverages the internal mechanics of `PagingController`, which typically appends new data to its list and notifies listeners of this update. By manually setting the `PagingState`, you can effectively manage the data integration for cases where direct appending isn’t suitable.</p><p>This approach ensures that the data remains coherent and accurately represents grouped sequences, such as events sorted by date, without disrupting the user experience with pagination artifacts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff75aa830c1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to edit and preview markdown files simultaneously in Android Studio]]></title>
            <link>https://medium.com/@chencwf/how-to-edit-and-preview-markdown-files-simultaneously-in-android-studio-d2a8f2514a41?source=rss-9618a351e251------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2a8f2514a41</guid>
            <dc:creator><![CDATA[Chencwf]]></dc:creator>
            <pubDate>Tue, 26 Mar 2024 06:52:22 GMT</pubDate>
            <atom:updated>2024-03-26T06:52:22.133Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dHfrJH6z6X3eJp7S" /></figure><p>As a programmer, the need to edit markdown files frequently arises. Fortunately, JetBrains’ suite of IDEs, including Android Studio, offers a convenient way to do this. Below are the steps to edit markdown files in Android Studio on macOS.</p><ul><li>1. click [Help]-&gt;Find Action… menu(or tap the shift key twice), input “Registry…”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6vyGZbTJMmhDtFR0wCc0bA.png" /></figure><ul><li>2. search and select “ide.brwoser.jcef.sandbox.enable”, DISABLE it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m-lWV33em-tzt7PC4HxIiA.png" /></figure><ul><li>3. in the same Actions dialog, input “Choose Boot Java Runtime IDE..”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F3ZcH6aZ0owemS3qmfb4Aw.png" /></figure><ul><li>4. select a latest JetBrains Runtime JBR with JCEF, then restart the IDE when prompted.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tzcx1fiVxxXteYWOc_aVTg.png" /></figure><ul><li>5. Done. you can edit and preview md files in the same time now.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-o5R3Bshc5_VVAjFpkwt1g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2a8f2514a41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Little Experience with Using Provider in Flutter]]></title>
            <link>https://medium.com/@chencwf/a-little-experience-with-using-provider-in-flutter-86ec6d1fca8d?source=rss-9618a351e251------2</link>
            <guid isPermaLink="false">https://medium.com/p/86ec6d1fca8d</guid>
            <category><![CDATA[provider]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Chencwf]]></dc:creator>
            <pubDate>Thu, 21 Mar 2024 09:07:27 GMT</pubDate>
            <atom:updated>2024-03-21T12:31:38.353Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g6X3m1tlqqtB1yMLnoMwbw.jpeg" /></figure><p>In app development, we often write a large Logic object (or Controller object) for a logically related function to act as a Provider object. These objects are generally located at the top of the Widget tree. Because the Logic object is quite large and has many logic methods exposed to the View, as well as many Value objects exposed to the View, such composited providers are not necessarily suitable to become ChangeNotifiers themselves. Having all descendants consume various Value object changes can lead to many unnecessary rebuilds.</p><p>One solution to this situation is to use Selector, which allows the descendants’ rebuilds to depend only on the Value object they are interested in. However, I feel this method is still not good enough. That is, when writing this composited provider, as soon as one value object changes, you have to notify all listeners. In essence, it still broadcasts to all listeners, and each Consumer filters messages through Selector, which is not conducive to precise control of notify listeners.</p><p>My usual approach is as follows:</p><ol><li>The CompositedProvider is no longer a ChangeNotifier; it’s just an ordinary class, but it has multiple ValueNotifier properties and a handwritten dispose method to dispose of each ValueNotifier.</li><li>Use Provider&lt;CompositedProvider&gt; to generate the CompositedProvider Widget and provide a dispose parameter.</li><li>The descendants are no longer direct consumers of the CompositedProvider. They obtain the Provider through Provider.of&lt;CompositeProvider&gt;(context, listen: false) or context.read&lt;CompositeProvider&gt;, and then wrap themselves into individual ValueListenableBuilders of properties they interested.</li></ol><p>The flollowing code demostrates:</p><pre>import &#39;package:flutter/cupertino.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:provider/provider.dart&#39;;<br><br>void main() =&gt;<br>    runApp(MaterialApp(builder: (context, child) =&gt; CounterScreen()));<br><br>// Define a ChangeNotifier class<br>class CompositedProvider {<br>  ValueNotifier&lt;int&gt; counter = ValueNotifier&lt;int&gt;(0);<br>  ValueNotifier&lt;String&gt; message = ValueNotifier&lt;String&gt;(&#39;Hello&#39;);<br><br>  dispose() {<br>    counter.dispose();<br>    message.dispose();<br>  }<br><br>  void changeIntValue() {<br>    counter.value = counter.value + 10;<br>  }<br><br>  void changeStringValue() {<br>    message.value = &quot;Now:${DateTime.now()}&quot;;<br>  }<br>}<br><br>class CounterScreen extends StatelessWidget {<br>  const CounterScreen({super.key});<br><br>  @override<br>  Widget build(BuildContext context) {<br>    debugPrint(&#39;-------------------&#39;);<br><br>    return Provider&lt;CompositedProvider&gt;(<br>      create: (BuildContext context) {<br>        return CompositedProvider();<br>      },<br>      dispose: (_, compositeProvider) {<br>        compositeProvider.dispose();<br>      },<br>      child: Scaffold(<br>        appBar: AppBar(<br>          title: const Text(&#39;CompositedProvider App&#39;),<br>        ),<br>        body: Center(<br>          child: Column(<br>            mainAxisSize: MainAxisSize.min,<br>            children: [<br>              //one descendent<br>              Builder(builder: (BuildContext context) {<br>                CompositedProvider cp =<br>                    Provider.of&lt;CompositedProvider&gt;(context, listen: false);<br>                return Column(<br>                  children: [<br>                    ValueListenableBuilder&lt;int&gt;(<br>                      valueListenable: cp.counter,<br>                      builder:<br>                          (BuildContext context, int value, Widget? child) {<br>                        return Text(&quot;Current int Value: $value&quot;);<br>                      },<br>                    ),<br>                    const SizedBox(<br>                      height: 20,<br>                    ),<br>                    ElevatedButton(<br>                        onPressed: () {<br>                          cp.changeIntValue();<br>                        },<br>                        child: const Text(&quot;Change int value&quot;))<br>                  ],<br>                );<br>              }),<br>              const SizedBox(<br>                height: 80,<br>              ),<br>              //another descendent<br>              Builder(builder: (BuildContext context) {<br>                CompositedProvider cp =<br>                    Provider.of&lt;CompositedProvider&gt;(context, listen: false);<br>                return Column(<br>                  children: [<br>                    ValueListenableBuilder&lt;String&gt;(<br>                      valueListenable: cp.message,<br>                      builder:<br>                          (BuildContext context, String value, Widget? child) {<br>                        return Text(&quot;Current String Value: $value&quot;);<br>                      },<br>                    ),<br>                    const SizedBox(<br>                      height: 20,<br>                    ),<br>                    ElevatedButton(<br>                        onPressed: () {<br>                          cp.changeStringValue();<br>                        },<br>                        child: const Text(&quot;Change String value&quot;))<br>                  ],<br>                );<br>              }),<br>            ],<br>          ),<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86ec6d1fca8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dart Isolate Tips]]></title>
            <link>https://medium.com/@chencwf/flutter-and-isolates-0080090701ae?source=rss-9618a351e251------2</link>
            <guid isPermaLink="false">https://medium.com/p/0080090701ae</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[isolate]]></category>
            <dc:creator><![CDATA[Chencwf]]></dc:creator>
            <pubDate>Tue, 19 Mar 2024 03:46:14 GMT</pubDate>
            <atom:updated>2024-03-19T03:51:06.047Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2UBpZB0D3tEourWNs0nkTA.jpeg" /></figure><ol><li>Isolates do not share memory, so you cannot use a dart singleton to share information between isolates.</li><li>If you want to debug code inside an isolate, a hot-restart is useless; you must do a cold start because it is a native thread.</li><li>Isolates communicate using Ports, and the logic for using Ports is as follows (from <a href="https://dart.dev/language/isolates">https://dart.dev/language/isolates</a>):</li></ol><ul><li>a. The initiating thread first creates a ReceivePort. The purpose of the ReceivePort is for the initiating thread to listen to messages sent by other threads. If the initiating thread wants to actively send messages to other threads, then the sender needs a SendPort from the receiver. With the receiver’s SendPort, messages can be sent to the receiver.</li><li>b. Therefore, when the initiating thread spawns a thread, it passes its own ReceivePort.sendPort as an argument to the passive thread.</li><li>c. The passive thread obtains the SendPort sent by the initiating thread from the arguments, allowing the passive thread to send messages to the initiating thread.</li><li>d. For the passive thread to allow the initiating thread to also send messages to it, it must also create a ReceivePort. Then, through the initiating thread’s SendPort, it sends its own ReceivePort.sendPort as the first message to the initiating thread in advance. At the same time, it listens for messages from the initiating thread through this ReceivePort.listen.</li><li>e. The initiating thread will first receive the SendPort message sent by the passive thread through its own previously created ReceivePort.listen method. At this point, both parties have a SendPort for sending messages to each other and a ReceivePort.listen for receiving messages.</li></ul><p>4. Tests have shown that under default conditions, when multiple isolates access SQLite (each opening their own Database), read and write operations will be serialized. With proper planning at the app level, there is no problem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0080090701ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Write ‘Hello World’ on Vision Pro simulator using Unity as soon as possible]]></title>
            <link>https://medium.com/@chencwf/write-hello-world-on-vision-pro-simulator-using-unity-as-soon-as-possible-88db31c3b6d3?source=rss-9618a351e251------2</link>
            <guid isPermaLink="false">https://medium.com/p/88db31c3b6d3</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[apple-vision-pro]]></category>
            <dc:creator><![CDATA[Chencwf]]></dc:creator>
            <pubDate>Sun, 03 Mar 2024 15:10:43 GMT</pubDate>
            <atom:updated>2024-03-04T15:33:25.560Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Requirements</strong></h3><p><strong>hardware</strong>: An Apple Silicon Mac</p><p><strong>software</strong>:</p><ol><li>Xcode 15.2(or newer) with visionOS 1.0 SDK(or newer) installed</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4RFatwDEgoMzJ52iW6xdg.png" /></figure><p>2.Unity Pro/Enterprise/Industry, 2022.3.18f1 or newer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qA4SD6gCAvr5HHPe8-vxIQ.png" /></figure><p>3. Unity Modules: visionOS Build Support</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6-7-s8621ENtpVoTUOFdQ.png" /></figure><h3>Operation sequence(step by step)</h3><ol><li>create a 3D(UPR) project named ‘HelloWord-Vision-Pro’</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5E0QLZED-NTTuhpvNg_AWQ.png" /></figure><p>2. open ‘Build Settings’ dialog(CMD+Shift+B), set ‘Target SDK’ as ‘Simulator SDK’, ’Run in Xcode as’ as ‘Debug’ and then click the ‘Switch Platform’ button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCUkBdc4gfulosjYVE5xcQ.png" /></figure><p>3. open ‘Project Settings’ dialog(‘Edit’-&gt;’Project Settings’), select ‘Player’ on the left list, on the right panel, uncheck ‘Override Default Bundle Identifer’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QKwnCg85GA7Nn9cmVUmAMA.png" /></figure><p>4. select ‘XR PlugIn Management’ on the left lift, on the right panel, click ‘Install XR Plugin Management’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJS3TZ8bJWX5Ph1_ARXiOA.png" /></figure><p>5. after installing some pakcages,re-select ‘XR Plug-in Management’ on the left list, and check ‘Apple visionOS’ on the right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oPihvoTmDiZgX3wiWsEs-w.png" /></figure><p>6. after installing some pakcages, click ‘Yes’ on the popup dialog and Unity will restart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OGnUIBJgGqSly__N6fEOkg.png" /></figure><p>7. Because we are going to write a ‘Unbounded-Immersive’ app, so we select ‘Apple visionOS’ on the left list, and set ‘App Mode’ as ‘Mixed Reality-Volumn or Immersive Space’ on the right panel, and click ‘Yes’ to install ‘PolySpatial’ package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vumrrizYLQ_8Gu1VmgeNiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HZs7qntqxaTGRS5vuk-Y6w.png" /></figure><p>8. uncheck the ‘initalize Hand Tracking On Startup’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CmCJHb1CoPYNW45XCY8Q9Q.png" /></figure><p>9. delete ‘Main Camera’ and ‘Directional Light’ from the scene</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQjIJHxIPw7lKHuAuzKelA.png" /></figure><p>10. create a 3D Sphere in the scene, and set it’s location as (0,1.5,2),scale it to(0.2,0.2,0.2)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FacTYH1hwBaQf5L1cV5g5w.png" /></figure><p>12. create a ‘Volumn Camera’ in the scene as following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QR1fN2DE0EaPF-a-oE2K4g.png" /></figure><p>13.in ‘Resouces’ folder, create a ‘Volumn Camera Window Configuration’ asset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jV2TfoId0ij1pxBnAHmxfQ.png" /></figure><p>14. select the created ‘VolumeCameraWindowConfiguration’ asset, and set the ‘Mode’ to ‘Unbounded’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wbGMOIzFS4KK5PMbEtJMBQ.png" /></figure><p>15.Set the ‘VolumnCamera’ gameObject’s ‘Volumn Window Configuration’ property as the created ‘VolumeCameraWindowConfiguration’ asset above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPI5Y8vAGqXO3IZ-Eyx6VQ.png" /></figure><p>16. build and run(CMD+B), and create a folder named ‘build’ to place the generated Xcode project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J8GD43546hMBEe5xYyO3Nw.png" /></figure><p>17. if everything works fine, Xcode starts to compile the generated project, then launch the vision pro simuator to run your app, a dark ball emerges in front of you, done!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ff2qMEBH2aouuD_W4F76Gw.png" /></figure><h3>References:</h3><p><a href="https://docs.unity3d.com/Packages/com.unity.polyspatial.visionos@1.1/manual/index.html">https://docs.unity3d.com/Packages/com.unity.polyspatial.visionos@1.1/manual/index.html</a></p><h3>About me:</h3><p><a href="https://twitter.com/HotmailJagie">https://twitter.com/HotmailJagie</a></p><p><a href="https://www.weibo.com/u/1568977482">https://www.weibo.com/u/1568977482</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88db31c3b6d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>