<?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 Paul DeMarco on Medium]]></title>
        <description><![CDATA[Stories by Paul DeMarco on Medium]]></description>
        <link>https://medium.com/@paulmdemarco?source=rss-6a6906688c7e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*M7JhWLKz0bVl4f6mDevHlQ.jpeg</url>
            <title>Stories by Paul DeMarco on Medium</title>
            <link>https://medium.com/@paulmdemarco?source=rss-6a6906688c7e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:45:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paulmdemarco/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[FlutterDux — Flutter + Redux.js]]></title>
            <link>https://medium.com/@paulmdemarco/flutterdux-flutter-redux-js-3d1b5a6c33cb?source=rss-6a6906688c7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d1b5a6c33cb</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Paul DeMarco]]></dc:creator>
            <pubDate>Thu, 19 Oct 2017 20:46:40 GMT</pubDate>
            <atom:updated>2017-10-20T16:48:38.795Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://github.com/pauldemarco/flutterdux">FlutterDux</a> allows you to take advantage of the latest in mobile development, while still having available the vast ecosystem of JavaScript libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7W21TJXpErLG5pQBMHtY3Q.gif" /><figcaption>Flutter working remotely with <a href="https://github.com/zalmoxisus/remote-redux-devtools">Redux DevTools</a></figcaption></figure><h3>How it works</h3><p>When your app starts, the redux-driven website is loaded on the platform’s WebView. A Flutter <strong>platform channel</strong> is used to dispatch <em>actions </em>down to the website, while <em>state</em> changes are reported back up to Flutter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3F16RDrdkNFJIdaBWR91sA.png" /><figcaption>Flutter dispatches actions and subscribes to state changes</figcaption></figure><p>Redux naturally suggests a nice decoupling between views and business logic, making it possible to swap out your current view library (react/polymer) for Flutter, or even piggy-back off of an existing website with minimal changes.</p><p><em>Also,</em> since the website is running on a fully capable WebView, you can leverage the full power of JavaScript and it’s established ecosystem of libraries (Firebase SDK, Realm, etc)!</p><h3>Running the ‘counter’ demo</h3><p>Navigate to the plugins <a href="https://github.com/pauldemarco/flutterdux/tree/master/example">example</a> directory and flutter run</p><h4>FlutterDuxMixin</h4><p>Flutter widgets <strong>with</strong> FlutterDuxMixin have the ability to dispatch actions and subscribe to state ‘properties’. Whenever a state slice changes for that property, the Widget’s setState gets called automatically.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cea229106afaa65efaf0748b4ed01931/href">https://medium.com/media/cea229106afaa65efaf0748b4ed01931/href</a></iframe><h4>Loading the website</h4><p>We’ll need a website running redux, this can either be hosted externally or internally if you need offline access. I’ve created a small plunker example <a href="https://plnkr.co/edit/m7a0uIcTwFfFDh4oVKx7">here</a> for testing.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc57cfc643ff637a689f49ad4f2e3961/href">https://medium.com/media/fc57cfc643ff637a689f49ad4f2e3961/href</a></iframe><p><em>Note: It is assumed that the website exposes the redux store as a global variable. If not, you can specify the base path in loadUrl(url, basePath: ‘base’).</em></p><h3>Optional</h3><h4>Remote Redux DevTools</h4><p>One of the <em>coolest</em> ways of visualizing state changes in redux is with Redux DevTools. Simply follow the <a href="https://github.com/zalmoxisus/remote-redux-devtools#usage">instructions</a> to setup, nothing extra is needed for Flutter!</p><h4>Webpack Dev Server</h4><p>If you’d like automatic reloading of your website while developing, I recommend using <strong>webpack-dev-server.</strong></p><p>For a starter web project, check out <a href="https://github.com/pauldemarco/flutterdux_webstarter">this repo</a>.</p><h3>Final thoughts</h3><p>By confining app state to a WebView running redux, it enforces correct usage of the framework. Flutter’s only concern then is layout and user interaction, a proper <strong>View </strong>layer.</p><p>Android and iOS WebViews allow for geolocation, camera and some other hardware functionality. For anything else, a <a href="https://pub.dartlang.org/flutter/packages">Flutter Plugin</a> can be used, and the data can be dispatched as an action, e.g. ‘BLUETOOTH_DEVICE_FOUND’.</p><p>It’s been magical using this with a webpack-dev-server… Once your Flutter Widgets are in place and final, changes to your website <em>automagically</em> change state in your app, without the need to Hot-Reload (even though it’s lightning fast!).</p><p>If you are looking for pure<strong> </strong>Dart versions of redux, check out the list at <a href="https://github.com/Solido/awesome-flutter#flux--redux">Awesome Flutter</a>.</p><h3>References</h3><ol><li><a href="https://flutter.io/">Flutter</a></li><li><a href="https://www.polymer-project.org/">Polymer Project</a></li><li><a href="http://redux.js.org/">Redux</a></li><li><a href="https://github.com/tur-nr/polymer-redux">Polymer-Redux</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d1b5a6c33cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing multi-path updates in Firebase]]></title>
            <link>https://medium.com/@paulmdemarco/securing-multi-path-updates-in-firebase-4fddb95a0a0?source=rss-6a6906688c7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fddb95a0a0</guid>
            <category><![CDATA[firebaserealtimedatabase]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Paul DeMarco]]></dc:creator>
            <pubDate>Fri, 05 May 2017 20:31:46 GMT</pubDate>
            <atom:updated>2017-10-18T09:08:13.644Z</atom:updated>
            <content:encoded><![CDATA[<p>Denormalizing data in Firebase is “normal”, so let’s secure it.</p><p>Consider the common scenario of users and groups:</p><pre>{<br>    &quot;users&quot;: {<br>        &quot;user1&quot;: {<br>            &quot;groups&quot;: {<br>                &quot;group1&quot;: true,<br>                &quot;group2&quot;: true<br>            }<br>        }<br>    },<br>    &quot;groups&quot;: {<br>        &quot;group1&quot;: {<br>            &quot;users&quot;: {<br>                &quot;user1&quot;: true,<br>            }<br>        },<br>        &quot;group2&quot;: {<br>            &quot;users&quot;: {<br>                &quot;user1&quot;: true,<br>            }<br>        }<br>    }<br>}</pre><p>When a user joins a group, two things <strong>must </strong>happen:</p><ol><li>The user should be added to the group’s <em>user[]</em> list</li><li>The group should be added to the user’s <em>group[]</em> list</li></ol><p>How can we enforce that the client performs both steps when adding themselves to a group? <strong>Enter security rules…</strong></p><h3>Security Rules</h3><p>Consider the following security rules:</p><pre>{<br>    &quot;users&quot;: {<br>        &quot;$userId&quot;: {<br>            &quot;groups&quot;: {<br>                &quot;$groupId&quot;: {<br>                    &quot;.read&quot;: true,<br>                    &quot;.write&quot;: &quot;newData.parent().parent().parent().parent().child(&#39;groups&#39;).child($groupId).child(&#39;users&#39;).hasChild($userId)&quot;<br>                }<br>            }<br>        }<br>    },<br>    &quot;groups&quot;: {<br>        &quot;$groupId&quot;: {<br>            &quot;users&quot;: {<br>                &quot;$userId&quot;: {<br>                    &quot;.read&quot;: true,<br>                    &quot;.write&quot;: &quot;newData.parent().parent().parent().parent().child(&#39;users&#39;).child($userId).child(&#39;groups&#39;).hasChild($groupId)&quot;<br>                }<br>            }<br>        }<br>    }<br>}</pre><p>The <em>.write</em> rules in each node are effectively saying, “Do not allow a key here that doesn’t exist in the other node”.</p><p>To learn more about <em>newData</em>, traversing with <em>parent/child</em>, and many more tools to help you lock it down, refer to the official <a href="https://firebase.google.com/docs/reference/security/database/">Firebase Security Rules API</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fddb95a0a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>