import 'package:flutter/material.dart';
class ProductInfor extends StatefulWidget {
Map arguments;
ProductInfor({Key key,this.arguments}): super(key:key);
@override
_ProductInforState createState() => _ProductInforState(arguments:this.arguments);
}
class _ProductInforState extends State<ProductInfor> {
Map arguments;
_ProductInforState({this.arguments});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Text('商品详情页面${arguments["id"]}'),
);
}
}
import 'package:flutter/material.dart';
class SearchPage extends StatelessWidget {
// final arguments;
SearchPage({this.arguments});
final Map arguments;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("搜索${arguments!=null?arguments['id']:'0'}"),
),
body: Container(
child: Text('${arguments!=null?arguments["id"]:"0"}'),
),
);
}
}
flutter有状态组件传值 无状态传值
最新推荐文章于 2024-11-08 16:39:49 发布