Is it possible to create a class that extends a class extending StatelessWidget or StatefulWidget.
For example:
class MyButton extends StatelessWidget {
final String label;
Button({this.label});
@override
Widget build(BuildContext context) {
return ButtonExample("label");}
}
then
class SubmitButton extends MyButton
{
String label;
SubmitButton({Key key, this.label}) : super(label: label);
// then somehow extend the parent build and change only the color
// or in case of StatefulWidget change a functionality
}
I tried to search for examples online but I had not success.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…