<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Rafat Jamader Meraz</title>
    <description>The latest articles on Forem by Rafat Jamader Meraz (@rafatmeraz).</description>
    <link>https://forem.com/rafatmeraz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F456318%2F9c031746-b73b-46cd-860e-6cbb9e03df62.jpeg</url>
      <title>Forem: Rafat Jamader Meraz</title>
      <link>https://forem.com/rafatmeraz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rafatmeraz"/>
    <language>en</language>
    <item>
      <title>Avoid state management package in Flutter</title>
      <dc:creator>Rafat Jamader Meraz</dc:creator>
      <pubDate>Mon, 15 Nov 2021 19:22:38 +0000</pubDate>
      <link>https://forem.com/rafatmeraz/avoid-state-management-package-in-flutter-o2h</link>
      <guid>https://forem.com/rafatmeraz/avoid-state-management-package-in-flutter-o2h</guid>
      <description>&lt;p&gt;State management is one of the best hot topic in Flutter. In community nowadays most common question is- "What package should use for state management?". Specially beginner are really confused.&lt;/p&gt;

&lt;p&gt;As I have mentioned in my title that you should avoid state management package for your next big project. There are some fancy way to avoid these package so that our project is not depend on a third party package which is maintain by community. Sometimes a major change is happens in these packages and we face a huge list of errors and warning by that time. &lt;/p&gt;

&lt;p&gt;Then what's the solution for state management in Flutter? So answer is reactive programming. As you already know that Flutter provides &lt;strong&gt;Stream&lt;/strong&gt; &amp;amp; &lt;strong&gt;StreamBuilder&lt;/strong&gt; for Asynchronous programming. So you can use these features to make your app more reactive. With these feature you can also use a small package which is &lt;a href="https://pub.dev/packages/get_it"&gt;get_it&lt;/a&gt; as Service locator. &lt;/p&gt;

&lt;p&gt;Another advice is to use Stateful Widget. Many of us are afraid of use Stateful widget because they think that will create a performance issue. But in few cases like a screen only rebuild for one/twice then you can use it. You don't need to write a huge number of boilerplate code to manage this simple task with a state management package like BLoC. Use Asynchronous programming for those screens or part of screen where it need to rebuild a several times.&lt;/p&gt;

</description>
      <category>flutter</category>
    </item>
    <item>
      <title>Should I know Design Patterns as a Flutter Developer?</title>
      <dc:creator>Rafat Jamader Meraz</dc:creator>
      <pubDate>Sun, 07 Nov 2021 17:50:39 +0000</pubDate>
      <link>https://forem.com/rafatmeraz/should-i-know-design-patterns-as-a-flutter-developer-474m</link>
      <guid>https://forem.com/rafatmeraz/should-i-know-design-patterns-as-a-flutter-developer-474m</guid>
      <description>&lt;p&gt;&lt;strong&gt;YES&lt;/strong&gt;, you should know about design patterns as a Flutter app developer. In current scenario, most of the Flutter developer are new to programming or just started learning a framework for developing mobile application and focusing on developing fancy User Interface with flutter. It's easy and we can do rapidly. But problem is when they try to understand the deep level knowledge about Flutter core architecture. Even most of them used to write a huge legacy code in their production application (Even I was one of them). In that case, the app faces several issue during the production lifecycle like-performance issue.&lt;/p&gt;

&lt;h3&gt;
  
  
  So what should we do now?
&lt;/h3&gt;

&lt;p&gt;We need to learn the design pattern concept for understanding the proper way to handle Flutter framework &amp;amp; core architecture. Firstly, We need to understand the core concept of dart language. Then comes OOP(Object Oriented Programming) with dart to save us. We can write reusable code with OOP and can make a proper maintainable application. After OOP, we need focus on Design Patterns. We can learn design pattern from several resources. I am mentioning some of my favorite sites from learning it. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.toDart%20Language%20Tour"&gt;https://dart.dev/guides/language/language-tour&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.toDart%20Academy"&gt;https://dart.academy/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.toDesign%20Patterns%20with%20Flutter"&gt;https://medium.com/flutter-community/flutter-design-patterns-0-introduction-5e88cfff6792&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These resources could be your start point of Deep knowledge with Flutter.&lt;/p&gt;

&lt;p&gt;You can find more resources in YouTube and you can add more valuable link/sites in comments. &lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
    </item>
    <item>
      <title>Reasons Why Small Companies Should Adopt Flutter For Mobile</title>
      <dc:creator>Rafat Jamader Meraz</dc:creator>
      <pubDate>Sat, 06 Feb 2021 06:09:04 +0000</pubDate>
      <link>https://forem.com/rafatmeraz/reasons-why-small-companies-should-adopt-flutter-for-mobile-58ae</link>
      <guid>https://forem.com/rafatmeraz/reasons-why-small-companies-should-adopt-flutter-for-mobile-58ae</guid>
      <description>&lt;p&gt;&lt;strong&gt;Flutter&lt;/strong&gt; is on the hype now. Almost most of the developers are learning &lt;strong&gt;Flutter&lt;/strong&gt; as their second framework for mobile development. As we already know that we can use flutter for the development of cross-platform native apps that performs almost like a native. &lt;/p&gt;

&lt;p&gt;Giants company like Alibaba has already shifted their app into Flutter. And I think small companies should also start developing their own apps in Flutter. &lt;/p&gt;

