Home » Android » android – fixing the Unicode rendering in flutter

android – fixing the Unicode rendering in flutter

Posted by: admin May 14, 2020 Leave a comment

Questions:

I am new to flutter, I manage to receive the data from server and decoded it as well, when i tried to display in the text, it shows like below.

enter image description here

Code to display the text

import 'package:flutter/material.dart';
import 'package:sachchirashifal/model/serverdata.dart';

class RashiFalDetail extends StatelessWidget {
  Data rashi;

  RashiFalDetail({this.rashi});

  @override
  Widget build(BuildContext context) {
    return new Container(
      child: new Text(rashi.desc, style: new TextStyle(
        fontSize: 18.0,
        color: Colors.black
      ))
    );
  }
}

Any suggestions will be great, Thank u.

How to&Answers:

Your text has html tags. It should be rendered/viewed as HTML.
Check this package. This should solve your problem of hindi rendering as well.

NOTE: If you are unable to install this package, update your flutter as this package is very new and built with the latest flutter.