fixing the Unicode rendering in flutter

2,540

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.

Share:
2,540
yubaraj poudel
Author by

yubaraj poudel

I am a computer engineer and actively working as the android developer since 2013. I do have wide interest in the robotics and with other programming language.Besides android programming i have interest in writing the poems.

Updated on December 04, 2022

Comments

  • yubaraj poudel
    yubaraj poudel over 1 year

    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.

  • yubaraj poudel
    yubaraj poudel about 6 years
    I will try this
  • yubaraj poudel
    yubaraj poudel about 6 years
    This removed the html tags but text are still showing like above.
  • Arnold Parge
    Arnold Parge about 6 years
    Okay. have you tried hindi font? download and add a hindi font in pubspec.yaml and appl that font only to the hindi text. Do let me know what happens!
  • yubaraj poudel
    yubaraj poudel about 6 years
    I tried with Hindi font aswell but i guess the problem is with Text widget itself
  • Arnold Parge
    Arnold Parge about 6 years
    Have you tried other Hindi texts. Could be that actual text is not in the correct format.
  • sonill
    sonill about 6 years
    I have same problem. I tried with Nepali Unicode fonts. No luck yet.
  • Isura Manchanayake
    Isura Manchanayake about 3 years
    I still get this issue. Has anyone been able to find a solution?