Skip to content

Text rendering issue after minimizing and resuming the app on Android #163730

@BrunoVasel

Description

@BrunoVasel

Description:
When navigating to a second screen and then minimizing and resuming the app on Android, text rendering is broken. The issue occurs in TextFormField labels and hints, which either disappear or become unreadable.

Steps to Reproduce:
Create a new Flutter app (tested on version 3.29.0).
Use the provided code below to set up navigation between two pages.
Run the app on an Android device.
On the first screen, tap the button to navigate to the second screen.
Minimize the app (press the home button or switch to another app).
Resume the app.

Expected Behavior:
All text fields should remain correctly rendered after resuming the app.

Actual Behavior:
Some text fields render incorrectly after resuming the app, with text disappearing or becoming distorted.

Code sample:

`import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('appLocalizations.createActivityTitle')),
      body: Column(
        children: [
          TextFormField(
            maxLength: 2500,
            decoration: InputDecoration(
              labelText: 'appLocalizations.activityDescriptionLabel',
              hintText: 'appLocalizations.activityDescriptionHint',
            ),
            minLines: 4,
            maxLines: 99,
          ),
          FilledButton(
            onPressed: () {
              Navigator.of(context).push(
                MaterialPageRoute(builder: (context) => const SecondScreen()),
              );
            },
            child: Text('child'),
          ),
        ],
      ),
    );
  }
}

class SecondScreen extends StatefulWidget {
  const SecondScreen({super.key});

  @override
  State<SecondScreen> createState() => _SecondScreenState();
}

class _SecondScreenState extends State<SecondScreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Vai buga')),
      body: Column(
        children: [
          TextFormField(
            maxLength: 2500,
            decoration: InputDecoration(
              floatingLabelBehavior: FloatingLabelBehavior.always,
              labelText: 'appLocalizations.activityDescriptionLabel',
              hintText:
                  "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unk",
            ),
            minLines: 4,
            maxLines: 99,
          ),
          TextFormField(
            maxLength: 2500,
            decoration: InputDecoration(
              floatingLabelBehavior: FloatingLabelBehavior.always,
              labelText: 'appLocalizations.activityDescriptionLabel',
              hintText:
                  'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a',
            ),
            minLines: 4,
            maxLines: 99,
          ),
          TextFormField(
            maxLength: 2500,
            decoration: InputDecoration(
              floatingLabelBehavior: FloatingLabelBehavior.always,
              labelText: 'appLocalizations.activityDescriptionLabel',
              hintText:
                  'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words',
            ),
            minLines: 4,
            maxLines: 99,
          ),
        ],
      ),
    );
  }
}

Images:
Image
Image

Flutter Doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.0, on Microsoft Windows [versÆo 10.0.26100.3194], locale en-CA)
[✓] Windows Version (11 Pro 64-bit, 24H2, 2009)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.3.3)
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Community Edition (version 2022.2)
[✓] VS Code (version 1.97.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: typographyText rendering, possibly libtxte: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyteam-engineOwned by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions