<?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>DEV Community: rubensdemelo</title>
    <description>The latest articles on DEV Community by rubensdemelo (@rubensdemelo).</description>
    <link>https://dev.to/rubensdemelo</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%2F72426%2Ff6a5f22e-2771-457b-9268-29d4bcfffd6b.JPG</url>
      <title>DEV Community: rubensdemelo</title>
      <link>https://dev.to/rubensdemelo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rubensdemelo"/>
    <language>en</language>
    <item>
      <title>[Lançamento] Motoca App</title>
      <dc:creator>rubensdemelo</dc:creator>
      <pubDate>Tue, 25 Apr 2023 14:48:00 +0000</pubDate>
      <link>https://dev.to/rubensdemelo/lancamento-motoca-app-1db9</link>
      <guid>https://dev.to/rubensdemelo/lancamento-motoca-app-1db9</guid>
      <description>&lt;p&gt;Gostaria de compartilhar o lançamento do meu novo aplicativo: Motoca&lt;/p&gt;

&lt;p&gt;&lt;a href="https://motoca.app/"&gt;https://motoca.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;É um aplicativo para motociclistas. Com ele é possível:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Criar e compartilhar eventos de motos.&lt;/li&gt;
&lt;li&gt;Controlar o consumo da moto, armazenando os abastecimentos.&lt;/li&gt;
&lt;li&gt;Gerenciar o gasto com manutençoes e salvar a nota fiscal.&lt;/li&gt;
&lt;li&gt;Criar um perfil e armazenar os dados do motociclista e da motoca.
Tecnologias:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Landing page: Astro + TailwindCSS&lt;br&gt;
Aplicativo: Flutter + Firebase&lt;/p&gt;

&lt;p&gt;Deixe um comentário se tiver interesse que eu faça um post mais detalhado sobre o processo.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>firebase</category>
      <category>astro</category>
      <category>tailwindcss</category>
    </item>
    <item>
      <title>Imperativo X Declarativo</title>
      <dc:creator>rubensdemelo</dc:creator>
      <pubDate>Wed, 29 Mar 2023 15:10:00 +0000</pubDate>
      <link>https://dev.to/rubensdemelo/imperativo-x-declarativo-298a</link>
      <guid>https://dev.to/rubensdemelo/imperativo-x-declarativo-298a</guid>
      <description>&lt;h2&gt;
  
  
  Resumão
&lt;/h2&gt;

&lt;p&gt;Imperativa: especificar como resolver um problema; controle detalhado.&lt;/p&gt;

&lt;p&gt;Declarativa: concentra-se no que o código deve realizar; concentrar no resultado.&lt;/p&gt;

&lt;p&gt;Essas duas abordagens são comumente usadas na programação e é importante entender suas diferenças para compreender melhor o uso &lt;a href="https://docs.flutter.dev/get-started/flutter-for/declarative"&gt;declarativo pelo Flutter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Compreender a diferença, facilita o entendimento em como o &lt;strong&gt;&lt;em&gt;Flutter&lt;/em&gt;&lt;/strong&gt; constrói interfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Imperativa
&lt;/h2&gt;

&lt;p&gt;É um processo passo a passo que diz ao computador o que fazer e como fazê-lo. Em outras palavras, é um conjunto de instruções que o computador segue para alcançar o resultado desejado.&lt;/p&gt;

&lt;p&gt;A programação imperativa envolve escrever código que especifique exatamente como resolver um problema. Ela é baseada no controle do fluxo de execução usando declarações como loops, condicionais e variáveis. Lembre-se: &lt;strong&gt;passo-a-passo&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Adequada para situações em que você precisa ter mais controle sobre o fluxo do programa. Isso significa que se você precisa fazer algo muito específico e precisa ter certeza de que é feito de uma maneira determinada, então a abordagem imperativa pode ser a melhor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Declarativa
&lt;/h2&gt;

&lt;p&gt;É baseada em descrever o resultado desejado sem especificar como alcançá-lo. Em vez de escrever código que especifica como resolver um problema, a programação declarativa se concentra no que o código deve realizar.&lt;/p&gt;

&lt;p&gt;A programação declarativa envolve escrever código que descreve o problema e o resultado desejado, sem especificar como chegar lá. É baseado na definição de regras e relacionamentos entre elementos. Lembre-se: &lt;strong&gt;resultado-desejado&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Adequada para situações em que você deseja descrever o que deseja alcançar, sem se preocupar em como chegar lá. Isso significa que se você deseja se concentrar no resultado, e não no processo.&lt;/p&gt;

&lt;p&gt;Ao trabalhar com interfaces de usuário, usar a abordagem declarativa para garantir que a interface pareça e se comporte exatamente como você deseja, sem se preocupar com a forma como é implementada.&lt;/p&gt;

&lt;h2&gt;
  
  
  Na prática
&lt;/h2&gt;

&lt;p&gt;SQL: Declarativo. Declaramos o resultado ao banco de dados: inserir, atualizar, excluir, consultar... mas nós não o instruimos em como ele deve executar tais operações.&lt;/p&gt;

&lt;p&gt;Algorítimo: Imperativo. Imposto a cada linha de código como ele deve se comportar. Declarar variável, computar valores, avaliar expressões. Estamos instruindo exatamente o comportamento que queremos que o programa tenha.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flutter
&lt;/h2&gt;

&lt;p&gt;Como mecionado anteriormente, o Flutter utiliza a abordagem declarativa: &lt;strong&gt;resultado&lt;/strong&gt;. &lt;br&gt;
Ao construir interfaces com ele, declaramos algo como: 1 imagem, 2 campos de texto e um botão.&lt;/p&gt;

&lt;p&gt;E o framework se encarrega de todo o resto, sem se preocupar com a implementação de cada elemento. &lt;/p&gt;

&lt;p&gt;Com isso, os desenvolvedores podem se concentrar no que desejam alcançar e deixar que o framework se encarregue de como implementá-lo.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>android</category>
      <category>ios</category>
      <category>dart</category>
    </item>
    <item>
      <title>Flutter at Google I/O</title>
      <dc:creator>rubensdemelo</dc:creator>
      <pubDate>Thu, 16 Jun 2022 03:14:43 +0000</pubDate>
      <link>https://dev.to/rubensdemelo/flutter-at-google-io-1hfd</link>
      <guid>https://dev.to/rubensdemelo/flutter-at-google-io-1hfd</guid>
      <description>&lt;p&gt;Google I/O is one of the &lt;strong&gt;most significant&lt;/strong&gt; tech events in the world. For people, the press, and tech artists/enthusiasts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flutter 3&lt;/strong&gt; was introduced at Google I/O 2022.&lt;/p&gt;

&lt;p&gt;But his debut at this event was in 2017.&lt;/p&gt;

&lt;p&gt;Here is a quick recap on how Flutter evolved and how the &lt;strong&gt;headlines&lt;/strong&gt; changed over time.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2017: Single codebase, two apps&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/w2TcYP8qiRI"&gt;A simple app built with Flutter + Firebase&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"learn how to build beautiful cross-platform UIs with Flutter"&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2018: Production ready&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://youtu.be/RS36gBEp8OI"&gt;BLoC state management at stage&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"practical demonstration and live coding, learn patterns for crafting elegant and intuitive code"&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2019: A portable UI framework&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/d_m5csmrf7I"&gt;Shout-out for provider&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"understanding the main approaches of state management in declarative frameworks"&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2020:&lt;/strong&gt; no event&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2021: Leading UI toolkit for multiplatform&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/S5aK3TIOnIw"&gt;Top 7 Flutter things&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"practical demonstration and live coding, learn patterns for crafting elegant and intuitive code"&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2022: From a mobile-centric to a multiplatform&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/OOHr8cn2Z0g"&gt;6 minute recap&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"practical demonstration and live coding, learn patterns for crafting elegant and intuitive code"&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Wow... what a journey from two apps to multiplatform.&lt;/p&gt;

&lt;p&gt;Hard (and smart) work for the Flutter team and &lt;strong&gt;community&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A single codebase targetting six platforms.&lt;/p&gt;

&lt;p&gt;What's next 🤔 &lt;/p&gt;

&lt;p&gt;Drop a comment  &lt;/p&gt;




&lt;p&gt;Thank you,&lt;br&gt;
&lt;a href="https://twitter.com/rubensdemelo"&gt;rubensdemelo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>google</category>
      <category>beginners</category>
      <category>googleio</category>
    </item>
    <item>
      <title>Flutter, React Native, Ionic and Native platform: A visual guide</title>
      <dc:creator>rubensdemelo</dc:creator>
      <pubDate>Sun, 04 Aug 2019 21:26:40 +0000</pubDate>
      <link>https://dev.to/rubensdemelo/flutter-react-native-ionic-and-native-platform-a-visual-guide-2ff8</link>
      <guid>https://dev.to/rubensdemelo/flutter-react-native-ionic-and-native-platform-a-visual-guide-2ff8</guid>
      <description>&lt;p&gt;Cross-platform development has another big player: Flutter, the Google toolkit that allows us to create apps to iOS and Android (and soon to desktop and web). &lt;/p&gt;

