Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter single radio button

How to make a single radio button like the image below.

Button model I want

This is what I tried. Anyone can help?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

RadioListTile(
                title: Row(
                  children: [
                    ///use your image
                    CountryFlags.flag(
                      'bh',
                      width: 20,
                      height: 20,
                      borderRadius: 5,
                    ),
                    Text("  Bahrain"),
                  ],
                ),
                value: "Bahrain",
                groupValue: "bahrain",
                shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(10)),
                onChanged: (value) {
                  setState(() {});
                },
              ),

>Solution :

You can use MainAxisAlignment.center

RadioListTile(
  tileColor: Colors.cyanAccent,
  title: Row(
    mainAxisAlignment: MainAxisAlignment.center,
    children: [
      ///use your image
      Icon(Icons.flag),
      Text(
        "Bahrain",
        style: TextStyle(
          color: Colors.black,
        ),
      ),
    ],
  ),
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading