A simple guide on how to set up and how to use Firebase Analytics in Flutter.

Photo by William Hook on Unsplash

Firebase Analytics has become an indispensable tool in the world of mobile development (similar to its twin Google Analytics in the web world). And integrating it in Flutter is not the easiest task on earth. This guide covers the configuration of your Firebase project, how to integrate it with Flutter, and how to use it.

General Setup

The first thing is to create a Firebase project on the Firebase console. To do so, just click on the above link. Then click on ‘Create a project.’.


Did you want to have the smooth design of the Scaffold view of the PlayStore in your Flutter app? Here is how.

Photo by UX Store on Unsplash

So just to make it clear, what we want to achieve today is the following behavior.


Did you wonder how to display a date field in Flutter? Here is how to do so!

Photo by Aron Visuals on Unsplash

What you probably did if you already have a DateField in your Flutter project is to create it from scratch! But did you know that you could use this package to simplify your life a lot?

First, as usual, just add it to your pubspec.yaml file.

dependencies:
date_field: ^0.1.2
...

Now after a little pub get you should be able to access the package content!

First, let’s just try to display a simple DateField in our view. There are two important parameters:

  1. onDateSelected which is triggered whenever the user picks a date!
  2. selectedDate which will be the date displayed in…


Photo by Sam Dan Truong on Unsplash

1. Always cancel your stream subscription:

When I started learning Flutter, I did not always think about canceling my stream subscription because that was something I never heard about.

But what I learned is that even if your widget is no longer alive, well, your stream subscription still is! And that can become a major issue when the widget is re-created a certain number of times, leading to possible process overload!

To prevent that, you could just add a conditional block that checks if the widget is mounted, but that would still result in a useless loss of performance.

So to prevent that here is how…


Here is the easiest way to manage your app’s connectivity using Flutter and the Connectivity package!

If you have an app that interacts with the outside world, you probably want to make sure that the user is connected before executing any HTTP request!

To accomplish that, we will employ the Connectivity package developed by the Flutter team.

Photo by Thomas Jensen on Unsplash

The Connectivity Package.

This package is rather useful to manage the state of your app’s depending on its current internet connection!

There are two important methods and one getter for the Connectivity class:

  • onConnectivityChanged: returns a Stream which will allow you to know whenever the connectivity of your app changes.
  • checkConnectivity: returns the current connectivity of your app.
  • getWifiName: returns the SSID


Were you wondering how could I create a stylish introduction view? No? Well here is how!

Photo by Fatos Bytyqi on Unsplash

Our goal

Here is what you should be able to reproduce at the end of this article!


Something very stylish those days is to have a responsive header in your ListView! And here is how to code it:

What does our goal looks like:


Coming from the web world, Flutter is the framework that changed my mind about mobile development! I believe that it is great and that it has a future full of promises!

Logo — Flutter

How it all started

After developing some websites and mobile app using Cordova, I got tired of HTML & CSS, I wanted something new, something that I had never tried in my entire life!

We could call it luck but not more than one month after the moment I started to look for something new, I started to work as a mobile developer for the University of Liège and I think that it won’t be a surprise for you anymore, we had to use Flutter!

In the beginning, I must say that I was not very confident about developing a complete mobile application using…


Dart is a single thread language, which means it works in a single execution thread! This can be a huge issue when you perform time-consuming tasks. For instance, when you create an application (with Flutter ❤), you do not want it to freeze when you make a request to your server (unless you do not like your users). Therefore, Dart implements Future objects.

Photo by Sonja Langford on Unsplash

Future

Future objects are representation of the result of an asynchronous operation that will be completed later on.

You can access the result of a Future by using the await keyword. But keep in mind that you can only use the await keyword in an asynchronous function which you declare by using the async keyword! You can specify the type of the returned value and if you do not return a concrete value you should specify the type as being void.

The Future object has very useful constructors. The default one takes an asynchronous function as an argument. …


When writing widgets with Flutter, you keep doing the same thing again again and again … After developing for over a year mobile applications with Flutter, I started to implement collections of widgets that I reuse everywhere in one or more applications. It goes from a simple custom RaisedButton to a custom Scaffold/Appbar and even up to a custom State. I compiled a list of what is most useful to do to save a lot of time while developing an application with Flutter.

Custom widgets to replace buttons

The first very usefull thing to do is to create custom widgets for all the kinds of…

Gaspard Merten

Engineering student and IT enthusiast. I developed many softwares for various startups and well-established companies, thus further enhancing my Flutter skills.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store