<?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 周恭煥 on Medium]]></title>
        <description><![CDATA[Stories by 周恭煥 on Medium]]></description>
        <link>https://medium.com/@kenchou2006?source=rss-345c725e3439------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-ygsr1fn1Q3RP371ncFvSg.jpeg</url>
            <title>Stories by 周恭煥 on Medium</title>
            <link>https://medium.com/@kenchou2006?source=rss-345c725e3439------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 00:40:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kenchou2006/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[[Flutter] 飛天小女警About Page製作]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/flutter-%E9%A3%9B%E5%A4%A9%E5%B0%8F%E5%A5%B3%E8%AD%A6about-page%E8%A3%BD%E4%BD%9C-9c38d564f9a6?source=rss-345c725e3439------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c38d564f9a6</guid>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[周恭煥]]></dc:creator>
            <pubDate>Fri, 28 Mar 2025 05:24:15 GMT</pubDate>
            <atom:updated>2025-03-28T05:24:15.659Z</atom:updated>
            <content:encoded><![CDATA[<h3>成果展示</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vxXFlO2OWG8v4bMRI-RbOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sgTEhZOBOWFcVpg1ieLMLA.png" /></figure><h3>SingleChildScrollView</h3><p>使頁面內容可以上下滾動</p><pre>return SingleChildScrollView(<br>      child: Column(<br>        children: const [<br>          HeroBanner(),<br>          CharacterSection(),<br>          StorySection(),<br>          GenreSection(),<br>          EpisodesSection(),<br>          CreatorSection(),<br>        ],<br>      ),<br>    );</pre><h3>Text 和 Image、Stack 和 Positioned</h3><p>顯示文字和圖片，呈現標題、描述和角色圖像。</p><p>重疊顯示元素，Positioned 用來控制位置。</p><pre>return Stack(<br>      children: [<br>        Image.network(<br>          &#39;https://threadheads.com/cdn/shop/files/Desktop_Banner_Powerpuff_Girls_af39b8e4-3900-42db-80bc-defec60dc7f5.jpg?v=1728531786&amp;width=1800&#39;,<br>          height: 200,<br>          width: double.infinity,<br>          fit: BoxFit.cover,<br>        ),<br>        Positioned(<br>          bottom: 0,<br>          left: 0,<br>          right: 0,<br>          child: Container(<br>            color: Colors.black54,<br>            padding: const EdgeInsets.all(16),<br>            child: const Text(<br>              &#39;About The Series&#39;,<br>              style: TextStyle(<br>                color: Colors.white,<br>                fontSize: 24,<br>                fontWeight: FontWeight.bold,<br>              ),<br>            ),<br>          ),<br>        ),<br>      ],<br>    );</pre><h3>Icon、Column 和 Row、Container, Padding 和 SizedBox</h3><p>顯示圖標，用來呈現不同角色特徵。</p><p>排列子元件，Column 垂直排列，Row 水平排列。</p><p>用來設置邊距、間隔和盒子模型。</p><pre>return Container(<br>      padding: const EdgeInsets.all(16),<br>      child: Column(<br>        crossAxisAlignment: CrossAxisAlignment.start,<br>        children: [<br>          const Text(<br>            &#39;Main Characters&#39;,<br>            style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold),<br>          ),<br>          const SizedBox(height: 16),<br>          SizedBox(<br>            height: 280,<br>            child: ListView(<br>              scrollDirection: Axis.horizontal,<br>              children: const [<br>                CharacterCard(<br>                  name: &#39;Blossom&#39;,<br>                  color: Colors.pink,<br>                  description: &#39;Everything nice&#39;,<br>                  // imageUrl: &#39;https://www.popdaily.com.tw/shaper/u/202304/2a1bc013-2744-4a98-8f07-74885e32a5fd.jpeg&#39;,<br>                  imageUrl: &#39;assets/images/Blossom.jpg&#39;,<br>                  icon: Icons.star,<br>                ),<br>                CharacterCard(<br>                  name: &#39;Bubbles&#39;,<br>                  color: Colors.blue,<br>                  description: &#39;Sugar&#39;,<br>                  // imageUrl: &#39;https://www.popdaily.com.tw/shaper/u/202304/0f3d18a2-686b-4ed3-9eb5-f8a953ff0b77.jpeg&#39;,<br>                  imageUrl: &#39;assets/images/Bubbles.jpg&#39;,<br>                  icon: Icons.favorite,<br>                ),<br>                CharacterCard(<br>                  name: &#39;Buttercup&#39;,<br>                  color: Colors.green,<br>                  description: &#39;Spice&#39;,<br>                  // imageUrl: &#39;https://www.popdaily.com.tw/shaper/u/202304/c8ba330e-edf3-4de5-95a5-05286bc5d6b6.jpeg&#39;,<br>                  imageUrl: &#39;assets/images/Buttercup.jpg&#39;,<br>                  icon: Icons.bolt,<br>                ),<br>              ],<br>            ),<br>          ),<br>        ],<br>      ),<br>    );</pre><h3>CircleAvatar</h3><p>顯示圓形圖片，用於顯示作者頭像。</p><pre>class CreatorSection extends StatelessWidget {<br>  const CreatorSection({super.key});<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Container(<br>      padding: const EdgeInsets.all(16),<br>      child: Column(<br>        crossAxisAlignment: CrossAxisAlignment.start,<br>        children: [<br>          const Text(<br>            &#39;Created By&#39;,<br>            style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold),<br>          ),<br>          const SizedBox(height: 16),<br>          Row(<br>            children: [<br>              CircleAvatar(<br>                radius: 30,<br>                backgroundImage: const NetworkImage(<br>                  &#39;https://upload.wikimedia.org/wikipedia/commons/0/03/Craig_McCracken_1.jpg&#39;,<br>                ),<br>              ),<br>              const SizedBox(width: 16),<br>              Expanded(<br>                child: Column(<br>                  crossAxisAlignment: CrossAxisAlignment.start,<br>                  children: const [<br>                    Text(<br>                      &#39;Craig McCracken&#39;,<br>                      style: TextStyle(<br>                        fontSize: 18,<br>                        fontWeight: FontWeight.bold,<br>                      ),<br>                    ),<br>                    Text(&#39;Animation Director &amp; Creator&#39;),<br>                  ],<br>                ),<br>              ),<br>            ],<br>          ),<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><h3>AppBar</h3><p>顯示頁面標題和背景色。</p><pre>appBar: AppBar(<br>        title: const Text(&#39;The Powerpuff Girls&#39;),<br>        backgroundColor: Colors.pink[100],<br>      ),</pre><h3>Divider</h3><p>用來在區塊間加入分隔線。</p><pre>Divider(height: 1),</pre><h3>ClipRRect</h3><p>裁切圖片圓角，使頁面更精緻。</p><pre>class CharacterCard extends StatelessWidget {<br>  final String name;<br>  final Color color;<br>  final String description;<br>  final String imageUrl;<br>  final IconData icon;<br><br>  const CharacterCard({<br>    super.key,<br>    required this.name,<br>    required this.color,<br>    required this.description,<br>    required this.imageUrl,<br>    this.icon = Icons.circle,<br>  });<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Container(<br>      width: 200, // Increased from 160<br>      margin: const EdgeInsets.only(right: 16),<br>      decoration: BoxDecoration(<br>        color: color.withOpacity(0.1),<br>        borderRadius: BorderRadius.circular(12),<br>        border: Border.all(color: color.withOpacity(0.3)),<br>      ),<br>      child: Column(<br>        children: [<br>          ClipRRect(<br>            borderRadius: const BorderRadius.vertical(top: Radius.circular(12)),<br>            // child: Image.network(<br>            child: Image.asset(<br>              imageUrl,<br>              height: 200, // Increased from 160<br>              width: double.infinity,<br>              fit: BoxFit.cover,<br>            ),<br>          ),<br>          Padding(<br>            padding: const EdgeInsets.all(12),<br>            child: Column(<br>              children: [<br>                Row(<br>                  mainAxisAlignment: MainAxisAlignment.center,<br>                  children: [<br>                    Icon(icon, color: color, size: 16),<br>                    const SizedBox(width: 4),<br>                    Text(<br>                      name,<br>                      style: const TextStyle(<br>                        fontWeight: FontWeight.bold,<br>                        fontSize: 16,<br>                      ),<br>                    ),<br>                  ],<br>                ),<br>                const SizedBox(height: 4),<br>                Text(<br>                  description,<br>                  style: TextStyle(<br>                    color: Colors.grey[600],<br>                    fontSize: 14,<br>                  ),<br>                ),<br>              ],<br>            ),<br>          ),<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><h3>GitHub Repo</h3><p><a href="https://github.com/kenchou2006/Powerpuff-Girls-About-Page">GitHub - kenchou2006/Powerpuff-Girls-About-Page: 台大系統訓練班 Flutter作業</a></p><h3>Live Demo</h3><p><a href="https://kenchou2006.github.io/Powerpuff-Girls-About-Page/">ntu_hw_about</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c38d564f9a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/flutter-%E9%A3%9B%E5%A4%A9%E5%B0%8F%E5%A5%B3%E8%AD%A6about-page%E8%A3%BD%E4%BD%9C-9c38d564f9a6">[Flutter] 飛天小女警About Page製作</a> was originally published in <a href="https://medium.com/peter-pan-swift-ios-class">彼得潘的 Swift iOS / Flutter App 開發教室</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Flutter] 部署到GitHub Pages]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/flutter-%E9%83%A8%E7%BD%B2%E5%88%B0github-pages-1bb343ae0068?source=rss-345c725e3439------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bb343ae0068</guid>
            <category><![CDATA[deploy-on-github-pages]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[周恭煥]]></dc:creator>
            <pubDate>Fri, 21 Mar 2025 16:46:15 GMT</pubDate>
            <atom:updated>2025-03-21T16:46:15.838Z</atom:updated>
            <content:encoded><![CDATA[<p>雖然Flutter比較常被用來開發行動裝置App。但有些自己練習的小作品想分享給其他人，或是為了隨時能夠展示，也可以利用網頁呈現自己開發的作品。</p><p>使用GitHub Pages與Firebase等其他平台相比，速度上比較沒有優勢。但部署不需要額外使用其他平台，相對方便。</p><p>Step 1.新增一個GitHub Action yaml文件到專案中</p><pre>#.github/workflows/pages.yml<br>name: Deploy Flutter Web to GitHub Pages<br><br>on:<br>  push:<br>    branches:<br>      - main<br><br>permissions:<br>  contents: read<br>  pages: write<br>  id-token: write<br><br>jobs:<br>  build:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - name: Checkout repository<br>        uses: actions/checkout@v4<br><br>      - name: Setup Flutter<br>        uses: subosito/flutter-action@v2<br>        with:<br>          flutter-version: &#39;3.29&#39;<br>          channel: &#39;stable&#39;<br><br>      - name: Install dependencies<br>        run: flutter pub get<br><br>      - name: Get repo name<br>        run: echo &quot;BASE_HREF=/${GITHUB_REPOSITORY#*/}/&quot; &gt;&gt; $GITHUB_ENV<br><br>      - name: Build Flutter Web<br>        run: flutter build web --release --base-href &quot;$BASE_HREF&quot;<br><br>      - name: Upload artifact for GitHub Pages<br>        uses: actions/upload-pages-artifact@v3<br>        with:<br>          path: build/web<br><br>  deploy:<br>    environment:<br>      name: github-pages<br>      url: ${{ steps.deployment.outputs.page_url }}<br><br>    runs-on: ubuntu-latest<br>    needs: build<br><br>    steps:<br>      - name: Deploy to GitHub Pages<br>        id: deployment<br>        uses: actions/deploy-pages@v4</pre><p>需要注意的是，如果Repo名稱是{username}.github.io，或是使用Custom domain，需要把Build Flutter Web當中的— <strong>base-href “$BASE_HREF”</strong>移除。</p><p>Step 2.修改GitHub Pages設定</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D508DS54tL1t39Oc3kUd-w.png" /></figure><p>需要把Source從<strong>from a branch</strong>改為<strong>GitHub Action</strong>，才會正常被部署。</p><p>Step 3.配置.gitignore</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iPLAcAdWw6Lksr01YcpLFA.png" /></figure><p>把<strong> /build/</strong> 新增到.gitignore 中，確保舊的文件不會被部署。由GitHub Action執行build web，可以減少其他麻煩的動作。</p><p>Step 4.推送程式碼到GitHub</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ulnxCxwnajGbf8qtjE3tRQ.png" /></figure><p>推送之後就會自動執行build以及部署到GitHub Pages。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sFGO8kVbqS7OBk-M2Qgf0w.png" /></figure><p>看到Jobs執行完成後，就可以瀏覽自己的網頁了。</p><p>網址為：https://{username}.github.io/{reponame}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3m-B6WXL-fWzQbp9uA9CQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bb343ae0068" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/flutter-%E9%83%A8%E7%BD%B2%E5%88%B0github-pages-1bb343ae0068">[Flutter] 部署到GitHub Pages</a> was originally published in <a href="https://medium.com/peter-pan-swift-ios-class">彼得潘的 Swift iOS / Flutter App 開發教室</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>