Skip to content

Text is not vertically centered with customized height #72521

@mehmetf

Description

@mehmetf

Internal: b/175850701

Repro:

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.light(),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(title: Text('Text')),
        body: Center(
          child: Container(
            color: Colors.grey[300],
            child: Row(
              children: [
                Text(
                  'Input: ',
                  style: Theme.of(context).textTheme.bodyText1.copyWith(
                        backgroundColor: Colors.blue.withAlpha(100),
                        height: 3,
                      ),
                ),
                Expanded(
                  child: TextField(
                    decoration: InputDecoration(
                      hintText: 'Message...',
                      border: InputBorder.none,
                      focusedBorder: InputBorder.none,
                      contentPadding: EdgeInsets.zero,
                    ),
                    style: Theme.of(context).textTheme.bodyText1.copyWith(
                          backgroundColor: Colors.red.withAlpha(100),
                          height: 3,
                        ),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Metadata

Metadata

Labels

P1High-priority issues at the top of the work lista: text inputEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtcustomer: money (g3)f: material designflutter/packages/flutter/material repository.found in release: 1.26Found to occur in 1.26frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions