【发布时间】:2021-04-10 06:11:54
【问题描述】:
这显示在 android studio 构造函数返回的类型 'dynamic' 不是预期的类型 'Widget' 并且还给了我这个参考 package:flutter/src/material /scaffold.dart
body: new Container(
child: new Column(
children: <Widget>[
new Flexible(
child: new FirebaseAnimatedList(
query: reference,
padding: const EdgeInsets.all(8.0),
reverse: true,
sort: (a, b) => b.key.compareTo(a.key),
itemBuilder: (_, DataSnapshot messageSnapshot, Animation<double> animation, int index) {
return new ChatTextController(
messageSnapshot: messageSnapshot,
animation: animation,
);
},
),
),
new Divider(height: 1.0),
new Container(
decoration:
new BoxDecoration(color: Theme.of(context).cardColor),
child: _buildTextComposer(),
),
new Builder(builder: (BuildContext context) {
_scaffoldContext = context;
return new Container(width: 0.0, height: 0.0);
})
],
),
decoration: Theme.of(context).platform == TargetPlatform.android
? new BoxDecoration(
border: new Border(
top: new BorderSide(
color: Colors.grey[200],
)))
: null,
)
【问题讨论】:
-
引用
package:flutter/src/material/scaffold.dart表示您的问题与Scaffold的构造函数有关。您是否在任何特定行上收到此错误?是你得到的所有信息还是有更详细的错误信息?
标签: firebase flutter dart firebase-realtime-database