&lt;p&gt;Build mobile apps is a challenge. Especially because we need to target two different platforms. Unlike the web, where HTML, CSS, and JS aims to work in every browser (no matter what the size of the device), iOS and Android platforms had his own environment (language, tooling, approaches, etc).&lt;/p&gt;

&lt;p&gt;Some cross-platform tools, like React Native, Ionic, and Flutter came to help us to build once and deploy on both platforms.&lt;/p&gt;

&lt;p&gt;In this post, I will show you a visual guide to illustrate the difference between all of them. Let's get started!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ionic&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N0QVhXXb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/110o1esevw9mrgej6i0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N0QVhXXb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/110o1esevw9mrgej6i0u.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is like a dream, write code with HTML, CSS, and JS, and deploy to iOS and Android. The app is a website. To achieve that, tools like Ionic, Cordova, and PhoneGap uses a WebView to render the code. But there is a bottleneck: performance. If the app needs to access hardware services (GPS, sensors, etc) it needs to cross a famous bridge. But if your app does not need those services, this tech should be on your radar.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Native Platform&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_p1mzBdS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/j1zryrthzpghgc6u4sqq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_p1mzBdS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/j1zryrthzpghgc6u4sqq.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your code (kotlin/swift) interact directly with the platform. If you need a button, the platform provides that button. Access to the camera? No worries too. Thit is the best option for mobile development! But you can't code once and deploy to both platforms. You need to write an app to iOS and other to Android, which makes this choice expensive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React Native&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--waRkpINu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/dk7dftz3wmxybw6q89hy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--waRkpINu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/dk7dftz3wmxybw6q89hy.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
The tool powered by Facebook is so far the most popular choice for cross-platform development. It has a huge community, widely used by a ton of companies, uses Javascript. React Native truly provides an excellent way to build high-quality mobile apps if you are a frontend developer. But is uses the bridge extensively, for hardware services and native components (buttons, text fields), which can bring some performance issues, especially with animations.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flutter&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A68yNsky--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/ix1qc6kn9pe9jcmvoy3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A68yNsky--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/ix1qc6kn9pe9jcmvoy3m.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
The youngest option for cross-platform development (by Google), has a peculiar aspect: it uses Dart language (also by Google), which enables the code to be compiled (AOT) to arm/x86, wich is straightforward runs on the hardware (if you need need a button, Flutter paint it on screen, if you need to interact with hardware, Flutter provides a plugin ). It has 71k+ stars on the repository, gradually being adopted by big companies (Alibaba, Tencent, BMW). It has some weakness, like 7k+ issues and the fact that you have to learn Dart (but this doesn't make sense, if you know JS, Java, or any C-style language).&lt;/p&gt;




&lt;p&gt;I hope you now know the differences between each option and have more clarity to choose one to learn and or use in your next project.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>flutter</category>
      <category>ionic</category>
      <category>mobiledevelopment</category>
    </item>
    <item>
      <title>Flutter: Widget tree and state management</title>
      <dc:creator>rubensdemelo</dc:creator>
      <pubDate>Tue, 02 Jul 2019 07:43:09 +0000</pubDate>
      <link>https://dev.to/rubensdemelo/flutter-widget-tree-and-state-management-31an</link>
      <guid>https://dev.to/rubensdemelo/flutter-widget-tree-and-state-management-31an</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;In Flutter, everything is a widget&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Widget tree&lt;/strong&gt; is a structure that represents how our widgets are organized.&lt;/p&gt;

&lt;p&gt;Web pages have a &lt;strong&gt;DOM&lt;/strong&gt; and Flutter have a &lt;strong&gt;Widget Tree&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Flutter also uses a declarative UI approach, it means that the interface represents the state of the app. &lt;br&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%2Fuploads%2Farticles%2Fxikgyblsv4zcrmucpol7.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%2Fuploads%2Farticles%2Fxikgyblsv4zcrmucpol7.png" alt="Declarative UI"&gt;&lt;/a&gt;&lt;br&gt;
So, as we build our application, composing widgets to each other, this structure can (and certainly will) grow. As it gets bigger, it gets more complicated to represents the state of our application in the interface.&lt;/p&gt;

&lt;p&gt;The image below is from &lt;a href="https://flutter.dev/docs/development/data-and-backend/state-mgmt/intro" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; and represents perfectly a shopping cart: &lt;br&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%2Fuploads%2Farticles%2Fp4ahmwwi8uodyteqf8yj.gif" 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%2Fuploads%2Farticles%2Fp4ahmwwi8uodyteqf8yj.gif" alt="Widget Tree"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MyApp - The root widget. Our app starts here.&lt;/li&gt;
&lt;li&gt;MyLoginScreen - Initial screen.&lt;/li&gt;
&lt;li&gt;MyCatalog - After sign in, the screen has a list of products and an app bar which allow the user to access the cart.&lt;/li&gt;
&lt;li&gt;MyCart - When the user chooses a product, that one is put within the cart.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key point here is the user action to add products to the cart, because you need to inform MyCart, that your status has changed, now it has 1 item (MyListitem).&lt;/p&gt;

&lt;p&gt;In this scenario, our widget tree is small. Imagine if within the catalog we had a division by categories and sub-categories or that in the cart we could have a wishlist, gift list or the user having a screen with details of your profile, history of all purchases. Easily our widget tree will become bigger and more complex.&lt;/p&gt;

&lt;p&gt;So, we have several widgets that can consume and/or update the state of the application.&lt;/p&gt;

&lt;p&gt;Knowing this, from now on, we will be guided by the "rule" below:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Only rebuild the required amount of widgets when the application state changes.&lt;br&gt;
How to follow this rule? Using some &lt;a href="https://flutter.dev/docs/development/data-and-backend/state-mgmt/options" rel="noopener noreferrer"&gt;state management&lt;/a&gt; solution.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;State Management&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This isn't a simple topic in any framework. And with Flutter isn't different.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Flutter is a non-opinated framework, that is, it does not "think" how you should do things. It does not force you to use embedded solutions and/or patterns. It leaves you free to choose the most suitable solution for your project.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And Uncle Ben already teach us: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;With great power, comes great responsibility&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Choosing the right solution for your project is fundamental to a good development cycle. You can not get ahead to find out that the chosen solution has become a bottleneck and is making it difficult to maintain, create new features or even limit the expansion of our app.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;There is no better solution or a solution to every problem. Each of them has its strengths and weaknesses.&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;On the next article, I will write a bit about scoped_model and provider.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/brianegan/scoped_model" rel="noopener noreferrer"&gt;scoped_model&lt;/a&gt;&lt;/strong&gt; was the first package explicitly recommended by Flutter documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/rrousselGit/provider" rel="noopener noreferrer"&gt;provider&lt;/a&gt;&lt;/strong&gt; is the newest recommendation. Flutter team endorsed the use of this package on state at last Google IO. It is more robust than scoped_model and still easy to understand.&lt;/p&gt;

&lt;p&gt;See you soon :)&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>ios</category>
      <category>android</category>
    </item>
    <item>
      <title>How to not start with Flutter</title>
      <dc:creator>rubensdemelo</dc:creator>
      <pubDate>Sat, 25 May 2019 13:12:15 +0000</pubDate>
      <link>https://dev.to/rubensdemelo/how-to-not-start-with-flutter-1dcl</link>
      <guid>https://dev.to/rubensdemelo/how-to-not-start-with-flutter-1dcl</guid>
      <description>&lt;h1&gt;
  
  
  How to not start with Flutter
