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?

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,
        ),
      ),
    ],
  ),

Leave a Reply