0

My beloved is not showing up. It used to though, with Flutter 3.0.0.

Now, using Flutter 3.3.6 Dart SDK 2.18.2, it does not.

Does anyone know if it's a bug? Or does anyone know a workaround for auto-scaling?

Minimal example:

class OtterFreakshow extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return 
      Column(children: [
        // works as expected with single letters
        Container(
      color: Colors.green,
      width:200, height: 200 ,child: const FittedBox(child: Text('A'))),
              
        // works as expected for emoji with surrounding letters
                Container(color: Colors.purple,
      width:200, height: 200 ,child: const FittedBox(child: Text('__'))),
        
        // not rendering correctly (invisible!) without some letters surrounding the otter
        Container(color: Colors.red,
      width:200, height: 200 ,child: const FittedBox(child: Text('')))
      
      
      ]);
    }}

yields:

https://www.dropbox.com/s/n87grh6na3n2dfj/Screenshot%202022-11-01%20at%2019.42.29.png?dl=0

Interestingly, with surrounding blankspaces, the emoji also does not show up.

Neckslap
  • 3
  • 2

1 Answers1

0

There is nothing wrong with it. Also I can clearly see the emoji when I run it in dartpad.

enter image description here

Still if you feel unsafe about it,

Use auto_size_text plugin

If you wanna automatically resize fonts based on parent widget's width and height, using auto_size_text package is the best option. It's really easy to use and has rich documentation.

Sample Usage:

AutoSizeText(
  'The text to display',
  style: TextStyle(fontSize: 20),
  maxLines: 2,
)

Have fun!

Ye Lwin Oo
  • 466
  • 4
  • 8
  • Hi, thanks for the answer.:) It's really odd, because my dartpad has the above described issue :O I don't see any difference! https://www.dropbox.com/s/04bxjqc6c5w2x5u/Screenshot%202022-11-01%20at%2020.45.54.png?dl=0 – Neckslap Nov 01 '22 at 19:46
  • I see. So it's a bug. You can reference here for custom emojis and richtext: https://stackoverflow.com/a/56839834/19209151 – Ye Lwin Oo Nov 01 '22 at 20:42