Closure call with mismatched arguments: function

Viewed 176

I'm trying to show an Alert Dialog on pressing a button, but for some reason I get this error. I use the same code for another widget and it will show up with no problem I don't know why it doesn't work...

IconButton(
                        icon: Icon(Icons.delete),
                        color: Colors.red[400],
                        onPressed: () => showDialog(
                          context: context,
                          builder: (context) => AlertDialog(
                            title: Text(
                              'DELETE?'.toUpperCase(),
                            ),
                            actions: [
                              TextButton(
                                onPressed: (){},
                                child: Text("Yes"),
                              ),
                              TextButton(
                                onPressed: (){},
                                child: Text("No"),
                              ),
                            ],
                          ),
                        ),
                      ),

This is what I get:

Closure call with mismatched arguments: function '_HomeScreenState.getWalletsItemsFromDb.<anonymous closure>.<anonymous closure>'
Receiver: Closure: () => void
Tried calling: _HomeScreenState.getWalletsItemsFromDb.<anonymous closure>.<anonymous closure>(builder: Closure: (dynamic) => AlertDialog, context: Instance of 'StatelessElement')
Found: _HomeScreenState.getWalletsItemsFromDb.<anonymous closure>.<anonymous closure>() => void
0 Answers
Related