You can add a border to any widget in Flutter.All you have to do is to make Container widget as the parent of the target widget.The Container contains a decoration parameter which can be manipulated as per requirement.Suppose we have a Text widget like:- This...
Siddhant Badola
How to create a custom round icon button similar to FloatingActionButton
While FloatingActionButton always comes in handy when making a prominent icon button, sometimes we want to customize the button to suit our needs.For this we can use RawMaterialButton to get the customization we want.An example is given below:-
How to add an image as background image in Flutter page/activity
To add an image as background image in Flutter we can simply add the following code:- In the above code we use a Container() inside the Scaffold widget which gives us many customization options, one of which is decoration: parameter in which we will supply...
How to show Progress Indicator for Async tasks in Flutter
Today, we will be learning how to show the Progress Indicator while async tasks are performed in Flutter. Many times we require the progress indicator widget to show the user that a task is being performed, this makes sure the user does not get confused...
How to convert String to List in Flutter
There are cases when we need to break down the string into smaller parts and store them individually.We can achieve this by simply passing the .split() function to the string.Syntax for this looks like:- Here <String variable> is variable of type String and <separator> is...
How to disable a button in Flutter.
To disable a Button in Flutter, we can simply give the onpressed: parameter a null value. This will disable the button. Something like this will work:- But our button will be of no use like this. Instead, a better approach is to create a helper...
How to use Hexadecimal color strings in Flutter.
By default we get the Colors widget in Flutter which comes with set of predefined material design colors like Grey,Red,Yellow etc. But oftentimes we require custom colors in the UI of our app. We can use the Color method which contains two constructors .fromRGBO() and...
How to reverse a list in Flutter
Remember to add .toList() after reversed so that the function returns a List. Without .toList(), the function will return a Iterable. A simple example to reverse a list of integers is given below but you can use it with any List of predefined datatype.
How to navigate flutter pages without context
There are certain situations in flutter development when we need to navigate to another page from outside the state widget.In such cases the (BuildContext)context is not available to the programmer and this can make it difficult for the programmer to navigate to the inteded page.For...