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

[Flutter] I try to display a text from flutter bluetooth but the length is 'wrong'

Discussão em 'Mobile' iniciado por Stack, Outubro 9, 2024 às 09:42.

  1. Stack

    Stack Membro Participativo

    await characteristic?.read().then((value) {
    String decoded = utf8.decode(value);
    print('value: $decoded');
    print('!!! ${decoded.length}');
    }


    Prints:

    !!! fetchDeviceName value: name
    !!! 32


    When I try do display my decoded value in my UI I want to show 'name' but the text display name with a bunch of empty space behind it. How can I solve this?

    I tried to add a dot behind the name and I get:

    "name ."

    Continue reading...

Compartilhe esta Página