flexible method
Make a StatelessWidget Flexible. Example:
Column(
children: [
MaterialButton(child: Text('Button 1'), onPressed: () {}).flexible(),
MaterialButton(child: Text('Button 2'), onPressed: () {}).flexible(),
],
),
Implementation
Flexible flexible({Key? key, int flex = 1, FlexFit fit = FlexFit.loose}) {
return Flexible(
key: key,
flex: flex,
fit: fit,
child: this,
);
}