Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.76k stars 814 forks source link

[QUESTION] Display image for each li element #1323

Open kwado-tech opened 11 months ago

kwado-tech commented 11 months ago

I'm trying to display to display images in this sample html string but have been unsuccessful with this. Given the following html string, how can I display the image along-side its contents?

<h3>Contact an agent to deposit</h3>
<ul>
  <li>
    <div class="image" style="background-image: url(&quot;https://sportsbet.imgix.net/Agents/logo-dmcreditos-novo2.png&quot;);"></div>
    <div class="text">
      <h4>DM Créditos</h4>
      <p>Usuário: <span>DMcreditos</span></p>
      <p>WhatsApp: <span><a href="https://wa.me/+5531984723490" target="_blank">(31) 98472-3490</a></span></p>
      <p>Site: <a href="https://dmcreditos.com.br/" target="_blank">www.dmcreditos.com.br</a></p>
    </div>
  </li>
  <li>
    <div class="image" style="background-image: url(&quot;https://sportsbet.imgix.net/Agents/logo_caju.png&quot;);"></div>
    <div class="text">
      <h4>BETZ Créditos Online</h4>
      <p>Username: caixabetz1</p>
      <p>Whatsapp: (51) 98032-1122</p>
      <p>Site: <a href="http://www.betzcreditos.com.br/" target="_blank">www.betzcreditos.com.br</a></p>
    </div>
  </li>
  <li>
    <div class="image" style="background-image: url(&quot;https://sportsbet.imgix.net/Agents/logo_royalpag_azul.png&quot;);"></div>
    <div class="text">
      <h4>Royalpag</h4>
      <p>Username: royalpag</p>
      <p>Whatsapp: (43) 99125-1004</p>
      <p>Site: <a href="https://royalpag.com/home.html" target="_blank">www.royalpag.com</a></p>
    </div>
  </li>
  <li>
</ul>

A picture of a cute animal (not mandatory but encouraged)

kwado-tech commented 11 months ago

@Sub6Resources any pointers regarding this?

Sub6Resources commented 11 months ago

Are you looking for something like css list-style-image?

kwado-tech commented 11 months ago

@Sub6Resources Yes but dynamically using the specified image url in each li.