flexible method
Wraps this widget in a Flexible widget.
Parameters:
flex: Optional flex factorflexFit: Optional flex fit behavior
Implementation
Flexible flexible({int? flex, FlexFit? flexFit}) {
if (flex == null && flexFit == null) {
return Flexible(child: this);
} else if (flex != null && flexFit == null) {
return Flexible(flex: flex, child: this);
} else if (flex == null && flexFit != null) {
return Flexible(fit: flexFit, child: this);
} else {
return Flexible(flex: flex!, fit: flexFit!, child: this);
}
}