<?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 Ömer Günaydın on Medium]]></title>
        <description><![CDATA[Stories by Ömer Günaydın on Medium]]></description>
        <link>https://medium.com/@omer28gunaydin?source=rss-de26702208fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*o9iELNTfXwW380tX0TsxvA.png</url>
            <title>Stories by Ömer Günaydın on Medium</title>
            <link>https://medium.com/@omer28gunaydin?source=rss-de26702208fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 23:39:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@omer28gunaydin/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[Implementing Ads to Flutter App]]></title>
            <link>https://medium.com/@omer28gunaydin/implementing-ads-to-flutter-app-2d430c7e100?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d430c7e100</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[admob]]></category>
            <category><![CDATA[flutter-admob]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter-google-ad]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 07:02:28 GMT</pubDate>
            <atom:updated>2023-01-22T07:02:28.438Z</atom:updated>
            <content:encoded><![CDATA[<p>A tutorial about implementing ads to flutter app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*8j9DxIt6pPHM7lbaIsr13Q.png" /></figure><p>This tutorial about adding a banner, interstitial, and a rewarded ad to your flutter app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*lZlXgbL6FYzl34CAZbrn4A.gif" /></figure><p>First you have to add google_mobile_ads package to your pubspec.yaml file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*NW0ANanDl0sEl5GR-cdieg.png" /></figure><h4>Android Settings</h4><p>Open the android/app/src/main/AndroidManifest.xml file.</p><p>Add your AdMob app ID by adding a &lt;meta-data&gt; tag with the name com.google.android.gms.ads.APPLICATION_ID. For example, if your AdMob app ID is ca-app-pub-3940256099942544~3347511713, then you need to add the following lines to the AndroidManifest.xml file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*-dw5GFSlMGVuROB-i1itVw.png" /></figure><h4>Ios Settings</h4><p>Open the ios/Runner/Info.plist file.</p><p>Add a GADApplicationIdentifier key with the string value of your AdMob app ID. For example, if your AdMob app ID is ca-app-pub-3940256099942544~1458002511, then you need to add the following lines to the Info.plist file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*gQGgQ47yBBZ2AV8ds6JBgw.png" /></figure><p>Add this 2 lines in main( )function for initialize.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*MNcnTzybm34w7P92tfnOEQ.png" /></figure><p>Create a new file named ad_helper.dart under the lib directory. Then, implement the AdHelper class, which provides an AdMob app ID and ad unit IDs for Android and iOS.</p><p><strong><em>All unitId’s and appId are Google’s Test Ids.</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4dfb871c0106c416a55e740104102500/href">https://medium.com/media/4dfb871c0106c416a55e740104102500/href</a></iframe><p>Now we are ready for adding ads.</p><h4>Adding Banner Ads</h4><p>Add <em>BannerAd _bannerAd;</em></p><p>In the <em>initstate( )</em> method, create and load a <em>Banner Ad</em> for the 320x50 banner (Adsize.banner).</p><p>Add your <em>AdWidget(ad:_bannerAd!) </em>to bottomNavigationBar to display your banner ad when available.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b44fdaf0052179f086668796251f150/href">https://medium.com/media/7b44fdaf0052179f086668796251f150/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*gmkdyk7TXWHCEoOgXou4fg.png" /></figure><h4>Adding Interstitial Ads</h4><p>Add <em>InterstitialAd? _interstitialAd;</em></p><p>Write <em>_loadInterstitialAd( )</em> and <em>_showInterstitialAd( )</em> function.</p><p>In the <em>initstate( )</em> method, call <em>_loadInterstitialAd( ) </em>function.</p><p>After that <em>_showInterstitialAd( )</em> function from a button.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4712c5c9ff2f81b03cb70b344ad29e2/href">https://medium.com/media/d4712c5c9ff2f81b03cb70b344ad29e2/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*goZZntej_JwJvWsIng0mRw.png" /></figure><h4>Adding Rewarded Ads</h4><p>Add <em>RewardedAd? _rewardedAd;</em></p><p>Write <em>_loadRewardedAd( )</em> and <em>_showRewardedAd( )</em> function.</p><p>In the <em>initstate( )</em> method, call<em> _loadRewardedAd( )</em> function.</p><p>After that <em>_showRewardedAd( )</em> function from a button and a text to show rewarded count.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce8fdd12faa9311e99d2a77c80bd1464/href">https://medium.com/media/ce8fdd12faa9311e99d2a77c80bd1464/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z0lUtRRtL0178g4xwl2tww.png" /></figure><h4>The Final code all Ads included:</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4cbf701a4e8734955bcfbcbe698ac92b/href">https://medium.com/media/4cbf701a4e8734955bcfbcbe698ac92b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*0MZ2ZdvOANIYsClGcmXyfA.gif" /></figure><h3>That’s all for this article.</h3><blockquote><em>Subscribe for upcoming posts. Thanks for reading, and have a wonderful day!</em></blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d430c7e100" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Slidable Package for ListViews]]></title>
            <link>https://medium.com/@omer28gunaydin/flutter-slidable-package-for-listviews-d44ab1f6ad84?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d44ab1f6ad84</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[slidable]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-slidable-package]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Sun, 15 Jan 2023 07:01:52 GMT</pubDate>
            <atom:updated>2023-01-15T07:01:52.960Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple tutorial about using Flutter Slidable Package for ListViews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*GZI37ig76yezfCkqSxA_lA.png" /></figure><p>First we have to design a list for list users.</p><p>For this, create a user model. Then create a userList with fake data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c14d9afa63b6e8d682b8289719d87bf4/href">https://medium.com/media/c14d9afa63b6e8d682b8289719d87bf4/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cdee89de24c28f313403521c91a132d4/href">https://medium.com/media/cdee89de24c28f313403521c91a132d4/href</a></iframe><p>Let’s show users in ListView first.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a51cf445f5762fe3904b43be037ba90/href">https://medium.com/media/9a51cf445f5762fe3904b43be037ba90/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*cSY3OESpRyMNcLTrfdXJhQ.png" /></figure><p>Let’s talk about main subject.</p><h3>What’s flutter_slidable package?</h3><p>A Flutter implementation of slidable list item with directional slide actions that can be dismissed.</p><h3>Features</h3><ul><li>Accepts start (left/top) and end (right/bottom) action panes.</li><li>Can be dismissed.</li><li>4 built-in action panes.</li><li>2 built-in slide action widgets.</li><li>1 built-in dismiss animation.</li><li>You can easily create custom layouts and animations.</li><li>You can use a builder to create your slide actions if you want special effects during animation.</li><li>Closes when a slide action has been tapped (overridable).</li><li>Closes when the nearest Scrollable starts to scroll (overridable).</li><li>Option to disable the slide effect easily.</li></ul><p>Add flutter_slidable: ^2.0.0 package to your pubspec.yaml file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*8wI3C3VLvlTcgCtfNDAMKQ.png" /></figure><p>Now let’s wrap our ListTile with slideable. And add startActionPane: property with motion and children.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*El2r1AzpNb5OJeeuNB0psg.png" /></figure><p>Any ActionPane has a motion parameter which allow you to define how the pane animates when the user drag the Slidable.</p><h4>Behind Motion</h4><p>The actions appear as if they where behind the Slidable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*z1sb_exyn9VIdWAGhfIYvA.gif" /></figure><h4>Drawer Motion</h4><p>Animate the actions as if they were drawers, when the Slidable is moving:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*nirigRDVCyqxdNCsXAaMlQ.gif" /></figure><h4>Scroll Motion</h4><p>The actions follow the Slidable while it&#39;s moving:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*uZc78ElgkM1mktG2PCknzg.gif" /></figure><h4>Stretch Motion</h4><p>Animate the actions as if they were streched while the Slidable is moving:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*yHYShiDkPCyONLVa8kqR0A.gif" /></figure><p>Let’s add a SlidableAction in StartActionPane’s children.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*mvrlxdk3XD_MG1Pu2AciEA.png" /></figure><p>Now we have a list item with slidable action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*t_THYmcCc0PIoZuLcyNxZA.png" /></figure><p>Add one more Slidable action to see the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*HRQkQCsxQ0vLFk1vfTUf8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*hHraUj_bPRTWT7DWXuZz6A.png" /></figure><p>If you want to add an action by pulling from the right side, you should use endActionPane. Let’s add a SlidableAction to endActionPane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*3F-ztar6xFaW9ODFO5Q52w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*S_fkHE3-YI6n6vvH8RbZ8w.png" /></figure><h4>Final Code :</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ea6946ff28705b54c928037236d6b40/href">https://medium.com/media/6ea6946ff28705b54c928037236d6b40/href</a></iframe><h4><strong>Final Result :</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*vhR9iSJ7dNlM3tvM0-4QmQ.png" /></figure><h3>That’s all for this article.</h3><blockquote><em>Subscribe for upcoming posts. Thanks for reading, and have a wonderful day!</em></blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d44ab1f6ad84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter ClipPath for Bezier Curves]]></title>
            <link>https://medium.com/@omer28gunaydin/flutter-clippath-for-bezier-curves-2bd9139bda4b?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bd9139bda4b</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[bezier-curves]]></category>
            <category><![CDATA[clipping-path]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Sun, 08 Jan 2023 07:01:50 GMT</pubDate>
            <atom:updated>2023-01-08T07:01:50.375Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple tutorial about using ClipPath Widget for Bezier Curves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*WlSBFTOftlk6iRW68SEA-w.png" /></figure><p><strong>Bezier curves</strong> are a class of parametric curves commonly used in computer graphics. Applications include everything from vector illustrations to animation eases to the characters in the font you’re reading right now.</p><p>There are different types of Bezier curve, each based on its own polynomial function. These classifications of curve are known as <em>orders</em>. The most commonly used orders of curve are <strong><em>quadratic curves</em></strong> and <strong><em>cubic curves.</em></strong></p><p>Let’s begin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*9HWqEmtbczJCsZ5FPHKX3g.gif" /></figure><p>First, let’s use a container to shape it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*jE7DTdzoLk31iiE2fGZl0g.png" /></figure><p>Around the widget that you want to clip wrap a ClipPath widget. Then define clipper: with a seperate class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*qfXhBCfPUBIdm4OIeP039A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*rbSeHpqjRfIJPTANWMceDw.png" /></figure><p>The class has to be extend a CustomClipper&lt;Path&gt;. And overrides 2 methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*PwjzIcp1LV2T-WUNvCerCQ.png" /></figure><p>The getClip( ) method returns a description of the clip given that the render object being clipped is of the given size.First, let’s draw a rectangle. And just write return false; in shouldReClip method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*kQzCkpViGOUYv7BAaw9WnA.png" /></figure><p>The container will be like this. We will write the necessary code to place the 3rd point shortly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*aL-jztH8w13DeDc8ETKKxQ.png" /></figure><p>Next we replace the straight line (2 to 4) by a curve. We need to add a control point. The x coordinate is at %50 of width, and y coordinate is at 100 distance from the bottom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*qvbI9cJ-aUslSd-pZA6NoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*dWi6AQO5RqQXNiIF_SO99Q.png" /></figure><p>The final code :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/489d1a34ae14b8b0d0b27fc13a85620b/href">https://medium.com/media/489d1a34ae14b8b0d0b27fc13a85620b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*ByjZ-cBuldPwQnSxyLB5iA.gif" /></figure><h3>That’s all for this article.</h3><blockquote><em>Subscribe for upcoming posts. Thanks for reading, and have a wonderful day!</em></blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bd9139bda4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter SliverAppBar Widget]]></title>
            <link>https://medium.com/@omer28gunaydin/flutter-sliverappbar-widget-fb5f4f30cf62?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb5f4f30cf62</guid>
            <category><![CDATA[slivers]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[sliverappbar]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Sun, 01 Jan 2023 07:02:42 GMT</pubDate>
            <atom:updated>2023-01-01T07:02:42.895Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple tutorial about using SliverAppBar Widget with ListViews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*aaXBJNjFo25zmJaR-CYjBg.png" /></figure><p>Sliverappbars are typically used as the first child of a CustomScrollView or NestedScrollView, which lets the app bar integrate with the scroll view so that it can vary in height according to the scroll offset or float above the other content in the scroll view.</p><p>Let’s begin…</p><p>Make an appbar and a listview first that we will change it later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*eyKQiKCd-mIXscMhu7rc2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*mzMZxsFXrB56arBZ7ZLTLA.png" /></figure><p>Wrap this appbar and body with NestedScrollView. Then replace AppBar with SliverAppBar.</p><p>Set expandedHeight:200 and wrap title with flexibleSpace widget.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*xh5qsHjCy5vnKiinC8DEdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*rkcDzu3bbdsrFXSWTt9ASQ.png" /></figure><p>If you scroll up title position is animated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*rA20BrTTtPmiEIhJXtAdMw.gif" /></figure><p>Optionally you can set a background image for the flexible space of your app bar.</p><blockquote>background: Image.network(‘https://images.unsplash.com/………’, <br>fit: BoxFit.cover,),</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*dI1tj1DZu1uVBmczKlvC9A.png" /></figure><p>By default you have to always scroll all the way up to display again the app bar simply set the <strong>floating</strong> property to<strong> true</strong> in your app bar with this <strong>as soon as you scroll up towards the app bar</strong> the app bar shows up again.</p><p>Also you can <strong>scroll every single pixel</strong> of your app bar. If you want to change it simply set the <strong>snap</strong> flag to <strong>true</strong>. As a result if you scroll up then the entire app bar will slide completely out of view and if we scroll down thenthe entire app will slide into view at once.</p><p>Finally set the <strong>pinned</strong> flag to <strong>true</strong> so that if you scroll up then the<strong> flexible space disappears and the app bar stays pinned</strong> and if you scroll again down then both of them appear again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*SP7jlLqOJFunytMBow08xA.gif" /></figure><h4>The final code :</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46e234706931e18996e6b491ea905951/href">https://medium.com/media/46e234706931e18996e6b491ea905951/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*gXtDL92sv4GEAIsydIhyYg.gif" /></figure><h3>That’s all for this article.</h3><blockquote><em>Subscribe for upcoming posts. Thanks for reading, and have a wonderful day!</em></blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb5f4f30cf62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Flutter Native Splash Screen]]></title>
            <link>https://medium.com/@omer28gunaydin/implementing-flutter-native-splash-screen-bd82b1b3e314?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd82b1b3e314</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter-splash-screen]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[splash-screen]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Sat, 24 Dec 2022 12:10:39 GMT</pubDate>
            <atom:updated>2022-12-24T12:10:39.165Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple tutorial about using flutter_native_splash package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*bOf04BAZMiYdNisV5VrJrg.png" /></figure><p>Splash screens provide a simple initial experience while your mobile app loads. They set the stage for your application, while allowing time for the app engine to load and your app to initialize. This guide teaches you how to use splash screens appropriately on flutter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*mhQ_1fg0QmhLVmHwVsRLrg.gif" /></figure><p>In your<strong> pubspec.yaml</strong> file go to the dev_dependencies. And add <strong>flutter_native_splash </strong>package here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*-stH6UOnEe4cN_fT2VbYDA.png" /></figure><p>Then define the image should be displayed as your splash screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*0tjkxG0THZPs9-GLTgJeFw.png" /></figure><p><strong>Add</strong> your <strong>splash.png</strong> image file to your <strong>assets/ folder.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*fGBXNsSpLfoNGDuZAMasnA.png" /></figure><p>Also set the <strong>background color</strong> of your splash screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*Y_WXNQ1pnCqeUAQvxJVA-g.png" /></figure><p><strong>Save</strong> the <strong>pubspec. yaml</strong> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*uXbw3YMglfoGCO1uk0yXjw.png" /><figcaption>pubspec.yaml file before run commands</figcaption></figure><p>To generate your Splash Screen, you have to run the following commands in order.</p><ol><li><strong>flutter clean</strong></li><li><strong>flutter pub get</strong></li><li><strong>flutter pub run flutter_native_splash:create</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*Nm8_zyJP8iKIvyC8tEM21A.png" /></figure><p>After some time it has generated the splash screens for android, ios and web. And now that the splash screen are generated you can run your flutter app again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*AKAWcThADx9P1INadjtCDA.png" /></figure><p>Alternatively to a background color for your splash screen you can also define a background image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*lyIUQVxfT8Z_21-F0wvisA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*-LHEvjyXIXJCGa3-noB06g.png" /></figure><p>In case you load some resources before running flutter app. By coding an init method for this, you can remove the splash screen with the FlutterNativeSplash.remove( ) command when this process is finished.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*e8l6LVyo6GPqkNGagL0msA.png" /></figure><p><strong>Extra : </strong>You need to write a separate code for android 12 version. In addition, you can turn off the platform you do not want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*BRh0zNmCgfOfgTuzvAQNng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*MotRl7bwt3-ba3UPaKOzWg.gif" /></figure><h3>That’s all for this article.</h3><blockquote><em>Subscribe for upcoming posts. Thanks for reading, and have a wonderful day!</em></blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd82b1b3e314" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Null Safety with Examples]]></title>
            <link>https://medium.com/@omer28gunaydin/flutter-null-safety-with-examples-922e85106b76?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/922e85106b76</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[null-safety]]></category>
            <category><![CDATA[flutter-null-safety]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 08:37:51 GMT</pubDate>
            <atom:updated>2022-09-17T08:37:51.976Z</atom:updated>
            <content:encoded><![CDATA[<p>Easy to learn null safety with examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*uGLwON3M6Xu8oKl3Zt8KOg.png" /></figure><h3><strong>Null Aware Operators</strong></h3><p>? , ?? , ??= , …? → These operators are used on variables that could have null values.</p><h3>?</h3><p>If a variable can be potentially null then for accessing the properties and methods of a variable you need to add a question mark in front of the dot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*7xGAkG315onddISxn6qdxg.png" /></figure><p>varA with a value will execute the properties and methods and return the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*esmhd2clp2Gb9cJuCZpz7A.png" /></figure><p>varA with a null execute the properties and methods and return null.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*2oRrfx56c60_O1Ph1zBHoQ.png" /></figure><h3>??</h3><p>Accessing nullable variables you can use <strong>??</strong></p><p>If the left variable or expression is not null then it will be simply returned value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*-Es9scvgLnyc-8BZp1kyzg.png" /></figure><p>If the left expression the variable is null then it will evaluate and return the right expression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*20u57E3Zq8aAwLRIFW8QbA.png" /></figure><h3>??=</h3><p>Assign a value conditionally to a variable you can use <strong>??=</strong></p><p>If the variable on the left side is null then it will assign the value of the right side to this variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*WMpwFpczl2HgWwoyDaM5FQ.png" /></figure><p>If the variable on the left side is not null then it will simply keep the value that it had before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*t2DodY_Epc97k1nWhtTqrQ.png" /></figure><h3>…?</h3><p>If you have a nullable list then you can use …?</p><p>If the variable is not now then the variable values will be simply added to the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*4XMtZCRjPfo6iaWmM3kbaQ.png" /></figure><p>If the variable is null then nothing will be included to this list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*fzDC0zPW2XiW0gvtpydD_A.png" /></figure><h3>? and !</h3><p>A variable requires a real value assigning a null value is not allowed by default. Simply add a question mark so that you can also assign a null value to your variable.</p><p>Calling a method or property on a nullable type doesn’t work. Therefore you need to add a question mark or exclamation mark before the dot.</p><p>For a variable that is null the question mark will return a null value as a result and the exclamation mark will throw an exception at runtime that crashes your app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wKRRd3H_k6XeixCuCid1-A.png" /></figure><p>On the other hand if the variable has a real value then the methods and properties are executed normally and return their result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ClvZ9ayB_doYef-BkUPxeg.png" /></figure><h3>late</h3><p>If you don’t want to make your variable nullable because you initialize it already somewhere else then simply add the late keyword.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XG2dR_c95lZ8PfY9NhtrTQ.png" /></figure><p>The late keyword is a promise to that that the variable is later initialized with a real value.</p><p>If you missed to initialize this variable then you didn’t fulfill this promise and it will lead to a runtime exception and crashes the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zWc8x7-u8dCCp0dJjCSEAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*oaXOEluhnTy3u9Gwtp6ByA.gif" /></figure><h3>That’s all for this article.</h3><blockquote><em>Subscribe for upcoming posts. Thanks for reading, and have a wonderful day!</em></blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=922e85106b76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Secure Storage]]></title>
            <link>https://medium.com/@omer28gunaydin/flutter-secure-storage-f772186ac8d3?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f772186ac8d3</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-secure-storage]]></category>
            <category><![CDATA[secure-storage]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Fri, 09 Sep 2022 18:41:14 GMT</pubDate>
            <atom:updated>2022-09-09T18:41:14.653Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple tutorial about using flutter secure storage package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*VJdJKdHT0H6eIDqoZX9gAQ.png" /></figure><p>It is a package that should be used in cases where your private data such as password email should be kept. It is an alternative package to the <a href="https://pub.dev/packages/shared_preferences">Shared Preferences</a> package. In both packages, it ensures that your data is kept as a key value pair locally. <a href="https://pub.dev/packages/flutter_secure_storage">Flutter Secure Storage</a> is also storing them securely and encrypted.</p><p>Let’s begin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Yw5AIBffqPK8WWsFAjUarw.gif" /></figure><p>First of all you have to add flutter_secure_storage package to your pubspec.yaml.</p><pre>flutter_secure_storage: ^5.1.0</pre><p><strong>!!!Configure Android version</strong></p><p>In [project]/android/app/build.gradle set minSdkVersion to &gt;= 18.</p><pre>android {<br>    ...</pre><pre>defaultConfig {<br>        ...<br>        minSdkVersion 18<br>        ...<br>    }</pre><pre>}</pre><p>After this configurations, we have to make a screen design for test the package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*gZJnJSzNW1pLsK25DORB9A.png" /></figure><p>In this example we will try to save the username and password. Let’s code a class for Secure Storage.</p><p>We are creating a FlutterSecureStorage instance in the class. For key -value pairs, we name the keys as ‘username’ and ‘password’. We create the set and get methods.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e4fed73441438605a804b6a72759e6f/href">https://medium.com/media/2e4fed73441438605a804b6a72759e6f/href</a></iframe><p>We create textformfields for username and password. We are creating TextEditingControllers for these textformfields and creating an instance from the SecureStorage class that we coded before.</p><p>Then we write the get and set methods simply that we prepared earlier.</p><p>Get Methods :</p><pre>Future&lt;void&gt; fetchSecureStorageData() async {</pre><pre>_userNameController.text = await _secureStorage.getUserName() ?? ‘’;</pre><pre>_passwordController.text = await _secureStorage.getPassWord() ?? ‘’;</pre><pre>}</pre><p>Set Methods :</p><pre>await _secureStorage.setUserName(_userNameController.text);</pre><pre>await _secureStorage.setPassWord(_passwordController.text);</pre><p>This is the code of the screen :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbe6a05c3339c75f8606e6acf80145df/href">https://medium.com/media/bbe6a05c3339c75f8606e6acf80145df/href</a></iframe><p><strong>This is the final result :</strong></p><p>Finally, when we close and open the application, we see that username and password are saved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*eFGO3KaknlkUkJiaXqw1Nw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*2r4rwU32nsmO4niKaA6Ouw.gif" /></figure><h3>That’s all for this article.</h3><blockquote><em>Subscribe for upcoming posts. Thanks for reading, and have a wonderful day!</em></blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f772186ac8d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Shared Preferences]]></title>
            <link>https://medium.com/@omer28gunaydin/flutter-shared-preferences-3302e0e544b1?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/3302e0e544b1</guid>
            <category><![CDATA[flutter-database]]></category>
            <category><![CDATA[sharedpreferences]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Thu, 01 Sep 2022 04:43:18 GMT</pubDate>
            <atom:updated>2022-09-01T04:43:18.034Z</atom:updated>
            <content:encoded><![CDATA[<p>A tutorial about using shared preferences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*QICGDF2KAHpznGWbZBQH2Q.png" /></figure><p>SharedPreferences is what Android and iOS apps use to store simple data in an allocated space. This data exists even when the app is shut down and starts up again; we can still retrieve the value as it was.</p><p>The data stored in SharedPreferences can be edited and deleted. SharedPreferences stores the data in a <a href="https://flutter.dev/docs/cookbook/persistence/key-value">key-value pair</a>.</p><p>To use SharedPreferences in Flutter, a plugin called <a href="https://gist.github.com/philipszdavido/aa5086ce7f0f85e50cddd008895ae4b6">shared_preferences</a> enables us to store data. The plugin wraps NSUserDefaults on iOS and SharedPreferences on Android.</p><p>Let’s begin. Create your flutter project first then add shared_preferences plugin to your pubspec.yaml file.</p><pre>shared_preferences: ^2.0.15</pre><h3>1. Basic Data</h3><p>We initialize the shared preferences and save the preferences in our state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*fGpEPzNTvwa-g5Rz9hUdNg.png" /></figure><p>Create a text for show the value from prefs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*97X6jfZknhcZgwph5IqB3g.png" /></figure><p>Then create a button. If we click on the button we call the preferences to store a key value pair with this. If we click on the button we store the value <em>‘omergunaydin’</em> on our phone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*4AsVEcZiuCshCmxccj2D6A.png" /></figure><p>Let’s create a second button inside we load this value <em>‘omergunaydin’</em> by referring to the same key where we have stored the value before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*gT4eV7k07j4rG7ZUohqBXw.png" /></figure><p>And lastly we put this loaded name into our state as a result if we store the value on our phone and restart our application then we can load the value ‘omergunaydin’ again from our phone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*YR2zTH9R1EP4dfRcsQEQFA.png" /></figure><p>After that you can load this value inside your init state method. With this we don’t need a load button we can simply restart our application and as soon as the app is started the value is loaded from the phone storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*d0ISvuDEN5WwgnlMCiWttg.png" /></figure><p>You can see all the code here.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e3670ced13d1478cff4173404b48ee6/href">https://medium.com/media/3e3670ced13d1478cff4173404b48ee6/href</a></iframe><h3>2. Object Data</h3><p>Also you can store whole objects therefore only implement the to json and from json method for each data field.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a644730335658f97c04e424f5f72110/href">https://medium.com/media/0a644730335658f97c04e424f5f72110/href</a></iframe><p>This time if we click on the save data button we create a user object that we first of all serialize by calling the to json method. And we store this user.json data on our phone within the init method we load the user by referring to the user key then we deserialize this user json convert it back to user object by using the from json method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*Q-JsWkhdSXBni8a0NtK-Rg.png" /></figure><p>And finally we save the user inside the state with this we store the user object on our phone and if we restart the app then this user data is loaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*kUmpzcNKArym3BEKVuJMvg.png" /></figure><p>This is the final result :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*84LHURRfQT4TDR74azSrwg.png" /></figure><p>You can see all the code here.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a775ac610e4ff0e7a1d7fd6f1c933042/href">https://medium.com/media/a775ac610e4ff0e7a1d7fd6f1c933042/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*TxLZbwer8u8GSkKJtQ8DOg.gif" /></figure><p>That’s all for this article.</p><blockquote><em>Subscribe for upcoming posts. Thanks for reading, and have a wonderful day!</em></blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3302e0e544b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Package Use : Google Translate]]></title>
            <link>https://medium.com/@omer28gunaydin/flutter-package-use-google-translate-6dbef49ce79b?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/6dbef49ce79b</guid>
            <category><![CDATA[flutter-package]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[google-translate]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Tue, 23 Aug 2022 05:30:23 GMT</pubDate>
            <atom:updated>2022-08-23T05:30:23.063Z</atom:updated>
            <content:encoded><![CDATA[<h3>Flutter Package Use : Google Translate</h3><p>A tutorial about using google api for translation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*NC1PwPARqfD0AecoOPm2jQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*F17h5E8jiPdZk6vkLG1ZRg.gif" /></figure><p><a href="https://pub.dev/packages/translator">translator | Dart Package</a></p><p>With this package, you can easily integrate the google translate api into your projects.</p><p>First of all we have to add package to pubspec.yaml.</p><pre>translator: ^0.1.7</pre><p>Let’s code a design for the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*84shy3FJj_Mtki7QF0lVIA.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c8367d90933014a23d3ca9dd9fd0765/href">https://medium.com/media/2c8367d90933014a23d3ca9dd9fd0765/href</a></iframe><p>We do the necessary coding in the onChanged method of textfield.</p><pre>onChanged: (text) async {<br>    final translation = await text.translate(from: <strong>‘en’</strong>, to: <strong>‘tr’</strong>);<br>    setState(() {<br>        translatedText = translation.text;<br>    });<br>}</pre><p>If we type anything within the text field then you can translate any string using the translator package.</p><p>In case you don’t know the input language you see auto language detection.</p><pre>final translation = await text.translate(from: <strong>‘auto’</strong>, to: ‘tr’);</pre><p><strong><em>Final Result :</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*NLXthpWQjLVPZtPTjY0__Q.png" /></figure><p><strong><em>Final Code :</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dda977c9748daa63e92d1ed6c97ed063/href">https://medium.com/media/dda977c9748daa63e92d1ed6c97ed063/href</a></iframe><h3>Google Translation API</h3><p>For the release version of your app make sure to use the google api key instead for the translation simply go to this url.</p><p><a href="https://console.cloud.google.com/marketplace/product/google/translate.googleapis.com">https://console.cloud.google.com/marketplace/product/google/translate.googleapis.com</a></p><p>After creating a google cloud project click on enable then click on the credentials tab oncreatecredentials api key and copy your api key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h2u2cEHR9Y1MHqmeH3p5bQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gRwEIVx754_lSrwqJpd3YA.png" /></figure><p>Paste this api key inside and then we use the http package to make a request to the google translate api .</p><pre>onChanged: (<strong>text</strong>) async {<br>   const <strong>apiKey</strong> = ‘***<strong>yourapikey</strong>***’;<br>   const <strong>to</strong> = ‘tr’;<br>   final <strong>url</strong> = Uri.parse(‘https://translation.googleapis.com/language/translate/v/&#39; + ‘?q=$<strong>text</strong>&amp;target=$<strong>to</strong>&amp;key=$<strong>apiKey</strong>’);<br>   final response = await http.post(<strong>url</strong>);<br>   <br>   if (response.statusCode == 200) {<br>      final body = jsonDecode(response.body);<br>      final translations = body[‘data’][‘translations’] as List;<br>      final translation = translations.first;</pre><pre>      setState(() {<br>         translatedText = translation;<br>      });<br>   }<br>}</pre><p>Finally we have the google translation using an api key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*Q-qw9dO6bllMP38Qjjp5nQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Cmc0nrysWOSBJdhP6ZVLCg.gif" /></figure><p>That’s all for this article.</p><blockquote><em>Subscribe for upcoming posts. Thanks for reading, and your claps. Have a wonderful day!</em></blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6dbef49ce79b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customizing Error Screens - Flutter]]></title>
            <link>https://medium.com/@omer28gunaydin/customizing-error-screens-flutter-319d40eb9bb?source=rss-de26702208fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/319d40eb9bb</guid>
            <category><![CDATA[flutter-error]]></category>
            <category><![CDATA[error-screen]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Ömer Günaydın]]></dc:creator>
            <pubDate>Fri, 12 Aug 2022 07:30:33 GMT</pubDate>
            <atom:updated>2022-08-12T07:30:33.243Z</atom:updated>
            <content:encoded><![CDATA[<p>A tutorial about customizing grey and red error screens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*Cn2Y9nacarb5JimdxYQYkw.png" /></figure><p>When you release the application you developed with Flutter, the user encounters a gray screen when an error occurs. This provides a bad experience for the user.</p><p>As a developer, you already see a red screen when an error occurs while developing an application. But when the application is released, it turns into a gray blank screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*D1PiCt9inwoJukLgDBjVig.gif" /></figure><p>We need to make an error. It might be a good idea to null check when reading the length of a null String value.</p><pre>final String? foo = null;</pre><pre>var len = foo!.length;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*QrhTmCf2uVPkqZ2wU9rcsA.png" /></figure><p>Let’s see how to customize it.</p><p>First of all, let’s add an error image under assets/images folder and define it in pubspec.yaml file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*aqgzzStdQdNpVdyg3KO6EA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*xit3SBZzCogpiaNoVW9PDA.png" /></figure><p>Then, we create a builder in MaterialApp. The important thing here is ErrorWidget.builder . We can send the error details as argument to the custom error view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*qYkVh3MZzB25TDF9Gq1psw.png" /></figure><p>Then we create the CustomErrorView page as StatelessWidget. I coded it as you can see below. I used the kDebugMode flag from foundation.dart for cases where it should only work in debug mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yisU-Wy65o8NlX2lb7mwMA.png" /></figure><p>The result when an error occurs :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*yCgDZ2vEKEQjTwRLcOPc6w.png" /></figure><p>That’s all for this article.</p><blockquote>Subscribe for upcoming posts.<em> </em>Thanks for reading, and have a wonderful day!</blockquote><p>Connect with me on: <a href="https://github.com/omergunaydin"><strong>Github</strong></a> <a href="https://twitter.com/omergunaydin28"><strong>Twitter</strong></a> <a href="https://www.linkedin.com/in/%C3%B6mer-g%C3%BCnaydin-826844138/"><strong>LinkedIn</strong></a> <a href="https://www.instagram.com/omergunaydin28/"><strong>Instagram</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=319d40eb9bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>