Good morning. Because my flatButton is deprecated, I've tried to convert it to a TextButton. But now it doesn't work.
This was my working FlatButton code:
Flexible(
flex: 4,
child: FlatButton.icon(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
onPressed: () {
Get.to(AddTaskPage());
},
color: Colors.orange[900],
icon: Icon(
Icons.add,
color: Colors.white,
),
label: Text("Add Task",
style:
regularBoldTxt.copyWith(color: Colors.white)),
),
)
This is the code of the conversion to Textbutton:
Flexible(
flex: 4,
child: TextButton(
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
onPressed: () {
Get.to(AddTaskPage());
},
textStyle: TextStyle(
color: Colors.orange[900],
icon: Icon(
Icons.add,
color: Colors.white,
),
label: Text("Add Task",
style:
regularBoldTxt.copyWith(color: Colors.white)),
)),