<?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 Amir Mohammad Kargar on Medium]]></title>
        <description><![CDATA[Stories by Amir Mohammad Kargar on Medium]]></description>
        <link>https://medium.com/@a.m.kargar2000?source=rss-e030f53d5874------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XdcuinKYBzlWQjTW0H-MoA.png</url>
            <title>Stories by Amir Mohammad Kargar on Medium</title>
            <link>https://medium.com/@a.m.kargar2000?source=rss-e030f53d5874------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 06:30:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a.m.kargar2000/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[Derry, a script manager for Dart and Flutter.]]></title>
            <link>https://medium.com/@a.m.kargar2000/derry-a-script-manager-for-dart-and-flutter-b6b4eef4c4c9?source=rss-e030f53d5874------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6b4eef4c4c9</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Amir Mohammad Kargar]]></dc:creator>
            <pubDate>Tue, 02 Aug 2022 15:11:15 GMT</pubDate>
            <atom:updated>2022-08-02T15:11:15.451Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lPTrx8gkXclZfIeW" /></figure><p>Derry help you define a shortcut for dart scripts and save you from having to type very long and forgettable long lines of scripts.</p><p>Let’s start.</p><h3>Installation</h3><p>Install derry as a global dependency from <a href="https://pub.dev/">pub.dev</a> as follows.</p><pre>pub global activate derry</pre><h3>Usage</h3><p>Derry will look for a pubspec.yaml file in the current directory, and will throw an error if not exist. The scripts can be declared within the script’s node of the pubspec.yaml file.</p><pre>scripts:</pre><pre>build: pub run build_runner build</pre><p>And now use it,</p><pre>derry build</pre><pre><em># or even with additional arguments</em></pre><pre>derry build -- --delete-conflicting-outputs</pre><h3>Definition file</h3><p>Scripts can be configured just inside the pubspec.yaml file or within a separate file. When using a separate file to configure scripts, pass the file name as the value of the script’s node in the pubspec.yaml file.</p><pre><em># pubspec.yaml</em></pre><pre>scripts: derry.yaml</pre><p>And in derry.yaml file</p><pre><em># derry.yaml</em></pre><pre>build: pub run build_runner build</pre><p>Now run derry build .</p><p>For more detail check package at pub.dev:</p><p><a href="https://pub.dev/packages/derry">https://pub.dev/packages/derry</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6b4eef4c4c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter custom theme class with InheritedWidget]]></title>
            <link>https://medium.com/@a.m.kargar2000/flutter-custom-theme-class-with-inheritedwidget-87beb666ac2f?source=rss-e030f53d5874------2</link>
            <guid isPermaLink="false">https://medium.com/p/87beb666ac2f</guid>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Amir Mohammad Kargar]]></dc:creator>
            <pubDate>Fri, 22 Jul 2022 09:21:48 GMT</pubDate>
            <atom:updated>2022-07-22T09:21:48.345Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*peTVPU3JT5-w70DcdlrArg.png" /></figure><p>Maybe it happened to you that you wanted to create an application with a special theme, but because of the limitations of the Flutter’s built-in theme, you could not do it.</p><p>For example, consistent spacing may be the most important part of good layout design.</p><p>You can achieve this by creating your own InheritedWidget that dispatches across applications.</p><h4><strong>First of all, let’s see what’s the inherited widgets?</strong></h4><p>The inherited widget provides us with a convenient way to pass data between widgets. While developing an app you will need some data from your parent’s widgets or grant parent widgets or maybe beyond that. Unknowingly we have used inherited widgets in many places while developing the flutter app.</p><p>For example, Theme.of(context), MediaQuery.of(context), and Navigator.of(context).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BW7dalB6HxORNOXjlxJ2Q.jpeg" /></figure><p>For more info check Flutter documentation from the Flutter team:</p><p><a href="https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html">InheritedWidget class - widgets library - Dart API</a></p><h3>Let’s set up our Custom Theme</h3><p>We need to implement these classes:</p><pre>class AppTheme</pre><pre>class CustomTheme extends InheritedWidget</pre><pre>class CTheme extends StatefulWidget</pre><h4>AppTheme</h4><p>This class is the style class of our application</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2Fpf9lR5Fc5dHHsQe41ose%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2Fpf9lR5Fc5dHHsQe41ose&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/352d3628ac7cdd7e935e7e0d5846de8d/href">https://medium.com/media/352d3628ac7cdd7e935e7e0d5846de8d/href</a></iframe><h4><strong>CustomTheme</strong></h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FdWSdoqKcDT4UpbsXOPmG%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FdWSdoqKcDT4UpbsXOPmG&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fa0ad6f7f2da5a5a4ce247a0ded08fb/href">https://medium.com/media/8fa0ad6f7f2da5a5a4ce247a0ded08fb/href</a></iframe><p>As you can see the child widget is required since the InheritedWidget has to be at the root of the widget tree so it can send the data through the widget tree.</p><p>The updateShouldNotify method which we override will notify the widgets using the InheritedWidget if they need to rebuilt or not. Therefore if this method returns true then for example the StatelessWidgets using this InheritedWidget will rebuild again.</p><p>Since the InheritedWidget is immutable then to update the state (in this case theme value), we need to wrap this InheritedWidget with a StatefulWidget which will store the mutable state inside the State object.</p><h4>CTheme</h4><p>As I said before, the InheritedWidget is immutable, therefore we wrap it inside a StatefulWidget, for example:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FimxgRn1ovwAiCC9N2vad%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FimxgRn1ovwAiCC9N2vad&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f6a9d1f5c3ad7a8ed8b74e104835cab/href">https://medium.com/media/0f6a9d1f5c3ad7a8ed8b74e104835cab/href</a></iframe><p>The CTheme is a custom class that extends StatefulWidget, since we are going to use the wrapper class in the widget tree. Therefore, we use the method of(context) which will return an instance of CThemeState.</p><p>The dependOnInheritedWidgetOfExactType which takes a generic parameter of type InheritedWidget will return the instance of CustomTheme, therefore we create a variable called data, that will be of type CThemeState. This way when calling CTheme.of(context) we will be able to access the properties and method of the CThemeState class.</p><p>Inside the CThemeState, we add the changeTheme() method and use setState to tigger a rebuild when updating the theme value.</p><h3>Let’s use our Custom Theme</h3><p>First, you need to wrap your app in the theme, so you can access it everywhere:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FLmZxKoAPuXgfwNlfCkBg%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FLmZxKoAPuXgfwNlfCkBg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a8e059e6dbe33de16af2fdd793e65cf/href">https://medium.com/media/7a8e059e6dbe33de16af2fdd793e65cf/href</a></iframe><p>Now use CTheme.of(context)in your app.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FE7oKn9H5yCEsOnVzPBEF%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FE7oKn9H5yCEsOnVzPBEF&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e10017dbb7e0d7aef6a8634acee9dc6c/href">https://medium.com/media/e10017dbb7e0d7aef6a8634acee9dc6c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87beb666ac2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Best Practices]]></title>
            <link>https://medium.com/@a.m.kargar2000/flutter-best-practices-3cff00bb3a79?source=rss-e030f53d5874------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cff00bb3a79</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Amir Mohammad Kargar]]></dc:creator>
            <pubDate>Fri, 15 Jul 2022 14:36:51 GMT</pubDate>
            <atom:updated>2022-09-24T07:53:54.485Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*KlibVgY4p2rLh1X_aekvEA.png" /></figure><p><em>Learn best practices to improve code quality, readability, maintainability, and productivity with Flutter.</em></p><h3><strong>1. Refactor code into widgets rather than methods</strong></h3><p>Refactoring into a method might seem tempting but when your build method is too big it might rebuild even when nothing inside the build method was changed.<br> But when it comes to refactoring into a widget, we get all the benefits of widget lifecycle so it will rebuild only when something in the widget changes. So this prevents unnecessary rebuilds and thus improves the performance. This also offers all the optimizations that Flutter offers for the widget class.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2Fw3iavaObfWy27cSkcZrk%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2Fw3iavaObfWy27cSkcZrk&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8bfc3e2096488141ec80d8c160a73217/href">https://medium.com/media/8bfc3e2096488141ec80d8c160a73217/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FYuwnFgZECa1sobdUF8Hq%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FYuwnFgZECa1sobdUF8Hq&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7dc48d5d3a2955917d58efc486f5861/href">https://medium.com/media/b7dc48d5d3a2955917d58efc486f5861/href</a></iframe><h3>2. <strong>Use the const keyword whenever possible</strong></h3><p>When we use setState() Flutter calls the build method and rebuilds every widget tree inside it. The best way to avoid this is by using const constructors.</p><p>Use const constructors whenever possible when building your own widgets or using Flutter widgets. This helps Flutter to rebuild only widgets that should be updated.</p><h3>3. <strong>Use Cascades Operator</strong></h3><p>If we are supposed to perform a sequence of operations on the same object then we should opt for the Cascades .. operator.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2Fk9ZEeOp6FT00JUSIP5Zg%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2Fk9ZEeOp6FT00JUSIP5Zg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ec8b062794eb0c8a093494505b45b13/href">https://medium.com/media/4ec8b062794eb0c8a093494505b45b13/href</a></iframe><h3>4. <strong>Use spread collections</strong></h3><p>You can use spread collections when existing items are already stored in another collection, spread collection syntax leads to simpler and easier code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2Ft72t5IrNJk3tgBF8qapl%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2Ft72t5IrNJk3tgBF8qapl&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4f5b12fc100bc192ae413d8e0b1c466/href">https://medium.com/media/e4f5b12fc100bc192ae413d8e0b1c466/href</a></iframe><h3>5. <strong>Use Null safe (??) and Null aware (?.) operators</strong></h3><p>Always go for ?? (if null) and ?.(null aware) operators instead of null checks in conditional expressions.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2F6I9lFzqQhnAo4s95nrjq%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F6I9lFzqQhnAo4s95nrjq&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/67108dccdbf67579a28f3e5a8c277b82/href">https://medium.com/media/67108dccdbf67579a28f3e5a8c277b82/href</a></iframe><h3>6. <strong>Avoid using “as” operator instead of that, use “is” operator</strong></h3><p>Generally, the as cast operator throws an exception if the cast is not possible. To prevent an exception from being thrown, one can use is.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FcP411Z9Bflu8C5BQyBkf%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FcP411Z9Bflu8C5BQyBkf&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbe00e8347c11a2c3031f6b636682dce/href">https://medium.com/media/fbe00e8347c11a2c3031f6b636682dce/href</a></iframe><h3>7. <strong>Don’t explicitly initialize variables null</strong></h3><p>In Dart, the variable is intuitively initialized to null when its value is not specified, so adding null is redundant and not required.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FG4J3U02400vfet6oCiGk%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FG4J3U02400vfet6oCiGk&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f2af62121b0ff470dfbdbb5efa269ba1/href">https://medium.com/media/f2af62121b0ff470dfbdbb5efa269ba1/href</a></iframe><h3>8. <strong>Using SizedBox instead of Container in Flutter</strong></h3><p>The Container is a great widget that you will be using extensively in Flutter. Container() broadens up to fit the constraints given by the parent and is not a const constructor. On the contrary, the SizedBox is a const constructor and builds a fixed-size box. The width and height parameters can be null to specify that the size of the box should not be constrained in the corresponding dimension. Thus, when we have to implement the placeholder, SizedBox should be used rather than using a Container.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2F7JXWFmEv2wTBmb28woJI%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F7JXWFmEv2wTBmb28woJI&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4be01458a674f718df7ef4906bac8da/href">https://medium.com/media/a4be01458a674f718df7ef4906bac8da/href</a></iframe><h3>9. <strong>Use raw string</strong></h3><p>A raw string can be used to not come across escaping only backslashes and dollars.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FBEamWg2Vyj2YQ0IRNmoX%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FBEamWg2Vyj2YQ0IRNmoX&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/12594ab09c7ac6396acd707aa6ff3762/href">https://medium.com/media/12594ab09c7ac6396acd707aa6ff3762/href</a></iframe><h3>10. <strong>Naming convention</strong></h3><p>Dart uses 3 naming convention methods.</p><ol><li>UpperCamelCase</li><li>lowerCamelCase</li><li>lowercase_with_underscores</li></ol><p><strong>UpperCamelCase</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FSM4NcYrKRJ4hqyGrOYCb%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FSM4NcYrKRJ4hqyGrOYCb&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1333d947bb3cb9418f270b680f9c5cdd/href">https://medium.com/media/1333d947bb3cb9418f270b680f9c5cdd/href</a></iframe><p><strong>lowercase_with_underscores</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2F1oXkuN8bZ5Oynf4TCrdi%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F1oXkuN8bZ5Oynf4TCrdi&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2afeed754ed732e273f77f89c68ce946/href">https://medium.com/media/2afeed754ed732e273f77f89c68ce946/href</a></iframe><p><strong>lowerCamelCase</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FRdlrww5uPAOlnXVAT3UA%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FRdlrww5uPAOlnXVAT3UA&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/310094212e66af8988ddef5984f8b8aa/href">https://medium.com/media/310094212e66af8988ddef5984f8b8aa/href</a></iframe><h3>11. <strong>Using the if condition instead of ternary operator syntax</strong></h3><p>When laying out a Flutter app, it’s often the case that you want to render different widgets conditionally. You might need to generate a widget based on the platform, for example:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FbjuFTwi0bwHU6xAIoSRJ%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FbjuFTwi0bwHU6xAIoSRJ&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/127064ee19c5faf29371615348b80c24/href">https://medium.com/media/127064ee19c5faf29371615348b80c24/href</a></iframe><p>In this situation, you can drop the ternary operator and leverage Dart’s built-in syntax for adding an if statement in an array.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FiDKrttTzVnBDZl2E9u8c%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FiDKrttTzVnBDZl2E9u8c&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb0461eb1af80fd474e61bc427b51ba8/href">https://medium.com/media/bb0461eb1af80fd474e61bc427b51ba8/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cff00bb3a79" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>