Doubt Flutter - List

Asked

Viewed 48 times

0

Good morning, you guys!

I am doubtful to bring the elements of a list. Could someone assist me? I am new to the flutter.

  • What am I doing:

I have a list who is called listed that brings me the descriptions that were selected, I did a foreach to browse and add in the list _serviceList() to remarks.description.

List<String> _servicesList = List<String>();
    
    widget.listaDeObservacoesSelecionadas.forEach((observacoes) {
          _servicesList.add(observacoes.descricao);
        });
  • My doubt: By adding in _servicesList.add the notes it brings me this way: [cfg, test]

What I need him to bring me just the string without Square bracket ie would be: cfg, test

print(_servicesList);
[cgf, teste]

1 answer

0


I used the Join() method to go through the List

 var list = ['one', 'two', 'three'];
    var stringList = list.join("");
    print(stringList); //

Browser other questions tagged

You are not signed in. Login or sign up in order to post.