79190899

Date: 2024-11-15 01:59:07
Score: 0.5
Natty:
Report link

I was able to solve the spacing issue by wrapping each of the Radio widgets in a SizedBox and gave them a height lower than the devTools was showing me is their size (which was 48). I gave them a height of 30 and it works.

Here's a pic:

enter image description here

And here's the code:

              Expanded(
                flex: 1,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    
                     Row(
                      children: [
                        SizedBox(
                          height: 30,
                          child: Radio<Era>(
                            value: Era.ad,
                            groupValue: _era,
                            onChanged: (Era? value) {
                              setState(() {
                                _era = value;
                              });
                            },
                            ),
                        ),
                          const Text(
                            'A.D.',
                            style: TextStyle(fontSize: 10.0),
                          ),
                      ],
                    ),
                                
                    Row(
                      children: [
                        SizedBox(
                          height: 30,
                          child: Radio<Era>(
                            value: Era.bc,
                            groupValue: _era,
                            onChanged: (Era? value) {
                              setState(() {
                                _era = value;
                              });
                            },
                            ),
                        ),
                          const Text(
                            'B.C.',
                            style: TextStyle(fontSize: 10.0),
                          ),
                      ],
                    ),
                  ]),
              )
            ]),
Reasons:
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: TM Lynch