I have added a border to my TextButton but am not sure how to change its colour (only outline colour not background):
TextButton(
style: ButtonStyle(
shape: MaterialStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0)))),
onPressed: () {
replacePoints();
},
child: Text(
"${AppLocalizations.of(context)!.replacePoints} ",
style: TextStyle(color: Colors.white),
))
Thanks in advanced.
CodePudding user response:
Try this:
TextButton(
style: ButtonStyle(
shape: MaterialStateProperty.all(RoundedRectangleBorder(
side: BorderSide(
color: Colors.red, // your color here
width: 1,
),
borderRadius: BorderRadius.circular(0)))),
onPressed: () {
replacePoints();
},
child: Text(
"${AppLocalizations.of(context)!.replacePoints} ",
style: TextStyle(color: Colors.white),
))
CodePudding user response:
Try below code you will change Border color in two ways