Home > Blockchain >  Change text style inside a List in Flutter
Change text style inside a List in Flutter

Time:01-24

I'm using a List to create some curiosities in my app, and I want to change the text style like italic and bold. But I don't know how to do it. Here is my code with the data:

List dataItems = [

{

"id": 1,
"name": "Por que manguezal tem aquele cheiro?",
"image": "https://i.imgur.com/7osFXty.jpg",
"description":
    "Caso você nunca tenha ido a algum mangue eles costumam exalar um cheiro esquisito. Isso 
     se deve ao fato de ter muito sulfeto de hidrogênio (H2S), proveniente da ação bacteriana, 
     o solo do manguezal possui o odor de putrefação, parecido a do ovo em decomposição.",

},

{

"id": 2,
"name": "Mangue ou manguezal?",
"image": "https://i.imgur.com/5HgptF4.jpg",
"description":
    "Mangue são as árvores que possuem adaptações para sobreviverem ao ambiente do manguezal 
    (pouco oxigênio, variação da salinidade, substrato pouco firme e inundação).Já Manguezal 
    se refere à comunidade de plantas, animais, microrganismos, que ocupam sua área, ou seja, 
    ao ecossistema como um todo."

},

]

Thanks in advance ;)

CodePudding user response:

It's useless to post here. I just waste my time and I got negative votes for no reason. Goodbye, I will go find help in another place

CodePudding user response:

             RichText(
                    textAlign: TextAlign.justify,
                    text: TextSpan(
                      children: [
                        TextSpan(
                          text: widget.description,
                          style: TextStyle(
                              fontSize: constraints.maxHeight * 0.018,
                              height: constraints.maxHeight * 0.0019,
                              color: Colors.teal.shade700),
                        )
                      ],
                    ))
  •  Tags:  
  • Related