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 to force text to overflow its parent container width?

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

  1. Stack

    Stack Membro Participativo

    I have a somewhat long label in a DropdownButtonFormField and I need to show the entire text which overflows outside it's parent container.

    How can I achieve that?

    [​IMG]

    Container(
    width: MediaQuery.of(context).size.width * 0.30,
    child: new DropdownButtonFormField<String>(
    decoration: InputDecoration(
    labelText: ("Long Text here, which should overflow it's parent"),
    // labelStyle: new TextStyle(
    // overflow: TextOverflow.visible,
    // ),
    // label: TextField(
    // //maxLines: 1,
    // style: TextStyle(overflow: TextOverflow.visible,),
    // decoration: InputDecoration.collapsed(
    // hintText: ("Long Text here, which should overflow it's parent"),
    // ),
    // ),
    // label: Text(
    // ("Long Text here, which should overflow it's parent"),
    // overflow: TextOverflow.visible,
    // ),
    ),
    isExpanded:true,
    hint: Text("Select"),
    items: _list.map((value) {
    return new DropdownMenuItem<String>(
    value: value,
    child: new Text(value),
    );
    }).toList(),
    onChanged: (value) {},
    )
    ),

    Continue reading...

Compartilhe esta Página