Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text justify is not working correctly with RichText #28891

Closed
attdona opened this issue Mar 5, 2019 · 1 comment
Closed

text justify is not working correctly with RichText #28891

attdona opened this issue Mar 5, 2019 · 1 comment
Labels
a: typography Text rendering, possibly libtxt engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels.

Comments

@attdona
Copy link

attdona commented Mar 5, 2019

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

@HansMuller HansMuller added the framework flutter/packages/flutter repository. See also f: labels. label Mar 6, 2019
jason-simmons added a commit to jason-simmons/flutter_engine that referenced this issue Mar 19, 2019
@cbracken cbracken added engine flutter/engine repository. See also e: labels. a: typography Text rendering, possibly libtxt labels Mar 19, 2019
jason-simmons added a commit to flutter/engine that referenced this issue Mar 19, 2019
RBogie pushed a commit to RBogie/flutter-engine that referenced this issue Apr 8, 2019
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2021
RobertSun123 pushed a commit to RobertSun123/engine that referenced this issue May 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: typography Text rendering, possibly libtxt engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

3 participants