天天看点

传参

raisedbutton(

child: text("跳转到搜索页面"),

onpressed: (){

navigator.of(context).push(

materialpageroute(

builder: (buildcontext context){

return formpage(title:"表单"); //传值

}

)

);

},

color: theme.of(context).accentcolor,

texttheme: buttontexttheme.primary

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

// 接收

class formpage extends statelesswidget {

final string title;

formpage({this.title="表单"});

@override

widget build(buildcontext context) {

return scaffold(

floatingactionbutton: floatingactionbutton(

child: text('返回'),

onpressed: (http://www.amjmh.com/v/){

navigator.of(context).pop(); // 返回上一层

),

appbar: appbar(

title: text(this.title),

body:...

————————————————