&lt;/h1&gt;

&lt;p&gt;Some days ago I posted on twitter my biggest mistake about learning Flutter:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mR9PCT7C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/v70ovz2syg4r2u2pfooq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mR9PCT7C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/v70ovz2syg4r2u2pfooq.png" alt="" width="800" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Now, provider package is the new recomendation by Flutter docs)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Motivated by a lot of questions on Stack Overflow about "BLoC" pattern,&lt;br&gt;
I decided to share on Twitter (and surprisingly got some nice feedbacks) and now write this post to help future flutter developers.&lt;/p&gt;

&lt;p&gt;Almost every single day, newcomers on flutter post questions about "BLoC" or even worst, about packages that makes "simple" to implement this pattern.&lt;/p&gt;

&lt;p&gt;You have other topics that really matter in the beginning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dart language (even if it is not hard)&lt;/li&gt;
&lt;li&gt;Widget tree&lt;/li&gt;
&lt;li&gt;Box Constraints&lt;/li&gt;
&lt;li&gt;Basic widgets&lt;/li&gt;
&lt;li&gt;Stateless and Stateful widgets&lt;/li&gt;
&lt;li&gt;Navigation&lt;/li&gt;
&lt;li&gt;Widgets lifecycle&lt;/li&gt;
&lt;li&gt;Material and Cupertino packages&lt;/li&gt;
&lt;li&gt;Keys&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you need to share values between widget or pass them down in your widget tree, use InheritedWidget, it is easy and probably meet what you need in the first steps. If you already use MediaQuery.of(context) or Theme.of(context), you already used &lt;a href="https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html"&gt;InheritedWidget&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And even after having good knowledge about topics above, when you started with state management, there are excellent packages to start: &lt;a href="https://pub.dev/packages/scoped_model"&gt;scoped_model&lt;/a&gt; and the most recent and powerful &lt;a href="https://pub.dev/packages/provider"&gt;provider&lt;/a&gt;. I strongly recommended &lt;a href="https://pub.dev/packages/scoped_model"&gt;scoped_model&lt;/a&gt;. It is simple to understand, well documented, works fine for small and medium apps (no matter how complexity app is) and was explicitly the first package about state management recommended by Flutter docs (and now &lt;a href="https://pub.dev/packages/provider"&gt;provider&lt;/a&gt; is the new black).&lt;/p&gt;

