why I got : The named parameter 'shape' and 'splashColor' isn't defined On my flutter application?

Viewed 31

I'm trying to add shape and splach color to my textButton But I always got : The named parameter 'shape' and 'splashColor' isn't defined On my flutter application

this is the code:

  home: Scaffold(
        key: _scaffoldKey,
        appBar: AppBar(
          title: Text("Flutter Bluetooth"),
          backgroundColor: Colors.deepPurple,
          actions: <Widget>[
            TextButton.icon(
              icon: Icon(
                Icons.refresh,
                color: Colors.white,
              ),
              label: Text(
                "Refresh",
                style: TextStyle(
                  color: Colors.white,
                ),

               
              ),
            
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(30),
              ),
              splashColor: Colors.deepPurple,
              onPressed: () async {
                // So, that when new devices are paired
                // while the app is running, user can refresh
                // the paired devices list.
                await getPairedDevices().then((_) {
                  show('Device list refreshed');
                });
              },
            ),
          ],
        ),

I would be really thankful if you can help me and Thanks in advance.

1 Answers

TextButton.icon doesnt have those properties. for splashcolor you can wrap your button with inkwell and give the property there and you can wrap this inkwell wth a container and in this give a decoration property with BoxDecoration and give border in here

Related