<?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 Umut Arpat on Medium]]></title>
        <description><![CDATA[Stories by Umut Arpat on Medium]]></description>
        <link>https://medium.com/@umutarpt?source=rss-98ede42e32ff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Umut Arpat on Medium</title>
            <link>https://medium.com/@umutarpt?source=rss-98ede42e32ff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:44:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@umutarpt/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[Mistakes that Flutter Developers Should Stop Doing - Part one]]></title>
            <link>https://medium.com/@umutarpt/mistakes-that-flutter-developers-should-stop-doing-part-one-da5c9d7132c8?source=rss-98ede42e32ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/da5c9d7132c8</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Umut Arpat]]></dc:creator>
            <pubDate>Sat, 28 Jan 2023 13:09:04 GMT</pubDate>
            <atom:updated>2023-01-28T13:09:45.531Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eBEe7YZmnE8zm_7_" /><figcaption>Photo by <a href="https://unsplash.com/@neonbrand?utm_source=medium&amp;utm_medium=referral">Kenny Eliason</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>1000 lines of code</h4><p>A dart file should be only consisted of 150–200 lines of code max. (Ofc. there could be exceptions)</p><p>When it is bigger than 200 lines of code there is a high chance of widget separation issue.</p><p><strong>Before Separation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rclrTLoE_K18bcBDB7XaJQ.png" /></figure><p><strong>After Separation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*Gtte8l6JuD6zR0ureTJplA.png" /><figcaption>After Separation</figcaption></figure><p>Of course you should only do this when widgets are bigger. Don’t just separate a widget to another class if it is only<strong> Text(“Hello”)</strong> just like in the example.</p><h4>Separating widgets to functions instead of classes</h4><p>When you separate widgets it should be Stateful or Stateless classes, Not functions.</p><p>Using functions is anti pattern for Flutter widget tree. And it may lead to performance issues and bugs.</p><p>Using classes is the right way to do this plus you can reach context.</p><p><strong>Bad</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*2q-CTskd-AdPYudRdbeGhA.png" /></figure><p><strong>Good</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*U_4nlFSiPt478jvdchHlWg.png" /></figure><h4>Not writing unit tests</h4><p>A Flutter Developer should write unit tests for code maintenance and in order to become a hireable developer.</p><p>Writing unit tests will make your actual code more readable and SOLID compatible. If your code isn’t SOLID compatible it will be harder to test.</p><p>Thus if you care about unit testing your code. It will make your code quality better along the way.</p><p>Just right click your controller or view model and click on Go to Tests:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*fENf8HFf8hiwP0d6QrqptQ.png" /></figure><p>It will create a test file for you in “test” folder. Inside “test” folder, folder structure can be same as your “modules” folder structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVRs2aXFReBCu1vogh39Og.png" /></figure><p>You can now write your own tests! Depending on the state management. It can be a different experience.</p><p>I will discuss that topic in the future for my Riverpod, flutter_hooks folder architecture article. Stay tuned!</p><p>Thank your for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da5c9d7132c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Here is Why and How You Can Write Native Code in Flutter for Both Kotlin and Swift]]></title>
            <link>https://levelup.gitconnected.com/here-is-why-and-how-you-can-write-native-code-in-flutter-for-both-kotlin-and-swift-91fd020ed4f5?source=rss-98ede42e32ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/91fd020ed4f5</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[native-app]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Umut Arpat]]></dc:creator>
            <pubDate>Sun, 13 Nov 2022 16:37:16 GMT</pubDate>
            <atom:updated>2022-11-16T03:08:00.123Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uY9jg5OwfFeqFnQAKDHIxQ.png" /></figure><p>Welcome to my Flutter tutorial for writing Kotlin and Swift code for native integration.</p><p>The below content is for a native example written both in Kotlin and Swift for retrieving the device’s name and battery level.</p><p>I used GetX as state management here (which I don’t recommend anymore. Another topic for another day) but you can use any state management you want for your own implementation.</p><h3>Why do we need to write native code?</h3><p>As you might know, we have <a href="https://pub.dev/">https://pub.dev/</a> for an enormous amount of Flutter packages which support us in our daily Flutter Developer life such as camera, permission handling, device info, etc.</p><p>But what if we didn’t have any native programming language experience and we didn’t have any packages like getting device info, handling permissions or being able to call the camera?</p><p>Well of course you would be fired instantly and replaced by someone who worked on Kotlin or Swift in the past :)</p><p>Thank god we have pub.dev for not making Flutter Devs unemployed.</p><h4>Career</h4><p>When I was interviewing for Flutter jobs, 6 out of 10 companies asked me for Kotlin knowledge. Of course, I am not saying if you don’t know Kotlin you can’t get a job in Flutter. Which would be a lie for now.</p><p>But if you know Kotlin or Swift you can really get far in the race.</p><h4>Writing custom integrations or packages</h4><p>If your company uses custom third party packages you may need native code knowledge for integration.</p><p>If your company wants you to implement new features for device’s platform and if there isn’t any package for that in pub.dev. You need native code knowledge for able to do that.</p><p>Lastly, it doesn’t hurt to learn something new and if you are thinking Flutter long term like me you should learn Kotlin or Swift.</p><h3>Code</h3><p>First we are going to create a View and a Controller. I am only going to retrieve device name and battery level as an example (note that if you are using simulator you can’t retrieve battery level as you need a real device for that)</p><h4>View</h4><p>It’s just a simple view where I use GetX controller to put values into UI as Text widgets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TsnwBMzQv75MMgVtoW0Iig.png" /></figure><h4>Controller</h4><p>Here we have our controller for handling cross platform channel invocation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*keK2Q2cDnG3GShkcJa0-zQ.png" /></figure><p>First we need to define a MethodChannel variable with a given name like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xj6B8xSQBHs81hdANPvh2A.png" /><figcaption>Example channel name is what will be used later on our native code files. mine is ‘native’</figcaption></figure><p>Then I am going to create two functions called getBatteryLevel and getDeviceName which they will be get called at the initial start with onInit lifecycle method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PdXiPTL1pJ100_FdicO0ew.png" /></figure><p>When two methods are going to get called onInit. It will invoke platform based functions with example_channel_name (ours is ‘<strong>native</strong>’)</p><h3>Kotlin</h3><p>In ‘android/app/src/main/kotlin/com/example/flutter_native/’ path we are going to find ‘MainActivity.kt’ file to write our custom Kotlin code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ipnvyz1J6J2KDDsuV85DXw.png" /></figure><p>First things first; CHANNEL variable at the top should be same as our channel name in our dart code for integration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*IgHMbkDvF1bodJC4wftycw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xj6B8xSQBHs81hdANPvh2A.png" /><figcaption>example_channel_name should be called ‘native’ same as in native code.</figcaption></figure><p>Then we are going to create our configureFlutterEngine function.</p><p>This will allow us to handle method invocations from our dart code and do business logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qaqy9c3Iyk-vzHffloGieQ.png" /></figure><p>As you can see we are checking method names such as ‘getBatteryLevel’ for our business logic implementation. We did give a name for invoke method earlier in our controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3fdXhAn9wnqydB1xprgasA.png" /></figure><p>Functions for getting battery level and Device name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhrgahsdsdAQ8acqhTmj6Q.png" /></figure><h3>Swift</h3><p>It has a very similar implementation for native code handling just like Kotlin.</p><p>In ‘ios/Runner/’ path we are going to find ‘AppDelegate.swift’ file to write our custom Swift code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ucjVB6ieAV9Lie1OSTAX8g.png" /></figure><p>Inside application function we are going to write our method handling</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GVfAC5s1NC3s0DTZGXbkcA.png" /></figure><p>Functions for getting battery level and Device name:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nk0Au7yzCI9PAuuMI0QKPA.png" /></figure><p>Thank you for reading.</p><p>You can find related repository here:</p><p><a href="https://github.com/umutarpat/flutter_native">https://github.com/umutarpat/flutter_native</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91fd020ed4f5" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/here-is-why-and-how-you-can-write-native-code-in-flutter-for-both-kotlin-and-swift-91fd020ed4f5">Here is Why and How You Can Write Native Code in Flutter for Both Kotlin and Swift</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scalable Flutter Folder Structure for Big Apps]]></title>
            <link>https://levelup.gitconnected.com/scalable-flutter-folder-structure-for-big-apps-480a9b266793?source=rss-98ede42e32ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/480a9b266793</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[folder-structure]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Umut Arpat]]></dc:creator>
            <pubDate>Sun, 19 Jun 2022 17:20:25 GMT</pubDate>
            <atom:updated>2022-10-21T14:38:57.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l4VS8K2_LkniSo1q" /><figcaption>Photo by <a href="https://unsplash.com/@medbadrc?utm_source=medium&amp;utm_medium=referral">Med Badr Chemmaoui</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When starting a new project you need to plan the long run in order to finish the project cleanly.</p><p>I am a professional Flutter developer with 3 years of experience. I am going to show you how I design folder structure for my Flutter apps.</p><p>First we start with two folders called “global” and “modules”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*G8Ga2uNQTmTZqnWDeFmCGA.png" /></figure><p>We will add functions and widgets that will help our app globally in the global folder.</p><p>The global folder will contain these folders</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*UuUWxmcJ5_TGTYbR-bE-lw.png" /></figure><ul><li>Common will contain commonly used widgets like loading indicators, dialogs, and any widget you use frequently on your modules.</li><li>Widgets fill contain high-level widget files like your wrapped function of <a href="https://pub.dev/packages/flutter_form_builder">https://pub.dev/packages/flutter_form_builder</a> fields or a datatable widget for example.</li><li>Utils will contain const variables you have created. These can be styles, design values. It can also contain functions you frequently use.</li><li>Themes will contain your themes created with official documentation: <a href="https://docs.flutter.dev/cookbook/design/themes">https://docs.flutter.dev/cookbook/design/themes</a></li><li>Controllers will contain controllers that you use globally in your modules or before starting the app.</li><li>Interceptors will contain for example a fetching interceptor or a route interceptor. I use Dio for data fetching so I create Dio’s interceptor there.</li><li>Endpoints will contain string URL functions that you use for data fetching. Using endpoints like this will make it quicker to update and see what endpoints you are using overall.</li><li>Models will contain JSON models you have created with official documentation here: <a href="https://docs.flutter.dev/development/data-and-backend/json">https://docs.flutter.dev/development/data-and-backend/json</a></li><li>Services will contain functions that fetch from API.</li><li>Both services and models must be in global folder in a big app. The reason for this is you can use a service both in profile module and home module etc..</li><li>If you create models and services per module it will get complicated in the long run.</li></ul><p>This way you can create an entire global folder suited for your app&#39;s interests.</p><p>In the modules folder, we will have modules which have a view file, controllers, and widgets folder in order to separate big chunks of flutter code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*mtrHfwo4vc12Qphse2Bn1w.png" /></figure><p>We will create modules based on pages. Here we have home and profile modules for example.</p><ul><li>Controllers will contain controls (or view models. I am using GetX that is why I named them “Controllers”) you have created. It can be a GetX controller or other state management packages you have used.</li><li>Widgets folder will contain widgets that we will use on our view. I always give advice to cut chunks of your view into smaller widgets whenever possible.</li><li>And then there is your view. Which will be your view.. amazing isn’t it ? It should not be more than 300 lines of code max.</li><li>Business logic should be handled in your controllers. Widgets in your view should be separated by files then recalled on your view.</li></ul><p>With this structure you can scale a big Flutter app easily.</p><p>Follow me on Twitter. I post mainly about SaaS and tips I have found in life :)</p><p><a href="https://twitter.com/umutarpt">https://twitter.com/umutarpt</a></p><h3>Level Up Coding</h3><p>Thanks for being a part of our community! More content in the <a href="https://levelup.gitconnected.com/">Level Up Coding publication</a>.<br>Follow: <a href="https://twitter.com/gitconnected">Twitter</a>, <a href="https://www.linkedin.com/company/gitconnected">LinkedIn</a>, <a href="https://newsletter.levelup.dev/">Newsletter</a><br><strong>Level Up is transforming tech recruiting ➡️ </strong><a href="https://jobs.levelup.dev/talent/welcome?referral=true"><strong>Join our talent collective</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=480a9b266793" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/scalable-flutter-folder-structure-for-big-apps-480a9b266793">Scalable Flutter Folder Structure for Big Apps</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiple Data Fetching Structure with Future Builder,Dio and GetX in Flutter]]></title>
            <link>https://medium.com/@umutarpt/multiple-data-fetching-structure-with-future-builder-dio-and-getx-in-flutter-39f0dfaafe1?source=rss-98ede42e32ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/39f0dfaafe1</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Umut Arpat]]></dc:creator>
            <pubDate>Sun, 15 May 2022 12:18:31 GMT</pubDate>
            <atom:updated>2022-05-15T12:18:31.168Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tiQulFTBC8X-oVAQ" /><figcaption>Photo by <a href="https://unsplash.com/es/@abillion?utm_source=medium&amp;utm_medium=referral">abillion</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Handling futures can be pain in the ass… But with GetX and FutureBuilder not so much!</p><p>First create a Services folder in your global folder. Why in a global folder you might ask ?</p><p>That is because you can fetch one service method on multiple views. In order to control that process smoothly, services should be in global folder.</p><p>Structure Should be like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*CUHBZl8hTAeuUHUL3uttVg.png" /></figure><p>Here we have home_service file with two methods for fetching data with Dio.</p><p>You can use any api you want for multiple data fetching. We are gonna use rapid weather api.</p><p>Don’t forget to create models just like in docs: <a href="https://docs.flutter.dev/development/data-and-backend/json">https://docs.flutter.dev/development/data-and-backend/json</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xaDXogXI7xJlLmZP_2d59w.png" /></figure><p>Then we are going to create Get Controller like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2zCUkHUR9hwtkxTAAYY1MA.png" /></figure><p>First we are gonna create variables with created models.</p><p>mainFuture variable is for using Future.wait (A function to fetch multiple data) more flexible. There are FutureBuilder errors that makes view re render on almost every state change. When we create variables like this we are avoiding cache problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9vrJygPX1d8mRZglSf3hQ.png" /></figure><p>Assign futures to services like this:</p><p>This will connect future variables to api.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*ODDSx2MJ5Z1Kazo-hASVBQ.png" /></figure><p>Then we are going to create our main methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tUrS5bqHp_4Kyc_D1-HGZg.png" /></figure><p>In onInit we call updateMainFuture. This method will be called on view creation. and will fetch sports and astronomy data. then future variables will be assigned to mainFuture in order to fetch multiple datas in FutureBuilder. Then it will update controller id named with ‘main’ .</p><p>Future.wait and datas should go on same line. if you call sportsFuture first then you should call sportsData first too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdJOgM9AQ8ZeVy9ZKSu8-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*reT4cJy-W2ZECAPtbODU4A.png" /></figure><p>After we assign mainFuture to FutureBuilder. Fetched data will come to snapshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*hcOqTrjRnTFOQagO5Yi-ew.png" /></figure><p>When FutureBuilder Snapshot returns assignFutures function will be called like this.</p><p>This will make data variables populate with api data. So we can use them later in nested widgets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BIG88eeyULxMmFqRUeoFZw.png" /></figure><p>And now we can call sportsData and astronomyData on our nested widgets easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s8nwY_Py-zwsc0IsDzp4jg.png" /></figure><p>Like this we can fetch from multiple services without an issue.</p><p>Source code can be found here:</p><p><a href="https://github.com/umutarpat/flutter_futurebuilder_structure">https://github.com/umutarpat/flutter_futurebuilder_structure</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39f0dfaafe1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>