Flutter – Progress Border
While Loading the data user needs to wait a while, During this time we can show the loading circular in Flutter Applications. Flutter is awesome as it gives you packages that make your application easy to implement, fast and pretty. While fetching the data from the database and APIs data may come after some time, so during this time we have to await for the data and we can show another widget at that time called loading borders. Progress Border is the Flutter widget, where we can make loading animation for our app screen. A sample video is given below to get an idea about what we are going to do in this article.
Step By Step Implementation
Step 1: Create a New Project in Android Studio
To set up Flutter Development on Android Studio please refer to Android Studio Setup for Flutter Development, and then create a new project in Android Studio please refer to Creating a Simple Application in Flutter.
Step 2: Import the Package in the pubspec.yaml File
Now we need to import the package into the pubspec.yaml file, which you find at the last of the root folder. From the command line:
This will add a line like this to your package’s pubspec.yaml (and run an implicit flutter pub get):
Step 3: Import the package into the main file
Step 4: We need to create the animation controller that controls the animation of the border loader.
Step 5: Creating the method restart that basically implements our logic of animation, We have to animation, reverse, and forward. We will use the material button to call the restart method and animate according to the status of the animation Controller.
Step 6: Use of the widget progress border is pretty simple. If any widget uses the border, we can use the progress border widget instead of using the simple border-radius to give the border to the containers.
Please Login to comment...