&lt;p&gt;Keep in mind that state management isn't a simple topic, there isn't a better approach and Flutter let you chose whatever solution you want. And the most important on your journey is to discover what solution fits your needs and what solution you feel more comfortable and confident to use in your app.&lt;/p&gt;

&lt;p&gt;In conclusion, would like to point that this article is not against Bloc pattern (definitely not). It is just an advice for those who are arriving in Dart &amp;amp; Flutter side and may be frustrated trying to implement Bloc when they don't need.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>ios</category>
      <category>android</category>
    </item>
    <item>
      <title>Flutter Forms: Improving UX with SingleChildScrollView</title>
      <dc:creator>rubensdemelo</dc:creator>
      <pubDate>Tue, 15 Jan 2019 20:33:02 +0000</pubDate>
      <link>https://dev.to/rubensdemelo/flutter-forms-improving-uiux-with-singlechildscrollview-36gd</link>
      <guid>https://dev.to/rubensdemelo/flutter-forms-improving-uiux-with-singlechildscrollview-36gd</guid>
      <description>&lt;p&gt;Some times the first user interaction with our app is a login/register screen. As a great Flutter developer, we would like to provide the best experience. Ever. So, we do your best and make a gorgeous screen.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Easy to combine a Colum(), TextFormField(), MaterialButton(), SizedBox(), centered with Center(), a small Padding() and voilà:&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Foek5rql5kzfi4vdybrnq.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Foek5rql5kzfi4vdybrnq.png" alt="Login Screen"&gt;&lt;/a&gt;&lt;br&gt;
It’s done! Really beautiful, then we started our tests and…&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqgd2rd3jvpwbrvnqfheu.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqgd2rd3jvpwbrvnqfheu.png" alt="Somethin gets wrong"&gt;&lt;/a&gt;&lt;br&gt;
Yep, something crash in our screen. If we try oll up, it won’t work.&lt;br&gt;
Alright, let’s check messages on console:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
In technical terms, the size of our viewport were reduced and it caused a overflow on our layout.&lt;br&gt;
But Flutter error messages are awesome! It suggests:&lt;br&gt;
&lt;code&gt;consider clipping it with a ClipRect widget before putting it in the flex&lt;/code&gt;&lt;br&gt;
Or:&lt;br&gt;
&lt;code&gt;using a scrollable container rather than a Flex &lt;/code&gt;

&lt;p&gt;Searching on docs we found a Scrollable widget: A widget that scrolls. Fine, but on next paragraph: It’s rare to construct a Scrollable directly.&lt;/p&gt;

&lt;p&gt;Got it. Once it’s rare, we probably don’t need to build it.&lt;/p&gt;

&lt;p&gt;But, what widget solve our problem ?&lt;/p&gt;

&lt;p&gt;A built-in widget provided by Flutter and works perfectly in this case is &lt;a href="https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html" rel="noopener noreferrer"&gt;SingleChildScrollView&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This widget is useful when you have a single box that will normally be entirely visible.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a &lt;strong&gt;superpower&lt;/strong&gt; widget.&lt;/p&gt;

