<?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 Saad Bin Sajjad on Medium]]></title>
        <description><![CDATA[Stories by Saad Bin Sajjad on Medium]]></description>
        <link>https://medium.com/@saad2617?source=rss-2a336819eb80------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*c-8J9X5mK71w8HrX4-Cnmg.jpeg</url>
            <title>Stories by Saad Bin Sajjad on Medium</title>
            <link>https://medium.com/@saad2617?source=rss-2a336819eb80------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 00:47:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saad2617/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[Static methods in Dart]]></title>
            <link>https://medium.com/@saad2617/static-methods-in-dart-451fe4539536?source=rss-2a336819eb80------2</link>
            <guid isPermaLink="false">https://medium.com/p/451fe4539536</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[static-methods]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Saad Bin Sajjad]]></dc:creator>
            <pubDate>Mon, 08 Aug 2022 21:54:18 GMT</pubDate>
            <atom:updated>2022-08-08T21:57:21.746Z</atom:updated>
            <content:encoded><![CDATA[<h3>Static Methods in Dart</h3><h4>Explanation of static methods</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GO7M1F_ecet9QnM6bKr2hA.jpeg" /></figure><p>A lot of times, while writing software using some sort of OOP (Object Oriented Programming) language, such as while using Dart for Flutter app development, we come across the keyword <strong>static</strong>. I will try to explain very briefly in bullet points what it means for static methods and variables in a class and demonstrate with an example.</p><ul><li>Static methods are members of a class, <strong>not</strong> of the class instance.</li><li>They can only access static variables and only call other static methods of a class.</li><li>To access a static method in a class, we don’t need an instance of that class</li><li>Static methods are also known as class methods.</li><li>A single copy of a static method is spread across all instances of the class containing the method.</li></ul><p>The following class has a static variable and a method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86f60545fd2512af7925efc0b8c0e6e3/href">https://medium.com/media/86f60545fd2512af7925efc0b8c0e6e3/href</a></iframe><p>And then in the main function, the static variable can accessed to set a name and the static method can be used to display the name, all without an instance of the class :D</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b0162e59a0202c0b5440b209f748be1/href">https://medium.com/media/6b0162e59a0202c0b5440b209f748be1/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fbelateddeargilamonster&amp;display_name=Gfycat&amp;url=https%3A%2F%2Fgfycat.com%2Fbelateddeargilamonster-shah-rukh-khan&amp;image=https%3A%2F%2Fthumbs.gfycat.com%2FBelatedDearGilamonster-size_restricted.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="500" height="270" frameborder="0" scrolling="no"><a href="https://medium.com/media/867e68911c4880cb9b81caae25715a68/href">https://medium.com/media/867e68911c4880cb9b81caae25715a68/href</a></iframe><p>Yes, it is that easy to understand! Let me know in the comments if you find this useful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=451fe4539536" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift Protocols vs Dart Interfaces (Abstract Classes)]]></title>
            <link>https://medium.com/@saad2617/swift-protocols-vs-dart-interfaces-abstract-classes-b8e41bb76ce8?source=rss-2a336819eb80------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8e41bb76ce8</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Saad Bin Sajjad]]></dc:creator>
            <pubDate>Wed, 27 Oct 2021 19:19:04 GMT</pubDate>
            <atom:updated>2021-10-28T15:05:25.685Z</atom:updated>
            <content:encoded><![CDATA[<h3>Swift Protocols vs C# Interfaces vs Dart Abstract Classes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YKAkha13wIUNKSX65NgFYA.jpeg" /><figcaption>Which one do you use?</figcaption></figure><p>Coming from the Windows Phone/WPF and Flutter background, I have used a lot of Interfaces in C# and Abstract Classes in Dart, the programming languages of choice for the two platforms respectively. A C# Interface is defined as an abstract contract, and the classes or structs which use it must implement the concrete implementation of the interface. Interfaces are also found in Java and many similar languages. Something similar is found in Dart. Instead of Interfaces, Dart has Abstract classes which basically do the same thing. <strong>The only difference is that Abstract Classes are actual classes while Interfaces are empty shells, which means Abstract Classes can have constructors and methods can have empty bodies.</strong></p><p>Recently, I have dabbled a bit in Swift for developing apps using SwiftUI, Apples declarative UI framework and a possible reply to other declarative frameworks like Flutter or Jetpack Compose from Google. One of the main things in Object Oriented Programming (OOP) paradigm is Interfaces, which is heavily used in all of the platforms. While Swift doesn&#39;t have Interfaces, it has something called Protocols, which is part of a paradigm called Protocol Oriented Programming.</p><p>So whats the difference between Protocols and Interfaces? Both can have abstract methods and properties that a class can implement. <strong>But the major difference is you can also write extensions for protocols which can be used by the structs or classes implementing them</strong>. So there can actually be implementations in the protocol itself rather than only abstract stuff. They can even vary the implementation depending on the type the protocol is extending. <strong>Another difference is that protocols can be used by enums besides regular structs and classes in Swift</strong>. For more information on protocols besides the Apple documentation, I found the following link useful</p><p><a href="https://learnappmaking.com/protocols-swift-how-to/">Protocols in Swift Explained</a></p><p>Swift protocols are a powerful feature of the language, and if used properly can provide a wonderful developer experience and also make the code much more readable and understandable besides the obvious advantages!</p><p>Let me know in the comments if you have found other advantages or disadvantages of Protocols over Interfaces or Abstract Classes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8e41bb76ce8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>