Ad
OverflowBar's Children Must Not Contain Any Null Values, But A Null Value Was Found At Index 1
hi I work to update mobile application build with flutter .but when I run this app I get this error
OverflowBar's children must not contain any null values, but a null value was found at index 1
final rep = await showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text("Entrez votre constat : "),
content: new TextField(
keyboardType: TextInputType.multiline,
maxLines: 5,
controller: _constate,
),
actions: <Widget>[
FlatButton(
child: Text("Enregistrer"),
onPressed: () {
Navigator.pop(context, _constate.text);
},
),
c!=null?FlatButton(
child: Text("Supprimer"),
onPressed: () {
_deleteConstat(c, q);
Navigator.pop(context, null);
},
):null,
FlatButton(
child: Text("Anuller"),
onPressed: () {
Navigator.pop(context, null);
},
),
],
elevation: 23,
);
}); ```
Ad
Answer
This code is causing the error
c!=null?FlatButton(
child: Text("Supprimer"),
onPressed: () {
_deleteConstat(c, q);
Navigator.pop(context, null);
},
):null,
Prefer a SizedBox
for whitespace instead of null
Ad
source: stackoverflow.com
Related Questions
- → How do you create a 12 or 24 mnemonics code for multiple cryptocurrencies (ETH, BTC and so on..)
- → Flutter: input text field don't work properly in a simple example..... where am I wrong?
- → Can I customize the code formatting of Dart code in Atom?
- → Is it possible to develop iOS apps with Flutter on a Linux virtual machine?
- → Display SnackBar in Flutter
- → JSON ObjectMapper in Flutter
- → Material flutter app source code
- → TabBarSelection No such method error
- → How do I set the animation color of a LinearProgressIndicator?
- → Add different routes/screens to Flutter app
- → Is there a way to get the size of an existing widget?
- → How to share a file using flutter
- → Is there an easy way to find particular text built from RichText in a Flutter test?
Ad