ios – Emoji has unsuitable dimension when utilizing Textual content with greater font dimension in Flutter

[ad_1]

I am utilizing the Textual content widget in Flutter. When the fontSize will get greater (about 83pts), emojis scale unsuitable. They appear to double their dimension however the non-emoji textual content scales proper. I must have actually massive texts within the app (supporting emojis) as a result of they may virtually replenish the display.

I attempted altering the font household however the identical occurs. Giving the textual content a smaller dimension and place it inside a FittedBox has the identical outcome.

Here is what occurs when altering the fontSize:
https://youtu.be/aKrc6VbIR80

Screenshot with smaller font

Screenshot with greater font

Right here is the code I am utilizing to breed it:

    import 'package deal:flutter/materials.dart';
    import 'package deal:flutter/companies.dart';

    class DebugScreen extends StatefulWidget {
      const DebugScreen({tremendous.key});

      @override
      State<DebugScreen> createState() => _DebugScreenState();
    }

    class _DebugScreenState extends State<DebugScreen> {
      double fontSize = 12;

      @override
      void initState() {
        tremendous.initState();

        SystemChrome.setPreferredOrientations([
          DeviceOrientation.portraitUp,
          DeviceOrientation.landscapeLeft,
          DeviceOrientation.landscapeRight,
        ]);
      }

      Widget _debugBox(Widget youngster) {
        return Container(
          ornament: BoxDecoration(
            border: Border.all(coloration: Colours.pink, width: 1),
          ),
          youngster: youngster,
        );
      }

      @override
      Widget construct(BuildContext context) {
        last padding = MediaQuery.of(context).padding;
        return Scaffold(
          physique: Stack(
            kids: [
              Positioned(
                top: 50,
                left: 0,
                child: _debugBox(
                  Text(
                    "Hi 😜",
                    style: TextStyle(
                      fontSize: fontSize,
                    ),
                  ),
                ),
              ),
              Positioned(
                left: 50,
                right: 50,
                bottom: padding.bottom,
                child: Row(
                  children: [
                    Expanded(
                      child: Slider(
                        min: 2,
                        max: 500,
                        value: fontSize,
                        onChanged: (val) => setState(
                          () => fontSize = val,
                        ),
                      ),
                    ),
                    Text("Font size = ${fontSize.toInt()}"),
                  ],
                ),
              ),
            ],
          ),
        );
      }
    }

[ad_2]

Leave a Reply