1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] How can I make a Row with a Textfield and two stacked radio buttons in Flutter?

Discussão em 'Mobile' iniciado por Stack, Novembro 14, 2024.

  1. Stack

    Stack Membro Participativo

    I have a TextField to enter the year and two RadioListTiles for AD or BC. I would like to have a Row with the TextField first, and then the RadioListTiles stacked after that and in a smaller font size. Can someone help?

    Here's what it looks like now:

    [​IMG]

    And here is the code:

    TextField(
    focusNode: inputNode,
    autofocus: true,
    keyboardType: const TextInputType.numberWithOptions(),
    controller: yearController,
    decoration: const InputDecoration(
    border: OutlineInputBorder(),
    labelText: "Enter the Year of the Event",
    )),

    Row(
    children: [

    Flexible(
    child: RadioListTile<Era>(
    title: const Text('A.D.'),
    value: Era.ad,
    groupValue: _era,
    onChanged: (Era? value) {
    setState(() {
    _era = value;
    });
    },
    ),

    ),

    Flexible(
    child: RadioListTile<Era>(
    title: const Text('B.C.'),
    value: Era.bc,
    groupValue: _era,
    onChanged: (Era? value) {
    setState(() {
    _era = value;
    });
    },
    ),
    ),

    ],
    ),

    Continue reading...

Compartilhe esta Página