'Text background color height is inconsistent for non-english characters
Text background color height is inconsistent for non-english characters. For selected texts, selectionHeightStyle can be used to fix this, but for other cases, the problem is still there. For example in SelectableText.rich, if a text of non-english characters is with a background color, the color height is still inconsistent.
import 'package:flutter/material.dart';
void main() => runApp(Home());
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.amber,
),
home: Scaffold(
appBar: AppBar(title: const Text('Demo')),
body: Center(
child: Container(
child: Text(
"曾经的我们",
style: TextStyle(backgroundColor: Colors.blue),
))),
),
);
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
