What corresponds to Intent in Flutter?

In Android, Intent there are two main uses: for activity jumping between, and for communication between components. 
But in flutter there is  no Intent such concept, although you can still start via local integration native integrations(using plugins ) Intent.

Flutter As there is no activity, fragmentthe component corresponding to the direct, but rather Navigator, Route to switch between the screens with which activity .

Route is the abstraction of the application screen and page, but Navigator is a management Route control . It can be Route seen roughly activity, but they have different meanings. Switch the screen Navigator by push and pop(can be seen as pushing and popping) Route, and the Navigator working principle can be seen as a stack, which push means switching forward and pop returning.

In Android, you need Android Manifest.xmlto declare activity, and in Flutter , you have the following page switching options:

Specify a () containing all Route names Map MaterialApp
Switch directly to Route(WidgetApp)
The following example is the Mapw ay:

void main() {
  runApp(MaterialApp(
    home: MyAppHome(), // becomes the route named '/'
    routes: <String, Widget Builder> {
      '/a': (BuildContext context) => MyPage(title: 'page A'),
      '/b': (BuildContext context) => MyPage(title: 'page B'),
      '/c': (BuildContext context) => MyPage(title: 'page C'),
    },
  ));
}


The following is the way to go Routedirectly pushto Navigatorthe name :

Navigator.of(context).pushNamed('/b');


Another use Intentcase is to call external components, such as cameras, file selectors. In this case, you need to create a native platform integration (native platform integration), or use an
 


Flutter Questions

Android Questions

Python Questions

Java Questions