Hello 2021! We all are somehow struggling to restore our lives from the pandemic, most of the activities of our lives have been sort-of in the background, and waiting to come back in some time [some of them obviously got killed by our life’s operating system].
So to begin this year, let’s learn something related to state restoration in general and how to implement it in Flutter. We will learn the following in this article:
You must have…
2020 has been tough, and people have been staying home for months now. Amidst this pandemic, we continued to carry out out community events through the platform of Flutter Karachi, Pakistan; and it has been amazing to learn a lot of novel things during this time. During the time of Flutter Day community events, we came up with the idea of hosting an online quiz competition which was followed by a complete separate Quiz League which was one of its own kind, the winners of which were shipped a Flutter Box. …
Rather than writing setState every time you need to change UI, a cleaner way can be to use notifiers and listeners to let the UI change itself.
In this article we will look at the basic counter example and try to convert it to a cleaner version without using any external libraries or packages.
When you create a new Flutter application you get the following code
class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; void _incrementCounter() { setState(() {…
This short article gives you some code and loops to create the mathematical Dragon Curve fractal using only canvas.drawLine() function inside dart:ui class!
The algorithm is simply recursive, telling each iteration to add the previous one into it and rotate itself 90 degrees every time.
This is the simple code with a loop (inspired by a java code for the same fractal) which does the main work of painting the lines recursively with rotated iterations.
double angle = startingAngle; int x1 = xStart, y1 = yStart; int x2 = x1 + (cos(angle) * side).toInt(); int y2 = y1 + (sin(angle)…
As a beginner, you must have wondered how an onTap function works on a ListTile. Or questions like “What if I want to invoke a function, defined in my parent widget, from within a child widget?” must have crossed your mind. Here in this very short article we will understand how to create callbacks in our custom widgets in Flutter.
Let’s first create a custom widget and call it in our main code like this:
class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> {…
Today we will see how we can efficiently make API calls in Flutter using Test-Driven Approach. We will be using a sample user API publicly available at JSON placeholder.
IMPORTANT: If you want to know the approach, you will have to follow things from the beginning to the end. Jumping at the end and copying the code will make no difference because it is simply 4 lines of an API call. The actual essence lies in the understanding of TDD Philosophy.
So without wasting your time and my words, we jump to creating a new test file under the test…
This article will show you how to build a complete end-to-end Flutter application using MVC and Provider. I have built a COVID-19 statistics application (because you know dash-boarding reveals a lot of valuable results!)
We will be using MVC to architect our app for decoupling the UI, the model classes, the controller class and the network layer. We will be using the following packages:
Provider will be used to inject Theme — dark mode of course :D
This application uses publicly available APIs for COVID-19, hosted by Javier Aviles. …
The following passage is a brief summary of the philosophy behind Google Developer Experts Program (according to my personal experience). You will clinch through the following as you progress in this article
According to the official website:
“The Google Developers Experts program is a global network of highly experienced technology experts, influencers and thought leaders who actively support developers, companies and tech communities by speaking…
For this, I decided to write a very small plugin that let’s you send the name of the app icon to the plugin and it does all the work inside by itself! =]
The plugin is called app_icon_changer
PS: This package doesn’t support Android implementation and only supports iOS 10.3 and above. There are multiple hacks available for changing android app icons but none of them is officially supported by Android
Briefly, these are the few steps you need to perform in order to be able to consume the plugin successfully.
You probably know me.