<?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 Seven Du on Medium]]></title>
        <description><![CDATA[Stories by Seven Du on Medium]]></description>
        <link>https://medium.com/@shiwei?source=rss-64442dec557e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ntwR37blDuET6UwO68EAvg.jpeg</url>
            <title>Stories by Seven Du on Medium</title>
            <link>https://medium.com/@shiwei?source=rss-64442dec557e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 06 Jun 2026 12:27:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shiwei/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[A New Revolution in Flutter State Management: Oref, Making Your Code Magically Reactive]]></title>
            <link>https://shiwei.medium.com/a-new-revolution-in-flutter-state-management-oref-making-your-code-magically-reactive-1a211538a989?source=rss-64442dec557e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a211538a989</guid>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[oref]]></category>
            <dc:creator><![CDATA[Seven Du]]></dc:creator>
            <pubDate>Fri, 03 Oct 2025 15:48:12 GMT</pubDate>
            <atom:updated>2025-10-03T16:17:48.103Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oRCLftuUn0o1MurLR-Ct2Q.png" /></figure><blockquote>In the world of Flutter development, state management is like that thorny bramble — it should be simple, yet it always drags you into a swamp of boilerplate code. Provider? Too many listeners. Bloc? Events feel like playing Tetris. Riverpod? Elegant, but you still have to learn a bunch of new concepts. Have you ever wondered if state management could “magically” inject into your Widgets like Vue.js, with just one line of code automatically responding to changes?</blockquote><p>Hi, I’m Seven, a Flutter-obsessed developer. Today, I want to take you into Oref — a reactive state management library based on signals. It’s not just another “framework,” but a lightweight “magic wand” that frees you from the chains of StatefulWidget, letting you focus on writing clean, fast code. It’s 2025 — time to upgrade your toolkit.</p><h3>The Pain Points of State Management: Why Are We Always Struggling in “Refactoring Hell”?</h3><p>Recall: You just finished a counter Widget, but adding an async API call forces you to refactor into StatefulWidget, add setState, and listen for changes everywhere. Or with Provider, you have to wrap layers of Consumer, making the code bloat like Russian nesting dolls. The result? Performance bottlenecks, debugging nightmares, and endless “why not refactor?” meetings.</p><p>The Flutter community has tried various solutions: from the primitive setState era, to BLoC’s event-driven approach, to Riverpod’s dependency injection. But the core issue remains: too much boilerplate code, and reactivity that’s too passive. Oref is here, disrupting it all with a “signals” pattern — inspired by Solid.js and Vue’s reactivity system, but tailored specifically for Flutter.</p><h3>What is Oref? A Zero-Boilerplate, Ultra-High-Performance Signals Library</h3><p>Oref is built on <a href="https://pub.dev/packages/alien_signals"><strong>alien_signals</strong></a>, providing signals, computed values, and effects. Its killer feature? Context injection: Signals “magically” bind directly to BuildContext without hooks or mixins. Your StatelessWidget instantly becomes a reactive powerhouse.</p><ul><li>Core Philosophy: Non-intrusive. Oref doesn’t force you to rewrite existing code; it integrates like air.</li><li>Performance Champion: With optimizations from alien_signals, Oref excels in rebuild and response speeds, especially for high-frequency updates. Early user feedback shows it significantly reduces memory usage and rebuild overhead in real apps.</li><li>Async-Friendly: Built-in useAsyncData supports Future/Stream, seamlessly handling loading states.</li></ul><p>Installation is super simple:</p><pre>flutter pub add oref</pre><h3>Hands-On Example: From Zero to Hero in Just 10 Lines of Code</h3><p>Let’s demonstrate with a classic counter. A traditional Provider version might take 50+ lines; Oref? Check this out:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:oref/oref.dart&#39;;<br><br>void main() =&gt; runApp(MyApp());<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    final count = signal(context, 0); // Create a sugnals<br>    final increment = () =&gt; count(count() + 1); // increment count<br><br>    return MaterialApp(<br>      home: Scaffold(<br>        body: Center(<br>          child: Text(&#39;Count: ${count()}&#39;), // read the count value<br>        ),<br>        floatingActionButton: FloatingActionButton(<br>          onPressed: increment,<br>          child: Icon(Icons.add),<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><p>Run it, tap the button — the count updates automatically, no setState or Consumer needed!</p><p>Magic, right? Signals batch changes in the background, rebuilding only what’s necessary. Want full examples? <a href="https://github.com/medz/oref/tree/main/example">GitHub example folder</a> is ready for you to fork.</p><p>Oref isn’t meant to replace everything — it’s complementary to flutter_hooks. If you love template-style, try flutter_signals; but if you crave minimalism, Oref is your new favorite.</p><h3>Future Outlook: Oref’s Signals Will Illuminate Flutter</h3><p>Flutter’s future is reactive — Oref is just the starting point. Try it out, and share your “magic moments” in the comments. Who knows, your App might be the next App Store star.</p><p>Like, share, subscribe — let’s make state management fun together!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a211538a989" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dart develops web applications, Spry may be better.]]></title>
            <link>https://shiwei.medium.com/dart-develops-web-applications-spry-may-be-better-346163962cf6?source=rss-64442dec557e------2</link>
            <guid isPermaLink="false">https://medium.com/p/346163962cf6</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[shelves]]></category>
            <category><![CDATA[spry]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Seven Du]]></dc:creator>
            <pubDate>Tue, 27 Dec 2022 06:44:58 GMT</pubDate>
            <atom:updated>2022-12-27T07:01:47.829Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHQaC3D1JC5HwlL6FHQZww.png" /></figure><h3>What is Spry？</h3><p>Spry is an HTTP middleware framework for Dart to make web applications and APIs more enjoyable to write.</p><h3>How is it different from Shelf?</h3><ol><li>Middleware — Shelf middleware requires a complete call process (this is the source of my pain), and Spry absorbs the experience of Express/Koa, passing the “next” method to let the middleware decide when to call the next middleware.</li><li>Context — The Shelf context is attached to the request object and Spry wraps the request/response and whatever else with the context.</li><li>Request — Spry has made some practical packages for requests, which can facilitate the expansion of middleware, but it is not very different from Shelf. The only difference is that Spry’s request is in read-only mode. Middleware can be modified by context attachment.</li><li>Response — Shelf’s response is a read-only object. To modify it in the pipeline (such as middleware), you can only recreate the Response. Spry is different, the Spry response is created with the context and can be modified fluently.</li><li>Handlers — Shelf’s handler only accepts a request object, and then decides what type of Response to return. Spry accepts a context object, which contains the processing results of the pre-middleware, and also wraps the request and response. You can Modify the response anywhere until it is sent.</li></ol><h3>Middleware</h3><p>A shelf middleware:</p><pre>FutureOr&lt;Response&gt; middleware(Handler handler) {<br>  return (Request request) {<br>    // Front TODO<br>    <br>    final response = handler(request);<br><br>    // Rear TODO<br><br>    // Must return a response<br>    return response.<br>  }<br>}</pre><p>The Spry middleware:</p><pre>middleware(Context context, MiddlewareNext next) async {<br>  // Front TODO ...<br>  await next();<br>  // Rear TODO ...<br>})</pre><p>Everyone will feel different about which is better, but Spry simplifies the return process of middleware and the complexity of function implementation.</p><h3>Request handler</h3><p>Spry define a handler:</p><pre>handler(Context context) {<br>  // TODO<br>}</pre><p>Shelf handler:</p><pre>FutureOr&lt;Response&gt; handler(Request request) {<br>  // TODO<br>  return Response.ok(...);<br>}</pre><p>You can see the difference, Spry does not force the processing to create a response, because the response already exists when the context is created. There can be no logic in the handler.</p><h3>Router</h3><p>Let’s take `/hello/{name}` as an example, in Shelf:</p><pre>router.get(&#39;/hello/&lt;name&gt;&#39;, handler);</pre><p>In Spry:</p><pre>router.get(&#39;/hello/:name&#39;, handler);</pre><p>There is no difference in this basic route matching except the syntax is different, but Spry supports more advanced route matching modes.</p><p>Now we come to a complex route:</p><pre>// Spry<br>router.get(&#39;/hello/:name*&#39;, handler);<br><br>// Shelf<br>router.get(&#39;/hello/&lt;name|.*&gt;&#39;, handler);</pre><p>The route matching mode of Spry router is similar to that of Express/Koa. Thanks to the practice of the NodeJS ecosystem for many years, we believe that path to regular expression is a very mature way with the least burden on developers.</p><h3>Router mount / Subroute</h3><p>The Spry sub-route mount is fully adaptive. We are not allowed to modify the path of the request object to simulate this process. The full path should be returned to the developer!</p><p>The shelf sub-routing completes the matching by modifying request.uri.path, and Spry determines the prefix at the routing stage to complete it!</p><p>Example:</p><pre>// Spry<br>router.mount(prefix: &#39;/hello&#39;, (Context context) {<br>  // TODO.<br>});<br><br>// Shelf<br>router.mount(&#39;/hello&#39;, (Request request) {<br>  // TODO<br><br>  return response;<br>})</pre><p>In the above example, both sides are easy to use, what if we add path rules to prefix?</p><pre>// Spry<br>router.mount(prefix: &#39;/hello/:name&#39;, (Context context) {<br>  // TODO.<br>})<br><br>// Shelf<br>// not support</pre><p>Here’s another example:</p><pre>// Spry<br>final Router api = Router(&#39;/api&#39;)<br><br>api.get(&#39;/users/:id&#39;, handler); // full path is &quot;/api/users/:id&quot;<br><br>router.mount(api);<br><br>// Shelf<br>final Router api = Router();<br><br>api.get(&#39;/users/:id&#39;, handler); // full path is /users/:id<br><br>router.mount(&#39;/api&#39;, router); first match `/api/*`<br></pre><p>In this example, route grouping is carried out by mounting sub-routes, which is not supported by shelf.</p><h3>More…</h3><p>If you think spry is ok. Lightly give spry a 🌟star.</p><p>GitHub: <a href="https://github.com/odroe/spry">https://github.com/odroe/spry</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=346163962cf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Heroicons for Vue.js — Free, Open source icons]]></title>
            <link>https://shiwei.medium.com/heroicons-for-vue-js-free-open-source-icons-d7b31f0f770a?source=rss-64442dec557e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7b31f0f770a</guid>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[heroicons]]></category>
            <dc:creator><![CDATA[Seven Du]]></dc:creator>
            <pubDate>Thu, 23 Apr 2020 05:15:14 GMT</pubDate>
            <atom:updated>2020-04-23T05:19:17.178Z</atom:updated>
            <content:encoded><![CDATA[<h3>Heroicons for Vue.js — Free, Open source icons</h3><p>A set of free MIT-licensed high-quality SVG icons for Vue.js development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qq_BtlwG6p3iUEgPuzFELQ.png" /></figure><h3>Install</h3><ul><li>npm i @bytegem/vue-heroicons -S</li><li>yarn add @bytegem/vue-heroicons</li></ul><h3>Using</h3><pre>import Vue from &#39;vue&#39;;<br>import Heroicons from &#39;@bytegem/vue-heroicons&#39;;</pre><pre>Vue.use(Heroicons)</pre><h3>Example</h3><pre>&lt;HeroIconAdjustmentsOutline /&gt;</pre><p>Or</p><pre>&lt;hero-icon-adjustments-outline /&gt;</pre><p>GitGub: <a href="https://github.com/bytegem/vue-heroicons">https://github.com/bytegem/vue-heroicons</a></p><p>Docs website: <a href="https://bytegem.github.io/vue-heroicons/">https://bytegem.github.io/vue-heroicons/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7b31f0f770a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ThinkSNS+ is the use of Laravel framework to achieve the user ecosystem, Can be friendly and low…]]></title>
            <link>https://shiwei.medium.com/thinksns-is-the-use-of-laravel-framework-to-achieve-the-user-ecosystem-can-be-friendly-and-low-eb49d62e4ff1?source=rss-64442dec557e------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb49d62e4ff1</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[composer]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Seven Du]]></dc:creator>
            <pubDate>Sat, 29 Jul 2017 13:48:17 GMT</pubDate>
            <atom:updated>2017-07-29T13:48:17.953Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/128/1*R7DjeNKQQi7ak4cyn1Jkfg.png" /><figcaption>ThinkSNS+</figcaption></figure><p><a href="https://github.com/slimkit/thinksns-plus">ThinkSNS+</a> is the use of <a href="https://github.com/laravel/laravel">Laravel</a> framework to achieve the user ecosystem, Can be friendly and low coupling development development applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb49d62e4ff1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>