&lt;p&gt;First, let’s try to fix our screen and then dive deep into this widget. Wrapping our Center() as SingleChildScrollView() child’s.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fmee8vj88h7ku7feumfek.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fmee8vj88h7ku7feumfek.png" alt="Perfect"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well done! Our screen now works perfectly. We can roll up and down and everything is fine!&lt;/p&gt;

&lt;p&gt;SingleChildScrollView supports following parameters:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;child:&lt;/strong&gt; (Widget) — The widget that scrolls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;controller:&lt;/strong&gt; (ScrollController) — An object that can be used to control the position to which this scroll view is scrolled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;padding:&lt;/strong&gt; (EdgeInsetsGeometry) — The amount of space by which to inset the child.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;physics:&lt;/strong&gt; (ScrollPhysics) — How the scroll view should respond to user input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;primary:&lt;/strong&gt; (bool) — Whether this is the primary scroll view associated with the parent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;reverse:&lt;/strong&gt; (bool) — Whether the scroll view scrolls in the reading direction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;scrollDirection:&lt;/strong&gt; (Axis) — The axis along which the scroll view scrolls.&lt;/p&gt;

&lt;p&gt;And as I said before, this is a superpower widget and we will explore on next article.&lt;/p&gt;

&lt;p&gt;Thanks for reading. See you soon &lt;/p&gt;

&lt;p&gt;:)&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>ios</category>
      <category>android</category>
    </item>
    <item>
      <title>Flutter: Formatting TextField with TextInputFormatter</title>
      <dc:creator>rubensdemelo</dc:creator>
      <pubDate>Fri, 11 Jan 2019 20:27:04 +0000</pubDate>
      <link>https://dev.to/rubensdemelo/flutter-formatting-textfield-with-textinputformatter-1oii</link>
      <guid>https://dev.to/rubensdemelo/flutter-formatting-textfield-with-textinputformatter-1oii</guid>
      <description>&lt;p&gt;A common task in mobile apps is formatting fields, like credit cards, phone numbers, zip code, etc. In Flutter, we achieve this using &lt;a href="https://docs.flutter.io/flutter/services/TextInputFormatter-class.html"&gt;TextInputFormatter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In TextFormField and TextField, the property inputFormatters allows you to pass a list of TextInputFormatter to define how that field will behave.&lt;/p&gt;

&lt;p&gt;There are 3 useful built-in implementations:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.flutter.io/flutter/services/LengthLimitingTextInputFormatter-class.html"&gt;LengthLimitingTextInputFormatter:&lt;/a&gt; prevents the insertion of more characters than a limit;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.flutter.io/flutter/services/WhitelistingTextInputFormatter-class.html"&gt;WhitelistingTextInputFormatter:&lt;/a&gt; allows only the insertion of whitelisted characters patterns;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.flutter.io/flutter/services/BlacklistingTextInputFormatter-class.html"&gt;BlacklistingTextInputFormatter:&lt;/a&gt; prevents the insertion of blacklisted characters patterns.&lt;/p&gt;

&lt;p&gt;And they have some static properties to help us:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WhitelistingTextInputFormatter&lt;/strong&gt;.&lt;em&gt;digitsOnly&lt;/em&gt;: takes in digits [0–9] only.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BlacklistingTextInputFormatter&lt;/strong&gt;.&lt;em&gt;singleLineFormatter&lt;/em&gt;: forces input to be a single line;&lt;/p&gt;

&lt;p&gt;You can combine formatters:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;With RegExp, you can customize your formatters (as above properties does):&lt;/p&gt;

&lt;p&gt;&lt;code&gt; WhitelistingTextInputFormatter(RegExp("[a-zA-Z]")) &lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt; BlacklistingTextInputFormatter(RegExp("[/\\]")) &lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It is simple and easy to use, but some times you need create your own formatter. And it is easy too. Just extend TextInputFormatterand implement &lt;em&gt;formatEditUpdate&lt;/em&gt;  method.&lt;/p&gt;

&lt;p&gt;Take a look on the code bellow, from &lt;strong&gt;flutter_gallery&lt;/strong&gt; example app:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;As we can see, there is no limit.&lt;/p&gt;

&lt;p&gt;Flutter offers to developers excellent built-in formatters and makes easy to extend and create our own. Let’s use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make easy to your user input data in form fields with formatters.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>android</category>
      <category>ios</category>
    </item>
  </channel>
</rss>
