我正在尝试跨页面使用provider来设置状态。但这是不会改变的。 我已在main.dart main.dart中添加了changeNotifierProvider class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
在用户(Provider:^4.3.2+3)中包装文本小部件时,编译器会给出以下错误-
The argument type 'Set<Widget>' can't be assigned to the parameter type 'Widget'.
在从集合中删除返回类型<Widget>时,给出以下错误-
The argument type 'Set<StatelessWidget>' can't be assigned to the parameter type 'Widget&
我有一个供应商和导航的问题。
我有一个包含对象列表的HomeScreen。当你点击一个对象时,我会导航到一个带有标签导航的DetailScreen。此DetailScreen由提供ViewModel的ChangenotifierProvider包装
现在,当我使用Navigator.of(context).push(EditScreen)导航到另一个屏幕时,我无法在EditScreen中访问ViewModel,会抛出以下错误
════════ Exception caught by gesture ═══════════════════════════════════════════
The
我在使用提供程序包通过SnackBar显示消息时遇到了问题。我得到的错误消息是:
VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
At this point the state of the widget's element tree is no longer stable.
To safely refer to a widget's ancestor in its dispose() method, s
我正在使用块模式进行状态管理,当我使用WPUserInfoResponse方法访问用户数据来设置currentuser时,在我登录并试图访问用户页面上的currentuser时,我仍然得到null。
不断收到错误
The following NoSuchMethodError was thrown building UserPage(dirty, dependencies:
[InheritedProvider<Wordpress>], state: _UserPageState#df273):
The getter 'username' was