flexible method

Widget flexible({
  1. FlexFit fit = FlexFit.loose,
  2. int flex = 1,
  3. Key? key,
})

Wraps the widget in a Flexible widget.

The fit parameter determines how the child is resized within the parent Flex container. It defaults to FlexFit.loose.

The flex parameter defines the flex factor, defaulting to 1.

The key parameter is optional and can be used to provide a Key for the Flexible widget.

Example usage:

Text('Flexible Text').flexible(fit: FlexFit.tight, flex: 2);

Implementation

Widget flexible({FlexFit fit = FlexFit.loose, int flex = 1, Key? key}) =>
    Flexible(fit: fit, flex: flex, key: key, child: this);