Exit Confirmation in Flutter

We don’t want our users to Accidentally close our App. So, Confirmation Popups are a common feature in any Mobile App. We have a widget in Flutter for doing this. In Flutter, we have a widget Named WillPopScope. We just have to wrap our Page in this widget and provide a function to its onWillPop argument. It will be triggered when the user tries to close the current route. The onWillPop will accept a Future<bool> Function....

April 21, 2021 · 2 min · Muhammed Mukhthar CM

Show Licenses in Flutter

Every piece of software stands in the pillars of great open-source projects. So is Flutter. So at some point, we may like to show off that open-source love we have. Well, there is an easy way to show Licenses in Flutter. In Flutter, there is a Widget called LicensePage. It shows a list of all the licenses of the things which are used in Our App. And there is a Function showLicensePage....

March 28, 2021 · 1 min · Muhammed Mukhthar CM

How to change the Border Shape of InkWell widget?

In the post about Creating Custom Buttons, we found about the InkWell widget. Now that we are creating Custom Buttons, we have a problem. The default splash of the InkWell widget is almost rectangle type. What if we need our shape of splash to have a border-radius? To change the border of our splash to have a border-radius, we can the customBorder property of the InkWell widget. InkWell( customBorder: RoundedRectangleBorder( borderRadius: BorderRadius....

March 26, 2021 · 1 min · Muhammed Mukhthar CM

Create Custom Buttons in Flutter

The default set of Buttons in Flutter is very cool. But what if we have to design a custom button? Like an Image with rounded corners, when we click on it, it takes is to a details page. In this scenario, we can use InkWell widget. The InkWell widget has properties like onTap So we can put our function to be executed in that method. Suppose YourWidget is our custom fancy widget that we want to make a button....

March 25, 2021 · 2 min · Muhammed Mukhthar CM

Create a project with Custom Package Name in Flutter

Many times, I have been annoyed by the package name of my project. It always looked something like com.example.test_project I had to manually change it to my own package name. After Hunting for few hours, One day I found how to do it the right way. All I had to do was to pass my intended organization name to the flutter create command. For example, try running the below command in terminal...

March 24, 2021 · 1 min · Muhammed Mukhthar CM