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

[Flutter] How to escape single quote in flutter's .arb files?

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

  1. Stack

    Stack Membro Participativo

    I have the following in my intl_en.arb file:

    "title_chef_selection": "Chef's Selection",
    "@title_chef_selection": {},


    And I get this error: Error: Unbalanced escape quotes. To escape a single quote ', prefix it with another single quote.(mismatched_brackets)

    I followed it's advice changing it to this:

    "title_chef_selection": "Chef''s Selection",
    "@title_chef_selection": {},


    This shows two single quotes in Text(S.of(context).title_chef_selection)

    I just tried this one:

    "title_chef_selection": "Chef\'s Selection",
    "@title_chef_selection": {},


    I get this error: Invalid escape character in string.json(261), but it works and the text shows properly. Is there a different way of doing it or a way to get rid of the error?

    Continue reading...

Compartilhe esta Página