May I ask simple question that I'd like to define about color as externanl code from main dart as folloes. How ever it's not allowed and flutter says "A value of type 'Color' can't be returned from the method 'build' because it has a return type of 'Widget'"
I guess it's because that Color Class is not Widget and it could not be retured as widget.
class MainColor extends StatelessWidget{
@override
Widget build(BuildContext context) {
return Color(0xFF4BB574);
}
}
I also understand that it can treat as funtion like
Color mainColor(){
return const Color(0xFF4BB574);
}
But how can I define as class like above and treat as external file ?