fix design in flutter

Viewed 44

Row RadioListTile:

enter image description here

I want fix this design code to make on single line..

The picture shows the problem When removing Expanded it return an error

Row(
  mainAxisAlignment: MainAxisAlignment.spaceBetween,
  children: [
    Expanded(
      child: buildRadioListLicense( 
        1, 
        getTranslated(context, 'received')
      ),
    ),
    Expanded(
      child: buildRadioListLicense(
        2, 
        getTranslated(context, 'inProgress')
      ),
    ),
    Expanded(
      child: buildRadioListLicense(
        3, 
        getTranslated(context, 'done')
      ),
    )
  ],
),

buildRadioListLicense

  RadioListTile<dynamic> buildRadioListLicense(val, txt) {
    return RadioListTile(
      controlAffinity: ListTileControlAffinity.leading,
      activeColor: myRed,
      value: val,
      groupValue: _license,
      onChanged: (value) {
        setState(() {
          _license = value;
        });
      },
      title: Text(txt),
    );
  }
1 Answers

Try to add inside to RadioListTile widget:

shrinkWrap: true;

Or, try to wrap the RadioListTile widget with an Expanded widget.

Related