flutter - 在状态类中使用私有字段的感觉
问题描述
在状态类中使用私有字段是什么感觉?你打算做一个_SimpleExampleState
其他人的例子吗?在哪里?!已经是私有的_SimpleExampleState
,那为什么那些人将私有用于状态类字段?
举一个可能有帮助的例子。
...
class _SimpleExampleState extends State<SimpleExample> {
final GlobalKey<ScaffoldMessengerState> _scaffoldMessengerKey =
GlobalKey<ScaffoldMessengerState>();
ReactionDisposer? _disposer;
@override
void initState() { ...
解决方案
推荐阅读
- c# - QuickBooks Retrieve of Customers Fails
- pandas - Pandas plot bar: legends of other columns appears in plot
- angular - 与 Angular 5 异步的后果
- python - CSRF 验证因使用模型而失败
- javascript - get dynamic table value on button click
- java - RecyclerAdapter getItemCount 崩溃
- spring - Rabbit mq message duplication
- angular - 外部货币转换器 api 在角度应用程序中不返回数据
- javascript - 获取多个 contenteditable div 中的最新插入符号位置,并将图像附加到光标最后出现的 div
- mysql - 如何在 CodIgniter 中的查询中选择特定数字作为列值