&lt;p&gt;Let's see the advantages -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cross-platform native app&lt;/strong&gt;: We can develop app not only for Android but also for IOS. A more interesting feature is we will get the native performance from this framework. We don't have to update features for android and ios separately. Even we can write platform-specific code. For rapid development, Flutter is one of the best frameworks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI Kit&lt;/strong&gt;: Actually Flutter is a UI kit for software development. So that it provides a huge number of UI widgets for impressive user interface design.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packages&lt;/strong&gt;: &lt;a href="https://pub.dev"&gt;pub.dev&lt;/a&gt; is the official package manager site for Flutter. We can easily get any package from here and also upload our own package to the community.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resources&lt;/strong&gt;: Documentation of Flutter is well organized. Google provides great documentation for Flutter learners. There are also many YouTubers who are contributing for good content and these content are quite helpful for all level developer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to learn&lt;/strong&gt;: Anyone can learn Flutter who has previous experience of mobile development with native Android or IOS. Flutter uses Dart and it's a really interesting language as well as easy to learn.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community&lt;/strong&gt;: Though Flutter released last 2017, the Flutter community is quite big already. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Small team&lt;/strong&gt;: Small companies have a few amounts of developers. But they need to deliver product quite fast and Flutter is the best choice for this.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>flutter</category>
    </item>
    <item>
      <title>How to Organize A Flutter Project</title>
      <dc:creator>Rafat Jamader Meraz</dc:creator>
      <pubDate>Sat, 22 Aug 2020 15:04:30 +0000</pubDate>
      <link>https://forem.com/rafatmeraz/how-to-organize-a-flutter-project-2cpf</link>
      <guid>https://forem.com/rafatmeraz/how-to-organize-a-flutter-project-2cpf</guid>
      <description>&lt;p&gt;&lt;strong&gt;Flutter&lt;/strong&gt; is a trending mobile framework in nowadays. Small &amp;amp; medium companies are focusing on flutter for it's awesome UI and native performance. We are not going to explain to you about &lt;strong&gt;Flutter&lt;/strong&gt; here. Because the main purpose of this blog is to help you to organize your Flutter project more efficiently. &lt;/p&gt;

&lt;p&gt;At first, I am gonna clear you about one thing and that is "There is no rule to organize a flutter project". But as a beginner, you should follow some basic project structure that will help your project more scaleable later. Moreover, you will able to maintain your project easily. &lt;/p&gt;

&lt;p&gt;If you are a beginner, then maybe you have already faced some common issues during your medium size projects. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unable to find a specific file&lt;/li&gt;
&lt;li&gt;Writing a block of codes again and again&lt;/li&gt;
&lt;li&gt;Mixing up User Interface and back-end code&lt;/li&gt;
&lt;li&gt;Unlimited local variable&lt;/li&gt;
&lt;li&gt;App causing of battery drain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So how to resolve these problems? Okay, you have to follow some basic rules for file structure as a beginner. Then You can minimize these problems easily.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a good project structure
&lt;/h3&gt;

&lt;p&gt;The first and most important part of organizing your project is to make a good project structure. If you are unable to separate your codes for different segments then you be lost in at a point. So you need to maintain your code hierarchy properly. Let's see an example project code structure.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhcvqi5dmr1iq5ghfsmtx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhcvqi5dmr1iq5ghfsmtx.png" alt="Core project structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you already know that all the codes for the Flutter project which we write in dart are located in &lt;strong&gt;lib&lt;/strong&gt; folder. So let's see the inner package structure for our project one by one.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;src&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;As you can see that the &lt;code&gt;main.dart&lt;/code&gt; file is out of &lt;strong&gt;src&lt;/strong&gt; and we will only write the application codes in this &lt;strong&gt;src&lt;/strong&gt; package. When &lt;code&gt;main.dart&lt;/code&gt; will execute as root file we will redirect it to the &lt;code&gt;src\app.dart&lt;/code&gt; file which will contain all the MaterialApp/CupertinoApp components.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;business_logic&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;All the logical parts of the project will be located in this package. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;blocs&lt;/strong&gt;: If you are following the BLoC pattern then you can keep your blocs here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;models&lt;/strong&gt;: Models/Pojo classes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;services&lt;/strong&gt;: There are three types of services - api_services, database_services, shared_prefs_services. You will put your specific types of codes in the specific type of service packages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;utils&lt;/strong&gt;: This package contains all the constants files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;views&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;We will put our User Interface codes insides our views package. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ui&lt;/strong&gt;: All the User Interface code files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;utils&lt;/strong&gt;: This package contains the reusable widgets files and the constants value files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is another important folder which we have to organize and that is &lt;code&gt;assets&lt;/code&gt; folder. As we know that there are no pre-defined &lt;em&gt;assets&lt;/em&gt; folder in flutter default project hierarchy. We create a new folder as &lt;code&gt;assets&lt;/code&gt; and initialize it into &lt;code&gt;pubspec.yaml&lt;/code&gt; file. Then you can follow below the structure for your &lt;code&gt;assets&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzi2ugm2jr4hwnjlbvyvh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzi2ugm2jr4hwnjlbvyvh.png" alt="Assets project structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find this project structure in here&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/RafatMeraz" rel="noopener noreferrer"&gt;
        RafatMeraz
      &lt;/a&gt; / &lt;a href="https://github.com/RafatMeraz/organize_flutter_project" rel="noopener noreferrer"&gt;
        organize_flutter_project
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Project structure for an organized project in Flutter.
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
