Использование этой функции:
buildButton(int file_number, String yourcolor, [String text]){
return Expanded(
child: FlatButton(
color: Colors.yourcolor,
child: Text(text),
onPressed: (){
playaudio(file_number);
},
),);
}
Вкл. color: Colors.yourcolor
. Я получаю сообщение об ошибке:
The getter 'yourcolor' isn't defined for the class 'Colors'.
Try importing the library that defines 'yourcolor', correcting the name to the name of an existing getter, or defining a getter or field named 'yourcolor'.
Я знаю, что нет метода с именем 'yourcolor', но есть способ, которым я могу получить нужный цвет, используя функцию параметр