<?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 Mehmet Demir on Medium]]></title>
        <description><![CDATA[Stories by Mehmet Demir on Medium]]></description>
        <link>https://medium.com/@demirdev?source=rss-e25bdba5b576------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BT_c5AmC3RvBf2OPcewjew.jpeg</url>
            <title>Stories by Mehmet Demir on Medium</title>
            <link>https://medium.com/@demirdev?source=rss-e25bdba5b576------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:56:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@demirdev/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[Stop Typing Long Commands: Why Flutter Projects Need Scripts]]></title>
            <link>https://medium.com/@demirdev/stop-typing-long-commands-why-flutter-projects-need-script-files-dc54968d5a69?source=rss-e25bdba5b576------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc54968d5a69</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Mehmet Demir]]></dc:creator>
            <pubDate>Sat, 25 Oct 2025 10:48:19 GMT</pubDate>
            <atom:updated>2025-10-26T16:25:30.271Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vxfVK8QHLCGxAZfBPdnY5A.png" /></figure><p>Commands we use in Flutter and Dart applications can be quite long. For example:</p><pre>flutter build ipa --release --export-options-plist=ios/ExportOptions.plist<br>dart run build_runner build --delete-conflicting-outputs<br>flutter build appbundle --release --flavor production</pre><p>Searching for these commands in terminal history or rewriting them every time means wasting our time. Additionally, we cannot expect new developers joining the project to know all build commands. This is our problem.</p><h3>Solution</h3><p>There are two methods to simplify these commands:</p><ol><li>Creating script files (covered in this article)</li><li>Defining aliases (shell configuration)</li></ol><p>In this article, we will see how to shorten commands by creating script files in a Flutter project.</p><h3>Step 1: Create Scripts Directory</h3><p>Create a folder named <strong>scripts</strong> in your Flutter project&#39;s root directory:</p><pre>mkdir scripts</pre><h3>Step 2: Create Script Files</h3><p>Create the shell files you need inside the <strong>scripts</strong> directory. Give each file a <strong>.sh</strong> extension. It is very important to create your own scripts according to your project&#39;s needs.</p><p><strong>build_runner.sh</strong></p><pre>#!/bin/bash<br>dart run build_runner build --delete-conflicting-outputs</pre><p><strong>build_ipa.sh</strong></p><pre>#!/bin/bash<br>flutter build ipa</pre><p><strong>build_appbundle.sh</strong></p><pre>#!/bin/bash<br>flutter build appbundle</pre><h3>Step 3: Grant Execution Permission</h3><p>You must grant execution permission to the script files you created:</p><pre>chmod u+x scripts/build_runner.sh<br>chmod u+x scripts/build_ipa.sh<br>chmod u+x scripts/build_appbundle.sh</pre><p>Or to grant permission to all scripts at once:</p><pre>chmod u+x scripts/*.sh</pre><h3>Step 4: Using Scripts</h3><p>Now you can easily run these scripts from your Flutter project’s root directory:</p><pre>./scripts/build_runner.sh<br>./scripts/build_ipa.sh<br>./scripts/build_appbundle.sh</pre><h3>Why Should We Use Script Files?</h3><ol><li><strong>Time Saving:</strong> You run scripts with short names instead of typing long commands</li><li><strong>Standardization:</strong> The entire team uses the same commands, no inconsistency</li><li><strong>Documentation:</strong> Scripts show what build commands the project has</li><li><strong>Ease for New Developers:</strong> Someone new to the project can see what they can do by looking at the <strong>scripts/</strong> folder, even without knowing the details</li><li><strong>Flexibility:</strong> You can add additional parameters, conditions, or cleanup operations to scripts</li></ol><h3>Conclusion</h3><p>It is important that every Flutter/Dart project has project-specific scripts. This way, any developer looking at the project can perform production builds or other operations by running files in the <strong>scripts/</strong> directory, even without knowing the details.</p><p><strong>Follow me on:</strong><br>- 📝 [Github](<a href="https://github.com/demirdev">https://github.com/demirdev</a>)<br>- 📝 [Medium](<a href="https://medium.com/@demirdev">https://medium.com/@demirdev</a>)<br>- 📝 [X/Twitter](<a href="https://x.com/demirdevv">https://x.com/demirdevv</a>)</p><p>Happy coding! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc54968d5a69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Parsing static JSON at Runtime in Your Flutter Apps]]></title>
            <link>https://medium.com/@demirdev/stop-parsing-static-json-at-runtime-in-your-flutter-apps-b45bdbd52925?source=rss-e25bdba5b576------2</link>
            <guid isPermaLink="false">https://medium.com/p/b45bdbd52925</guid>
            <category><![CDATA[memory-management]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Mehmet Demir]]></dc:creator>
            <pubDate>Wed, 15 Oct 2025 16:38:50 GMT</pubDate>
            <atom:updated>2025-10-20T10:16:56.187Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TKHvRpWI8A1ZUjDsxnJkkQ.png" /></figure><p>Imagine this: You’re building a Flutter app that displays countries with their codes and flags. You bundle a `countries.json` file and parse it every time the app starts:</p><p>1. Read the JSON file from <strong>assets</strong><br>2. Parse it with `<strong>jsonDecode()</strong>`<br>3. Convert it to Dart objects using `<strong>fromJson()</strong>`</p><pre>// ❌ The inefficient way<br>Future&lt;List&lt;Country&gt;&gt; loadCountries() async {<br>  final jsonString = await rootBundle.loadString(&#39;assets/countries.json&#39;);<br>  final List&lt;dynamic&gt; jsonList = jsonDecode(jsonString);<br>  return jsonList.map((json) =&gt; Country.fromJson(json)).toList();<br>}</pre><p><strong>The problem?</strong> Parsing static JSON at runtime wastes CPU cycles, adds startup latency, and drains battery.</p><p><strong>The Solution:</strong> Development-Time Code Generation</p><p>Convert JSON to Dart code <strong>once</strong> during development — resulting in a `<strong>const</strong>` list compiled into your binary with zero runtime overhead!</p><h4>Step 1: Create Your Model</h4><p>Create a `<strong>Country</strong>` model with a const constructor and a `<strong>toDartString()</strong>` method:</p><pre>// country.dart<br>class Country {<br>  final String name;<br>  final String flag;<br>  final String code;<br>  final String dialCode;<br><br>  const Country({<br>    required this.name,<br>    required this.flag,<br>    required this.code,<br>    required this.dialCode,<br>  });<br><br>  factory Country.fromJson(Map&lt;String, dynamic&gt; json) {<br>    return Country(<br>      name: json[&#39;name&#39;],<br>      flag: json[&#39;flag&#39;],<br>      code: json[&#39;code&#39;],<br>      dialCode: json[&#39;dial_code&#39;],<br>    );<br>  }<br><br>  // This method generates Dart source code!<br>  String toDartString() {<br>    return &#39;&#39;&#39;<br>  Country(<br>    name: &quot;$name&quot;,<br>    flag: &quot;$flag&quot;,<br>    code: &quot;$code&quot;,<br>    dialCode: &quot;$dialCode&quot;,<br>  )&#39;&#39;&#39;;<br>  }<br>}</pre><p>The key here is the `<strong>toDartString()</strong>` method — it generates the Dart source code representation of the object.</p><h4>Step 2: Build Your Generator Script</h4><p>Create a simple Dart script that reads your JSON and outputs Dart code:</p><pre>// main.dart<br>import &#39;dart:convert&#39;;<br>import &#39;dart:io&#39;;<br>import &#39;country.dart&#39;;<br><br>void main() {<br>  // Read and parse the JSON<br>  final countriesAsMap = jsonDecode(<br>    File(&#39;countries.json&#39;).readAsStringSync()<br>  ) as List&lt;dynamic&gt;;<br>  <br>  // Generate Dart source code by mapping each JSON object to its Dart representation<br>  final countriesListAsDartString = &#39;const countries = ${&#39;&#39;&#39;<br>[<br>  ${countriesAsMap.map((country) =&gt; Country.fromJson(country).toDartString()).join(&#39;,\n&#39;)}<br>]<br>&#39;&#39;&#39;};&#39;;<br>  <br>  // Write it to a .dart file<br>  File(&#39;const_country_list.dart&#39;).writeAsStringSync(&#39;&#39;&#39;<br>import &#39;country.dart&#39;;<br><br>$countriesListAsDartString<br>&#39;&#39;&#39;);<br>}</pre><h4>Step 3: Run the Generator</h4><pre>dart run main.dart</pre><p>This generates a `<strong>const_country_list.dart</strong>` file:</p><pre>// const_country_list.dart (generated)<br>import &#39;country.dart&#39;;<br><br>const countries = [<br>  Country(<br>    name: &quot;Afghanistan&quot;,<br>    flag: &quot;🇦🇫&quot;,<br>    code: &quot;AF&quot;,<br>    dialCode: &quot;+93&quot;,<br>  ),<br>  Country(<br>    name: &quot;Åland Islands&quot;,<br>    flag: &quot;🇦🇽&quot;,<br>    code: &quot;AX&quot;,<br>    dialCode: &quot;+358&quot;,<br>  ),<br>  Country(<br>    name: &quot;Albania&quot;,<br>    flag: &quot;🇦🇱&quot;,<br>    code: &quot;AL&quot;,<br>    dialCode: &quot;+355&quot;,<br>  ),<br>  // ... rest of your countries<br>];</pre><h4>Step 4: Use It in Your App</h4><p>Now in your Flutter app, just import and use the const list directly:</p><pre>import &#39;const_country_list.dart&#39;;<br><br>// ✅ Zero runtime overhead!<br>Widget build(BuildContext context) {<br>  return ListView.builder(<br>    itemCount: countries.length,<br>    itemBuilder: (context, index) {<br>      final country = countries[index];<br>      return ListTile(<br>        leading: Text(country.flag, style: TextStyle(fontSize: 32)),<br>        title: Text(country.name),<br>        subtitle: Text(&#39;${country.code} ${country.dialCode}&#39;),<br>      );<br>    },<br>  );<br>}</pre><h3>Benefits of This Approach</h3><p>✅ <strong>Faster App Startup</strong> — No JSON parsing means your app launches faster</p><p>✅ <strong>Lower Memory Usage</strong> — Const objects are more memory-efficient</p><p>✅ <strong>No Asset Loading</strong> — No need to bundle JSON files or use `<strong>rootBundle.loadString()</strong>`</p><h3>When to Use This Pattern</h3><p>This approach works great for:</p><p>- Static reference data (countries, currencies, time zones, etc.)</p><p>- Lists that rarely change</p><p><strong>When NOT to use it:</strong></p><p>- Data that changes frequently</p><p>- User-generated content</p><p>- Data fetched from APIs</p><p>- Large datasets (&gt;10MB) that would bloat your app size</p><h3><strong>Conclusion</strong></h3><p>Move JSON parsing from runtime to development time. Eliminate unnecessary overhead. Ship faster, more efficient apps.</p><p>The code stays simple and maintainable. Get JSON convenience during development. Get const performance in production.</p><p>Next time you bundle static JSON, ask yourself: “<strong>Could this be a const list instead?</strong>”</p><p>— -</p><h4><a href="https://github.com/demirdev/articles/tree/main/01-json-to-dart-list">Running the Example (GitHub)</a></h4><pre># Clone only this article (sparse checkout)<br>git clone --filter=blob:none --sparse https://github.com/demirdev/articles<br>cd articles<br>git config core.sparseCheckout true<br>git sparse-checkout init<br>git sparse-checkout set 01-json-to-dart-list<br><br># Or download the folder directly from GitHub<br><br># Run the generator<br>cd 01-json-to-dart-list<br>dart run main.dart</pre><p><strong>The code on</strong> <a href="https://github.com/demirdev/articles/tree/main/01-json-to-dart-list"><strong>GitHub</strong></a>.</p><p><strong>Follow me on:<br></strong>- <a href="https://github.com/demirdev">Github</a><br>- <a href="https://www.linkedin.com/in/demirdev/">Linkedin</a><br>- <a href="https://x.com/demirdevv">X</a></p><p>Happy coding! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b45bdbd52925" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOLID Principles in Dart Programming Language: A Short Guide]]></title>
            <link>https://medium.com/@demirdev/understanding-solid-principles-in-dart-programming-language-a-comprehensive-guide-d95f67cd918a?source=rss-e25bdba5b576------2</link>
            <guid isPermaLink="false">https://medium.com/p/d95f67cd918a</guid>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[solid]]></category>
            <dc:creator><![CDATA[Mehmet Demir]]></dc:creator>
            <pubDate>Sun, 28 May 2023 11:08:02 GMT</pubDate>
            <atom:updated>2023-05-28T18:34:36.884Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>SOLID</strong> is a set of principles that guide software developers in writing <strong>clean</strong>, <strong>maintainable</strong>, and <strong>scalable code</strong>. These principles, when applied corretly, promote <strong>separation of concerns</strong>, <strong>flexibility</strong> and <strong>extensibility</strong>. In this article, we will explore how <strong>SOLID</strong> principles can be implemented in the <strong>Dart Programming Language,</strong> a long with examples of both <strong>bad</strong> and <strong>good</strong> <strong>code</strong>..</p><h3>SOLID Principles</h3><ol><li>Single Responsibility Principle (SPR)</li><li>Open/Closed Pricinciple (OCP)</li><li>Liskov Substitution Principle (LSP)</li><li>Interface Segregation Principle (ISP)</li><li>Dependency Inversion Principle (DIP)</li></ol><h3>1. Single Responsibility Principle (SPR):</h3><p>The <strong>SRP</strong> states that a class <strong>should have only one reason to change</strong>. It promotes <strong>encapsulating</strong> a class with a <strong>single responsibility</strong>, which <strong>enhances</strong> <strong>code</strong> <strong>reusability</strong> and <strong>maintainability</strong>. Let’s examine a bad and good code example to understand <strong>SRP</strong> better:</p><p>Bad code:</p><pre> class User {<br>  late String name;<br><br>  void login() {<br>    // Perform login functionality<br>  }<br><br>  void sendEmail() {<br>    // Send email functionality<br>  }<br><br>  void generateReport() {<br>    // Generate report functionality<br>  }<br>}</pre><p>Good code:</p><pre>class User {<br>  late String name;<br>}<br><br>class Authentication {<br>  void login() {<br>    // Perform login functionality<br>  }<br>  void logout() {<br>    // Perform logout functionality<br>  }<br>}<br><br>class EmailSender {<br>  void sendEmail() {<br>    // Send email functionality<br>  }<br>}<br><br>class ReportGenerator {<br>  void generateReport() {<br>    // Generate report functionality<br>  }<br>}</pre><p>In the good code example, each class has a <strong>single responsibility</strong>. The User class handles <strong>user-related functionality</strong>, the <strong>EmailSender</strong> class handles <strong>sending emails</strong>, and the <strong>ReportGenerator</strong> class handles <strong>generating reports</strong>. This <strong>separation</strong> allows for <strong>easier maintenance</strong> and <strong>reusability</strong>.</p><h3>2. Open/Closed Principle (OCP):</h3><p>The <strong>OCP</strong> states that <strong>classes</strong> should be <strong>open for extension but closed for modification</strong>. It promotes code that can be <strong>easily extended without modifiying existing code</strong>. Let’s consider an example:</p><p>Bad code:</p><pre>import &#39;circle.dart&#39;;<br>import &#39;rectangle.dart&#39;;<br><br>class AreaCalculator {<br>  double calculateArea(dynamic shape) {<br>    if (shape is Rectangle) {<br>      return shape.length * shape.width;<br>    } else if (shape is Circle) {<br>      return shape.radius * shape.radius * 3.14;<br>    }<br>    return 0;<br>  }<br>}<br><br>class Rectangle {<br>  double length;<br>  double width;<br>  Rectangle(this.length, this.width);<br>}<br><br>class Circle {<br>  double radius;<br>  Circle(this.radius);<br>}</pre><p>Good code:</p><pre>class AreaCalculator {<br><br>  double calculateArea(Shape shape) {<br>    return shape.calculateArea();<br>  }<br>}<br><br>abstract class Shape {<br>  double calculateArea();<br>}<br><br>class Rectangle implements Shape {<br>  double width;<br>  double height;<br><br>  Rectangle(this.width, this.height);<br>  @override<br>  double calculateArea() {<br>    return width * height;<br>  }<br>}<br><br>class Circle implements Shape {<br>  double radius;<br>  Circle(this.radius);<br><br>  @override<br>  double calculateArea() {<br>    return radius * radius * 3.14;<br>  }<br>}<br><br>void main(){<br>  final circle = Circle(5);<br>  final areaCalculator = AreaCalculator();<br>  print(areaCalculator.calculateArea(circle));<br>}</pre><p>In the good code example, we use the <strong>OCP</strong> by introducing an <strong>abstract</strong> <strong>Shape</strong> class that defines the <strong>calculateArea</strong> method. The <strong>Rectangle</strong> and <strong>Circle</strong> <strong>classes</strong> implement this method based on <strong>their specific logic</strong>. The <strong>AreaCalculator</strong> class takes in a <strong>Shape</strong> <strong>object</strong> and calculate the area <strong>without modifying the existing code</strong>.</p><h3>3. Liskov Substitution Principle (LSP)</h3><p>The <strong>LSP</strong> states that objects of a superclass should be <strong>replacable with objects of its subclasses without breaking the system</strong>. This principle ensure that <strong>inheritance is used correctly and consistently</strong>. Let’s examine an example:</p><p>Bad code:</p><pre>abstract class Bird {<br>  void fly();<br>}<br><br>class Ostrich extends Bird {<br>  @override<br>  void fly() {<br>    throw Exception(&#39;I can not fly&#39;);<br>  }<br>}</pre><p>Good code:</p><pre>abstract class Bird {<br>  void eat();<br>}<br><br>class Ostrich extends Bird {<br>  @override<br>  void eat() {<br>    // TODO: implement eat<br>  }<br>}<br><br>abstract class FlyingBird extends Bird {<br>  void fly();<br>}<br><br>class Duck implements FlyingBird {<br>  @override<br>  void eat() {<br>    // TODO: implement eat<br>  }<br><br>  @override<br>  void fly() {<br>    // TODO: implement fly<br>  }<br>}</pre><p>In the good code example, we have an <strong>abstract Bird </strong>class <strong>without a fly method</strong>. The <strong>Ostrict</strong> class <strong>correctly implements eat method</strong>. The Ostrict <strong>cannot fly</strong>. The <strong>Duck</strong> class implements <strong>fly method</strong> to perform the appropriate behavior. Most ducks can fly at 80 kilometers per hour!</p><h3>4. Interface Segregation Principle (ISP)</h3><p>The ISP states that clients should not be forced to depend on interfaces they do not use. It promotes smaller, cohesive interfaces instead of large, general-purpose interfaces. Let’s consider an example:</p><p>Bad code:</p><pre>class Printer {<br>  void print(Document document) {<br>    // Print document functionality<br>  }<br><br>  void scan(Document document) {<br>    // Scan document functionality<br>  }<br><br>  void fax(Document document) {<br>    // Fax document functionality<br>  }<br>}<br><br>class Document {} </pre><p>Good code:</p><pre>class Document {}<br><br>abstract class Printer {<br>  void print(Document document);<br>}<br><br>abstract class Scanner {<br>  void scan(Document document);<br>}<br><br>abstract class FaxMachine {<br>  void fax(Document document);<br>}<br><br>class AllInOnePrinter implements Printer, Scanner, FaxMachine {<br>  @override<br>  void fax(Document document) {<br>    // TODO: implement fax<br>  }<br><br>  @override<br>  void print(Document document) {<br>    // TODO: implement print<br>  }<br><br>  @override<br>  void scan(Document document) {<br>    // TODO: implement scan<br>  }<br>}</pre><p>In the good code example, we have separated the functionalities into smaller interfaces: Printer, Scanner, and FaxMachine. The AllInOnePrinter class implements all three interfaces and provides the necessary implementations.</p><h3>5. Dependency Inversion Principle (DIP)</h3><p>The DIP states that;</p><ol><li>High-level modules should not depend on low-level modules; both should depend on abstractions.</li><li>Abstractions should not depend on details. Details should depend on abstractions.</li></ol><p>DIP promotes loose coupling and easier maintenance. Let’s examine an example:</p><p>Bad code:</p><pre>class BackendDeveloper {<br>  void writeJava() {<br>    print(&#39;Java&#39;);<br>  }<br>}<br><br>class FrontendDeveloper {<br>  void writeJavascript() {<br>    print(&#39;Javascript&#39;);<br>  }<br>}<br><br>class Project {<br>  late BackendDeveloper backendDeveloper;<br>  late FrontendDeveloper frontendDeveloper;<br><br>  Project() {<br>    backendDeveloper = BackendDeveloper();<br>    frontendDeveloper = FrontendDeveloper();<br>  }<br><br>  void implement() {<br>    backendDeveloper.writeJava();<br>    frontendDeveloper.writeJavascript();<br>  }<br>}</pre><p>The <strong>high-level</strong> module ‘<strong>Project</strong>’ class is dependent on <strong>low-level</strong> modules <strong>BackendDeveloper</strong> and <strong>FrontendDeveloper</strong>. This <strong>violates</strong> the <strong>first rule</strong> of DIP. Additionally, the ‘<strong>Project</strong>’ class is <strong>directly</strong> <strong>dependent</strong> on <strong>implementation</strong> <strong>details</strong> such as the methods ‘<strong>writeJava()</strong>’ and ‘<strong>writeJavascript()</strong>’, this is <strong>violates</strong> the <strong>second</strong> <strong>rule</strong> of DIP.</p><p>Good code:</p><pre>abstract class Developer {<br>  void develop() {}<br>}<br><br>class Project {<br>  final List&lt;Developer&gt; developers;<br><br>  Project(this.developers);<br><br>  void implement() {<br>    for (final developer in developers) {<br>      developer.develop();<br>    }<br>  }<br>}<br><br>class BackendDeveloper implements Developer {<br>  @override<br>  void develop() {<br>    _writeJava();<br>  }<br><br>  void _writeJava() {}<br>}<br><br>class FrontendDeveloper implements Developer {<br>  @override<br>  void develop() {<br>    _writeJavaScript();<br>  }<br><br>  void _writeJavaScript() {}<br>}</pre><p>In the good code example, the Project class does not depend on lower level modules, but rather abstractions. Also low-level modules and their details depend on abstractions. Thus our code is more maintainable.</p><p>You can find source code on the my <a href="https://github.com/demirdev/dart_solid/tree/main/lib/solid">GitHub Repository</a>.</p><h3>References:</h3><ol><li><a href="https://chat.openai.com/">ChatGPT</a></li><li><a href="https://www.youtube.com/watch?v=jpjHLYVTo-M">Temiz Kod Yazmanın Prensipleri SOLID</a></li><li><a href="https://medium.com/@radheshyamsingh_83359/dependency-inversion-principle-solid-design-78214fe2b64b">https://medium.com/@radheshyamsingh_83359/dependency-inversion-principle-solid-design-78214fe2b64b</a></li><li><a href="https://medium.com/@radheshyamsingh_83359/liskov-substitution-principle-solid-design-f9d48500c260">https://medium.com/@radheshyamsingh_83359/liskov-substitution-principle-solid-design-f9d48500c260</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d95f67cd918a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Which Flutter Packages were used in Duolist]]></title>
            <link>https://medium.com/@demirdev/which-flutter-packages-were-used-in-duolist-c1c666e5b41b?source=rss-e25bdba5b576------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1c666e5b41b</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[lists]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[shopping]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Mehmet Demir]]></dc:creator>
            <pubDate>Wed, 19 Oct 2022 16:24:56 GMT</pubDate>
            <atom:updated>2022-10-19T18:16:09.735Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BoVf4PTrJ30PN1IyoUzSVA.png" /></figure><p><a href="https://apps.apple.com/en-US/app/duolist-shopping-list/id1642230812?platform=iphone"><strong>Duolist</strong></a> is an grocery shopping list mobile application written in Dart Language with Flutter. Duolist available on <a href="https://apps.apple.com/en-US/app/duolist-shopping-list/id1642230812?platform=iphone"><strong>AppStore</strong></a> and <a href="https://play.google.com/store/apps/details?id=com.duolist.app"><strong>Google Play</strong></a>.</p><h4>Features and used Dart/Flutter Packages or Plugins.</h4><h4>Speech to text</h4><ul><li>Enter product names with speech or keyboard. <br>- Used <a href="https://pub.dev/packages/speech_to_text"><strong>speech_to_text</strong></a> plugin<br>- Used <a href="https://pub.dev/packages/flutter_hooks"><strong>flutter_hooks</strong></a> for TextEditingControllers</li></ul><h4>Emojis</h4><ul><li>Duolist selects emoji for product automatically.<br>- Used translate product name from source language to english then <br>- Find emojis for this english product name. Used <a href="https://pub.dev/packages/emojis"><strong>emojis</strong></a> package on <strong>pub.dev</strong>.</li></ul><h4>Authentication</h4><ul><li>Duolist uses <a href="https://pub.dev/packages/firebase_auth"><strong>firebase_auth</strong></a><strong> </strong>for user authentication.</li><li>All users are first authenticated anonymously. If the user logs in later, their listing is not lost. The previous lists(account) are linked with the new user.<br>- <a href="https://firebase.google.com/docs/auth/flutter/anonymous-auth"><strong>Authenticate with Firebase Anonymously</strong></a><br>- <a href="https://firebase.google.com/docs/auth/flutter/account-linking"><strong>Link Multiple Auth Providers to an Account</strong></a></li><li>For Sign In with Apple, used <a href="https://pub.dev/packages/sign_in_with_apple"><strong>sign_in_with_apple</strong></a> package.</li><li>For Sign In with Google, used<strong> </strong><a href="https://pub.dev/packages/google_sign_in"><strong>google_sign_in</strong></a> package.</li><li>Sign in with e-mail and password, forgot password screens written by me.</li></ul><p><strong>Search Suggestions</strong></p><ul><li>Used <a href="https://www.meilisearch.com/"><strong>MeiliSearch</strong></a> for searching products suggestions.</li><li>I created a shopping list online and now there are over 300 products. I translated this list to other languages and created indexes for each language separately in my meilisearch service.</li><li>When user begins type in textfield, Duolist searches suggestions from my meilisearch service, from the relevant index whichever the language of the mobile device is. The user can also set suggestions from other languages by changing the settings.</li><li>Used <a href="https://pub.dev/packages/http"><strong>http</strong></a> to search products on meilisearch service.</li></ul><h4>Responsive UI</h4><ul><li>Used responsive values for widgets, used <a href="https://pub.dev/packages/flutter_screenutil"><strong>flutter_screenutil</strong></a><strong> </strong>package</li></ul><h4>State Management</h4><ul><li>For state management used <a href="https://pub.dev/packages/flutter_riverpod"><strong>flutter_riverpod</strong></a>, I like it.</li></ul><h4>Firestore</h4><ul><li>Used <a href="https://pub.dev/packages/cloud_firestore"><strong>cloud_firestore</strong></a> for lists store.</li><li>Used <a href="https://pub.dev/packages/paginate_firestore"><strong>paginate_firestore</strong></a> for pagination firestore data.</li></ul><h4>In app review</h4><ul><li>For in app review request and go to user to app store page used <a href="https://pub.dev/packages/in_app_review"><strong>in_app_review</strong></a> plugin.</li></ul><h4>Localization</h4><ul><li>Used flutter_localizations <a href="https://pub.dev/packages/intl"><strong>intl</strong></a> for app localization in <strong>97 language 🚀</strong>.</li><li>Used <a href="https://pub.dev/packages/arb_translator"><strong>arb_translator</strong></a> for translate app_en.arb file to other languages.</li></ul><h4>List View Widgets</h4><ul><li>Used <a href="https://pub.dev/packages/grouped_list"><strong>grouped_list</strong></a> for showing groups : “Shared lists with you” and “your lists”.</li><li>Used <a href="https://pub.dev/packages/flutter_swipe_action_cell"><strong>flutter_swipe_action_cell</strong></a> for swipe actions on shopping list item (delete, edit, check, uncheck).</li></ul><h4>duoitem models.</h4><ul><li>Used <a href="https://pub.dev/packages/uuid"><strong>uuid</strong></a> package for generate uuid for list items.</li></ul><h4>Local Settings</h4><ul><li>Used <a href="https://pub.dev/packages/shared_preferences"><strong>shared_preferences</strong></a> for storing a few settings.</li></ul><h4>In App Purchases</h4><ul><li>Used <a href="https://pub.dev/packages/adapty_flutter"><strong>adapty_flutter</strong></a> for iap and remote config for premium features. I can control free list count and free list item counts from remotelly with a adapty paywal custom payload.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rv87RsTwOtrQtOdc50jzng.png" /></figure><ul><li>Used <a href="https://pub.dev/packages/flutter_bloc"><strong>flutter_bloc</strong></a>, <a href="https://pub.dev/packages/hydrated_bloc"><strong>hydrated_bloc</strong></a> for <strong>IAP</strong> cubit. (I wrote an private package named “app_iap” for handling <strong>IAP</strong> in one package. I using this package to my other apps.)</li></ul><p><strong>Privacy Policy &amp; Terms of Conditions Links</strong></p><ul><li>Used <a href="https://pub.dev/packages/url_launcher"><strong>url_launcher</strong></a> for open Privacy Policy, Terms &amp; Conditions links.</li><li>Used <a href="https://pub.dev/packages/get_it"><strong>get_it</strong></a> for dependency management. I put AppIds instance to getit which contains appstore app id, privacy policy url, terms of conditions url. My another private package uses this AppIds for goto appstore and other pages. This package contains PrivacyPolicy and TermsOfConditions widgets.</li></ul><p>If you liked this article, you can share it to help developers and to support me and Duolist. You can support Duolist with 5 stars. Duolist has just been born and needs your support right now.<br><a href="https://apps.apple.com/en-US/app/duolist-shopping-list/id1642230812?platform=iphone"><strong>Duolist on AppStore</strong></a><br><a href="https://play.google.com/store/apps/details?id=com.duolist.app"><strong>Duolist on Google Play</strong></a></p><p>You can follow me on <a href="https://twitter.com/demirdevv"><strong>Twitter</strong></a> and <a href="https://github.com/demirdev"><strong>GitHub</strong></a>.</p><p>Best regards.</p><p>Mehmet Demir</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1c666e5b41b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accessing the Internet from Another Computer or Server]]></title>
            <link>https://medium.com/@demirdev/accessing-the-internet-from-another-computer-or-server-8862f67b7e7e?source=rss-e25bdba5b576------2</link>
            <guid isPermaLink="false">https://medium.com/p/8862f67b7e7e</guid>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[proxy]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[vpn]]></category>
            <dc:creator><![CDATA[Mehmet Demir]]></dc:creator>
            <pubDate>Tue, 18 Oct 2022 02:55:14 GMT</pubDate>
            <atom:updated>2022-10-18T02:55:14.511Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*YLgspkdMTnCmjsEvtF-Rnw.png" /><figcaption>Photo source: : <a href="https://proxyscrape.com/blog/the-difference-between-http-and-socks-proxy/">https://proxyscrape.com/blog/the-difference-between-http-and-socks-proxy/</a></figcaption></figure><p>There are many reasons to go online from a different <a href="https://en.wikipedia.org/wiki/IP_address">IP address</a>. The situation in this article is due to a terrible policy of <a href="https://play.google.com/store/apps">Google Play</a>.<br>When Google Play closes a developer account, it also closes all other Developer Accounts associated with it.</p><p>I worry about this policy when I need to use <a href="https://firebase.google.com/">Firebase</a> for freelance work (the client’s account can be closed because of me, or my account can be closed because of the client). I do Firebase and Google Play work remotely from the client’s computer.</p><p>If there is a server I have opened for the customer; Instead of making a remote connection to the customer’s computer with programs such as Anydesk, Teamviewer, Zoom; I use my own computer to go out to the internet from the server and do things that way, this way my work is more comfortable and faster.</p><h3>How is it done?</h3><p>We use the proxy feature of our internet browser and access the internet from the server with the SOCKS protocol.</p><p><strong>Step 1</strong><br>To create a SOCKS server/host, open Terminal on your own computer and run the following command:</p><pre>ssh -D 1227 -q -C -N -f user@server</pre><p><strong>Step: 2</strong><br>Open Firefox, type about:profiles in the address line and create a new profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5FMS2Z81WaniftaD3cNx2w.png" /></figure><p><strong>Step 3</strong><br>Open Firefox in this profile and enter the proxy settings in the settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*IeaA2MZEiThCBQcZQehnEg.png" /></figure><p><strong>Step 4</strong><br>Fill in the settings as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*lBodj7uvzv9Yvis51N7d-Q.png" /></figure><p>In this Firefox profile, you are now accessing the internet through this server. To check, you can enter the following in the address line.</p><p><a href="https://api.ipify.org/">https://api.ipify.org</a></p><p>If you found this article useful, you can share it so that it reaches more people. By applauding, you can motivate me to produce more such content.</p><p>You can follow me on <a href="https://twitter.com/demirdevv">Twitter</a>,<a href="https://github.com/demirdev"> Github</a>.</p><p>Thank you very much.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8862f67b7e7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Başka Bilgisayar veya Sunucudan İnternete Çıkmak]]></title>
            <link>https://medium.com/@demirdev/ba%C5%9Fka-bilgisayardan-i%CC%87nternete-%C3%A7%C4%B1kmak-549338d3fcc2?source=rss-e25bdba5b576------2</link>
            <guid isPermaLink="false">https://medium.com/p/549338d3fcc2</guid>
            <category><![CDATA[proxy]]></category>
            <category><![CDATA[anonymous-network]]></category>
            <category><![CDATA[anonymous]]></category>
            <category><![CDATA[proxy-server]]></category>
            <category><![CDATA[internet]]></category>
            <dc:creator><![CDATA[Mehmet Demir]]></dc:creator>
            <pubDate>Wed, 23 Feb 2022 10:25:02 GMT</pubDate>
            <atom:updated>2025-09-08T17:50:20.268Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*gfNaGRgXf3JoAlqPbFMsEw.png" /><figcaption>Fotoğrafın kaynağı: <a href="https://proxyscrape.com/blog/the-difference-between-http-and-socks-proxy/">https://proxyscrape.com/blog/the-difference-between-http-and-socks-proxy/</a></figcaption></figure><p>Farklı bir <a href="https://tr.wikipedia.org/wiki/IP_adresi">IP adresi</a>’den internete çıkmak için bir çok nedeniniz olabilir. Bu yazıya konu olan durum <a href="https://play.google.com/store/apps">Google Play</a>’in berbat bir politikasından kaynaklanıyor.</p><p>Google Play bir geliştirici hesabını kapattığında onun ile ilişkilendirdiği diğer tüm Geliştirici Hesaplarını da kapatmakta.</p><p>Freelance işlerde <a href="https://firebase.google.com/">Firebase</a> kullanmam gerektiğinde bu politikadan endişe ettiğimden (Müşterinin hesabı benden ötürü kapatılabilir, yada benim hesabım müşteriden ötürü kapatılabilir.) Firebase ve Google Play işlerini uzaktan bağlantı ile müşterinin bilgisayarından yapıyorum.</p><p>Eğer müşteri için açtığım bir sunucu var ise; Müşterinin bilgisayarına, Anydesk, Teamviewer, Zoom gibi programlarla uzak bağlantı kurmak yerine; kendi bilgisayarımı kullanarak sunucudan internete çıkıp işleri öyle yapıyorum, bu şekilde işim daha rahat ve daha hızlı oluyor.</p><h3>Nasıl Yapılıyor?</h3><p>İnternet tarayıcımızın proxy özelliğini kullanıp SOCKS protokolü ile sunucudan internete çıkıyoruz.</p><p><strong>Adım: 1</strong><br>SOCKS sunucusu/host oluşturmak için kendi bilgisayarınızda Terminali açıp şu komutu çalıştırın:</p><pre>ssh -D 1227 -q -C -N -f kullanici@server</pre><p><strong>Adım: 2</strong><br>Firefox’u açıp adres satırına; <strong>about:profiles</strong> yazıp yeni bir profil oluşturun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0RBEEy7ZX2oE6nSxgOQaeA.png" /></figure><p><strong>Adım: 3</strong><br>Firefox’u bu profilde açıp, ayarlardan proxy ayarlarına girin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*yj-z9y2xk5Oe24w_haUrJA.png" /></figure><p><strong>Adım: 4</strong><br>Ayarları aşağıdaki gibi doldurun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*WT2cTKLL5seQCQhIH7iAdA.png" /></figure><p>Artık bu Firefox profilinde internete söz konusu sunucu üzerinden çıkıyorsunuz. Kontrol etmek için adres satırına şunu girebilirsiniz.</p><p><a href="https://api.ipify.org/"><strong>https://api.ipify.org</strong></a></p><p><em>Bu yazıyı yararlı bulduysanız paylaşarak daha fazla kişiye ulaşmasını sağlayabilirsiniz. Alkışlayarak daha fazla bu tür içerikler üretmem için beni motive edebilirsiniz. Çok teşekkürler.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=549338d3fcc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A trick for search by text in Firestore]]></title>
            <link>https://medium.com/@demirdev/a-trick-for-search-by-text-in-firestore-96be6371a70d?source=rss-e25bdba5b576------2</link>
            <guid isPermaLink="false">https://medium.com/p/96be6371a70d</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[firestore]]></category>
            <category><![CDATA[tricks]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Mehmet Demir]]></dc:creator>
            <pubDate>Wed, 26 Jan 2022 13:32:23 GMT</pubDate>
            <atom:updated>2022-02-02T10:22:42.498Z</atom:updated>
            <content:encoded><![CDATA[<p>I have a client list in the collection on Firestore. I want to search for clients by name or surname starting. In the Firestore we can’t search text in document fields by given text.</p><p>In the <a href="https://firebase.google.com/docs/firestore/solutions/search">Full-text search documentation</a> we must use <a href="https://www.elastic.co/app-search/">Elastic</a>, <a href="https://www.algolia.com/">Algolia</a>, or <a href="https://typesense.org/">Typesense</a>.</p><p>How can we resolve the basic search by Firestore?</p><p>I write a method to convert client name and surname to an array of characters and save them to a document field named query_name.</p><p>For example:<br>If first name and surname is ‘Mehmet Demir’ then the query_name array elements will be :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*benLUZXX6610ZqYfFVVkMQ.png" /></figure><p>App users can search by writing characters (at least 3) of the name or surname of client to find.</p><p>Client document in Firestore:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*gLEtqX2Lu1s8abMXP2rTjQ.png" /></figure><p>Firebase Query:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMufhJr1-au9QMLdTTaelw.png" /></figure><p>Converting name to list of strings that we can query with arrayContains:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KhKOiNBeJPaKczkZjdQdPA.png" /></figure><p>Populating value of query_name for the document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5twPGOIJJ6nmC-JxfKwKrg.png" /></figure><p>All codes at <a href="https://gist.github.com/demirdev/f710b729e5c25676e98585cee71c50da">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96be6371a70d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>