Return to the first route using Navigator.pop() method

Now, we need to use Navigator.pop() method to close the second route and return to the first route. The pop() method allows us to remove the current route from the stack, which is managed by the Navigator.To implement a return to the original route, we need to update the onPressed() callback method in the SecondRoute widget as below code… Continue reading Return to the first route using Navigator.pop() method

Navigate to the second route using Navigator.push() method

The Navigator.push() method is used to navigate/switch to a new route/page/screen. Here, the push() method adds a page/route on the stack and then manage it by using the Navigator. Again we use MaterialPageRoute class that allows transition between the routes using a platform-specific animation. The below code explain the use of the Navigator.push() method.

Create two routes

Here, we are going to create two routes for navigation. In both routes, we have created only a single button. When we tap the button on the first page, it will navigate to the second page. Again, when we tap the button on the second page, it will return to the first page. The below code snippet… Continue reading Create two routes

Navigation and Routing

Navigation and routing are some of the core concepts of all mobile application, which allows the user to move between different pages. We know that every mobile application contains several screens for displaying different types of information. For example, an app can have a screen that contains various products. When the user taps on that product, immediately… Continue reading Navigation and Routing

Flutter IDE

IDE (editors) are software programs that allow the user to create and edit text files. In the development field, editors usually refer to the source code editors that include many special features for writing and editing code. We can create Flutter apps using any text editor that can easily combine with our command-line tools. However,… Continue reading Flutter IDE

Flutter State Management

In this section, we are going to discuss state management and how we can handle it in the Flutter. We know that in Flutter, everything is a widget. The widget can be classified into two categories, one is a Stateless widget, and another is a Stateful widget. The Stateless widget does not have any internal state. It means once… Continue reading Flutter State Management

Flutter Gestures

Gestures are an interesting feature in Flutter that allows us to interact with the mobile app (or any touch-based device). Generally, gestures define any physical action or movement of a user in the intention of specific control of the mobile device. Some of the examples of gestures are: When the mobile screen is locked, you… Continue reading Flutter Gestures

Building Complex Layout

In this section, we are going to learn how you can create a complex user interface using both single and multiple child layout widgets. The layout framework allows you to create a complex user interface layout by nesting the rows and columns inside of rows and columns. Let us see an example of a complex… Continue reading Building Complex Layout

Types of Layout Widgets

We can categories the layout widget into two types: Single Child Widget Multiple Child Widget Single Child Widgets The single child layout widget is a type of widget, which can have only one child widget inside the parent layout widget. These widgets can also contain special layout functionality. Flutter provides us many single child widgets to make… Continue reading Types of Layout Widgets

Flutter Layouts

The main concept of the layout mechanism is the widget. We know that flutter assume everything as a widget. So the image, icon, text, and even the layout of your app are all widgets. Here, some of the things you do not see on your app UI, such as rows, columns, and grids that arrange,… Continue reading Flutter Layouts