πŸš€ DevOps Certified Professional
πŸ“… Starting: 1st of Every Month 🀝 +91 8409492687 | 🀝 +1 (469) 756-6329 πŸ” Contact@DevOpsSchool.com

Remove HTML tags from a String in Dart

DevOps

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Step 1:

Add the html package to your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  html: ^0.15.0 # Use the latest version of the html package

Step 2:

Import the necessary package in your Dart file:

import 'package:flutter/material.dart';
import 'package:html/parser.dart'; // Import the HTML parser

// ... (rest of your imports)

Step 3:

Modify the TextSpan widget to parse and display the HTML content:

TextSpan(
text: 'Research Experience: ',
style: TextStyle(
fontSize: 17.5,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: parse(data['re_experience']).body.text, // Parse and extract text from HTML
style: TextStyle(
fontSize: 17.5,
color: Colors.black,
),
),
Subscribe
Notify of
guest


This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x