当前位置:网站首页>Flutter | specifies the type of page return value
Flutter | specifies the type of page return value
2022-07-24 00:21:00 【Stars without night】
Navigator.push(context,
MaterialPageRoute(builder: (context) => _Page2()))
.then((value) {
print(' The returned value is ===$value');
});
because push The return value type of method is :Future<dynamic>:

therefore .then there value yes dynamic Type of .
Sometimes we want to take value A property of , This is the time dynamic It's not easy to use .
Solution 1:
Type conversion :
final model = value as String;
Solution 2:
Specify the type of returned value :
Navigator.push<String>
边栏推荐
- Material return on investment
- The implementation in Oracle replaces the specified content of the specified column with the desired content
- GBase 8c 访问权限访问函数(四)
- GBase 8c 访问权限查询函数(一)
- 数据模型设计方法概述
- [Android kotlin] property, getter and setter
- GBase 8c 会话信息函数(五)
- Inode, soft link, hard link
- 理解多态,让不同的“人”做同一件事情会产生不同的结果
- [attack and defense world web] difficulty five-star 15 point advanced question: bug
猜你喜欢

FPGA - SPI bus control flash (3) including code

vulnhub wpwn: 1

Docker pulls the redis image and runs it

Beifeng communication appeared in China (Xiamen) emergency exhibition | intelligent communication means are strong and eye-catching!

PHP implements stripe subscription

Docker builds sonarqube, mysql5.7 environment

OA项目之我的会议(查询)

win10下基于anaconda的detectron2安装

English grammar_ Demonstrative pronoun - so

Xmind用例导入到TAPD的方案(附代码)
随机推荐
Intel Intel realsense realistic depth camera self calibration operation steps explanation D400 series is applicable
【语音合成】TensorFlowTTS 中文文本转语音
【译】Go RPC 入门:Hello World
Redis distributed lock to be continued
GBase 8c系统表信息函数(二)
PHP implements stripe subscription
[translation] Introduction to go RPC: Hello World
如何提升数据质量
GBase 8c 访问权限查询函数(三)
加密技术应用
L2TP的LAC自动拨号实验
2022年7月23日——mapper文件说明
腾讯将关闭“幻核”,数字藏品领域发展是否面临阻力?
As a programmer, is there anything you want to say to the newcomer?
自己喜欢投资
Multi knapsack explanation of dynamic programming knapsack problem
docker 拉取redis镜像 并运行
[wechat applet] design and interactive implementation of auction product details page (including countdown and real-time update of bids)
GBase 8c 会话信息函数(二)
[speech synthesis] tensorflowtts Chinese text to speech