<?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 Çağlar YILMAZ on Medium]]></title>
        <description><![CDATA[Stories by Çağlar YILMAZ on Medium]]></description>
        <link>https://medium.com/@caglar.ylmz?source=rss-736723bf5fed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sHbfdoQFePKYqpIYnuDHaQ.jpeg</url>
            <title>Stories by Çağlar YILMAZ on Medium</title>
            <link>https://medium.com/@caglar.ylmz?source=rss-736723bf5fed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 14:20:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@caglar.ylmz/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[Chrome Extension with Flutter]]></title>
            <link>https://medium.com/@caglar.ylmz/chrome-extension-with-flutter-c090c981b0f8?source=rss-736723bf5fed------2</link>
            <guid isPermaLink="false">https://medium.com/p/c090c981b0f8</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-web]]></category>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <dc:creator><![CDATA[Çağlar YILMAZ]]></dc:creator>
            <pubDate>Sat, 14 May 2022 20:47:18 GMT</pubDate>
            <atom:updated>2022-05-14T20:47:18.270Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone. Today we create chrome extension with flutter.</p><p>We will not need any extra packages to create chrome extension with flutter.</p><p>Here I am using the latest version of flutter 3.0.0 I think it will work with older versions as well. But I didn’t try.</p><p><strong>Let’s starting</strong></p><ul><li>First of all we created a new flutter project. I name it my_extension_for_chrome. You can give any name you want</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*HKXh_INoBKgI4KL1PPZ_jQ.png" /></figure><ul><li>Now we choose chrome from the devices menu in the lower right. So we can build the app for the web.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*fHYU-K4oRm9Z86hbL9AuRg.png" /></figure><ul><li>We run the application by selecting Run in main.dart. So we are creating the web folder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XBXh6JvKXxZofPRzWMUKYw.png" /></figure><ul><li>Let’s select the manifest.json file under the web folder. Let’s delete its content completely and edit it as follows</li></ul><figure><img alt="manifest.json" src="https://cdn-images-1.medium.com/max/1024/1*wqqzlnaGHJiDJHdJde0pUw.png" /><figcaption>manifest.json</figcaption></figure><ul><li>Now we select the index.html file under the web folder. We delete everything inside the &lt;body&gt;&lt;/body&gt; tag and replace it :<br> <strong>&lt;script type=”application/javascript” src=”main.dart.js”&gt;&lt;/script&gt;</strong></li><li>Here we can optionally specify height and width with the “style” attribute inside the &lt;html&gt; tag.<br>index.html should be like this:</li></ul><figure><img alt="index.html" src="https://cdn-images-1.medium.com/max/1024/1*sOk0XDUh8N6ArSMTfT1w9A.png" /><figcaption>index.html</figcaption></figure><ul><li>Now our application has become executable as an extension. Now what we need to know is flutter’s default renderer for web build is canvas-kit. In order to run our application as a Chrome extension, we must render our build in html type.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*CUxhf337PH516bUhN80yJQ.png" /></figure><ul><li>Thus, our web output is created under the build folder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*DG6N0nvMLRjXEormxrP3CQ.png" /></figure><ul><li>Now open <strong>chrome </strong>and select <strong>manage extensions</strong> from the <strong>extensions</strong> tab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*Jr8HvD32HfzY0M0E4J_lXQ.png" /></figure><ul><li>Select the <strong>Upload Packaged Item</strong> option and select the created web folder. (<strong> Developer Mode</strong> in the right corner must be active)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZYq32XAT52aKl9zVCpU4Q.png" /></figure><ul><li>Now our application is running as a chrome extension.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_Fy9-5_FD6DRYW6YgfUqw.png" /></figure><p>Thanks for reading…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c090c981b0f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter/Dart — Neden const kullanmalıyız]]></title>
            <link>https://medium.com/@caglar.ylmz/flutter-dart-neden-const-kullanmal%C4%B1y%C4%B1z-c73d91c6256d?source=rss-736723bf5fed------2</link>
            <guid isPermaLink="false">https://medium.com/p/c73d91c6256d</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dartlang]]></category>
            <dc:creator><![CDATA[Çağlar YILMAZ]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 07:37:41 GMT</pubDate>
            <atom:updated>2022-02-25T07:37:41.232Z</atom:updated>
            <content:encoded><![CDATA[<h3>Flutter/Dart — Neden const kullanmalıyız</h3><p>Flutter/Dart’da uygulama yazarken bizi const kullanmaya zorlayan linting kuralları ile karşılaşıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*weDmYd9FyVKVFhPHjeYhgg.png" /></figure><p>Bir çok kullanıcı bu uyarıları kapatmanın yollarını arıyor. Bunları yazının sonlarına doğru aktaracağım. Fakat gerçekten de bu uyarıları kapatmak doğru bir çözüm mü? Flutter/Dart neden bizi <strong>const </strong>kullanmaya zorluyor. Bunun altında yatan sebep nedir?</p><p><strong>const </strong>anahtar sözcüğü, değişkenin değeri <em>derleme zamanında</em> bilindiğinde ve asla değişmeyeceğinde kullanılır. Yani derleyici bu değişkende hangi değerin saklanacağını önceden bilir.</p><pre>// name ve age değişkenlerinin değerleri derleme zamanında(compile // time) atanacak ve bir daha değişmeyecek</pre><pre>const String name = “Çağlar YILMAZ”;<br>const int age = 38;</pre><p>Flutter/Dart değişkeni <strong>const </strong>ile bildirdiğinizde türünü otomatik olarak tanır.</p><pre>const name = “Çağlar YILMAZ”;<br>const age = 38;</pre><p><strong>const </strong>kullanarak bir değişken oluşturduğumuzda derleyiciye şunu söylemiş oluruz: <em>“bu değişken, bu kodun ömrü boyunca asla değişmeyecektir, bu yüzden sadece bir kopyasını oluştur ve nerede kullanılırsa, daha önce oluşturdun kopyaya başvur ve yeni bir tane oluşturma.”</em></p><p>Ayrıca <strong>const </strong>sadece değişkenler için değil <strong>sınıflar </strong>için de kullanılır.</p><p>Bu yüzden <strong>const</strong>, <strong>sınıflar </strong>ve onların <strong>yapıcıları </strong>söz konusu olduğunda önemi artar. Bildiğimiz gibi Flutter da her şey widget’dir ve her widget’i bir sınıf olarak tanımlayabiliriz.</p><p>Şunu hayal edelim: hiç bir zaman değişmeyecek ve uygulamanın her sayfasında kullanılacak belirlenmiş boyutlarda bir kırımızı kareye ihtiyacımız olsun.</p><pre>class RedSquare extends StatelessWidget {<br> final double size;</pre><pre>RedSquare({Key? key, required this.size}) : super(key: key);</pre><pre>Widget build(BuildContext context) {<br>   return Container(<br>     height: size,<br>     width: size,<br>     color: Colors.red,<br>   );<br> }<br>}</pre><p>const kullanmadığımız zaman bu widget’ı her oluşturduğumuzda memory’de bir yer ayrılacaktır.</p><pre>return Scaffold(<br>      appBar: AppBar(<br>        title: Text(&quot;Home&quot;),<br>      ),<br>      body: Center(<br>        child: RedSquare(size: 50),<br>      ),<br>    );<br>  }</pre><p>Uygulama boyunca 50 defa kullanmış olsanız, 50 farklı obje yaratılır ve bellek israfı oluşur</p><p>Bir <strong>kurucu</strong>(constructor) const ile bildirildiğinde o widget’ın uygulama boyunca bir daha değişmeyeceği bildirildiğinden, derleme zamanında bir defa oluşturulur ve kullanıldığı tüm yerlere referans verilir.</p><pre>class RedSquare extends StatelessWidget {<br> final double size;</pre><pre><strong>const </strong>RedSquare({Key? key, required this.size}) : super(key: key);</pre><pre>Widget build(BuildContext context) {<br>   return Container(<br>     height: size,<br>     width: size,<br>     color: Colors.red,<br>   );<br> }<br>}</pre><pre>return Scaffold(<br>      appBar: AppBar(<br>        title: Text(&quot;Home&quot;),<br>      ),<br>      body: Center(<br>        child: <strong>const </strong>RedSquare(size: 50),<br>      ),<br>    );<br>  }</pre><p>Eğer yapıcısı <strong>const </strong>ile tanımlanan bir widget’a eşitlik kontrolü yaparsanız <strong>true </strong>alırsınız. Çünkü aynı nesneyi işaret ederler</p><pre>var x = RedSquare(size: 20);<br>var y = RedSquare(size: 20);<br>x == y ? print(&quot;true&quot;) : print(&quot;false&quot;);<br>// true döner</pre><p>Bir <strong>const </strong>yapıcı kullanıyorsak, sınıftaki alanların asla değişmediğinden emin olmak gerekir. Bu nedenle tüm alanları <strong>final </strong>anahtar kelimesiyle tanımlamamız gerekir, aksi takdirde bir hata alırız.</p><p>Const widget’ların tek önemi hafızadan tasarruf sağlaması değildir. Bir nesne sabit olarak işaretlendiğinden, flutter, rebuild durumunda, “değişmemesi gerektiği” için o nesneyi yeniden oluşturmanın bir anlamı olmadığını bilir. Bu, bir nesne oluşturulduğunda, uygulamanın kullanım ömrü boyunca aynı kalacağı için harika bir performans artışı sağlar.</p><p>Şimdi bu performans artışından bile bile vazgeçmek istiyorsanız flutter’dan uyarıları almamanız için yapmanız gereken, sadece analysis_options.yaml dosyasında linter=&gt; rules’a kuralları tanımlarız.</p><pre><strong><em>analysis_options.yaml</em></strong></pre><pre>include: package:flutter_lints/flutter.yaml</pre><pre>linter:  <br>  rules:<br>    prefer_const_constructors:false</pre><p>Zaman ayırdığınız için teşekkür ederim. Umarım faydalı olmuştur…</p><p><a href="https://medium.com/@kefeh"><em>https://medium.com/@kefeh</em></a><em> ‘den alıntılanmıştır.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c73d91c6256d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>