flutter route

1, the basic routing Jump

// first introduced components need to jump 
Navigator.of (context) .push ( 
    MaterialPageRoute ( 
        Build: (context) => jump to assembly; 
    ) 
);

2, the value of the jump pass

//formPage页
.
.
string title;
FormPage({this.title="表单页"});
Widget build(BuildContext context){
    return Scaffold(
        appBar:AppBar(
            title: Text(this.title),
        )
    )
}
//other页
.
.
 body:container(
            child:RaisedButton(
                child: text('mmm'),
                onpressed:(){
                    Navigator.of(context).push(
                        MaterialPageRoute(
                            builder:(context) => FormPage(title: '我是表单页')
                        )
                    )
                }
        )
 )

 

Guess you like

Origin www.cnblogs.com/xhrr/p/11443755.html