我正在尝试在我的应用程序中使用流提供程序,但是当我调用“流”时它返回错误,告诉我“未定义命名参数流”。这不是正确的称呼方式吗?
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
StreamProvider<FirebaseUser>.value(
stream: FirebaseAuth.instance.onAuthStateChanged),
],
child: MaterialApp(
title: 'Profile Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(title: 'Profile'),
),
);
}
}