-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
TextAlign.justify with RichText does not works as expected:
MVCE:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
List<TextSpan> getSpan() {
List<TextSpan> spans = List<TextSpan>();
spans.add(TextSpan(
text: "And thus We made them rise ",
));
spans.add(TextSpan(
text: " they ",
style: TextStyle(
decoration: TextDecoration.underline,
),
));
spans.add(TextSpan(
text: " And thus We made them rise ",
));
return spans;
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(title: Text("MVCE"),),
body: RichText(
softWrap: true,
textAlign: TextAlign.justify,
text: TextSpan(
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.w500,
fontSize: 16.0,
),
children: getSpan(),
),
))
);
}
}
Cross posted from here
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.