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

Alignment fails when there are anchors in a paragraph #360

Closed
GeertJohan opened this issue Jul 24, 2020 · 1 comment
Closed

Alignment fails when there are anchors in a paragraph #360

GeertJohan opened this issue Jul 24, 2020 · 1 comment

Comments

@GeertJohan
Copy link
Contributor

I have an issue with text alignment of anchors within a paragraph. A minimal reproduce example below.

It seems that the anchors/links are aligned normally, while the paragraphs are actually justified. The position of the anchor would be correct if the surrounding text was aligned normally as well.

Flutter 1.17.5 • channel stable

unnamed

import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html/style.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter HTML Test',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Html(
              data: """<p>
Text bla bla bla bla blabla bla bla <a href="google.com">Foobar</a> bla bla bla bla bla  Longerwordwithblabla bla bla bla bla blup <a href="google.com">Foobar</a> bla bla bla bla bla bla bla bla bla bla.
</p>""",
              style: {
                "p": Style(
                  textAlign: TextAlign.justify,
                ),
                "a": Style(
                  textAlign: TextAlign.justify,
                ),
              },
            ),
          ],
        ),
      ),
    );
  }
}
@erickok
Copy link
Collaborator

erickok commented Feb 8, 2021

Fixed, ultimately via #499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants