-
Notifications
You must be signed in to change notification settings - Fork 51
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 in line breaking mode #29
Comments
Hey! I am a beginner in flutter, so I couldn't use the author's documentation to implement the line-breaking feature correctly. I have an error: Could you help me? Could you share your code? |
@MuratovArthur You have to install the dev version from git (see here). |
Hey! Thank you for helping me! I've tried to install the dev version from git, but it required to update some other packages. I've updated After that, I've tried to run my app, but there was an error Did you face such an error?) |
@MuratovArthur Nope because I'm not using |
I finally have some results using the following code : @override
Widget build(BuildContext context) {
Math math = Math.tex(input);
List<Math> parts = math.texBreak().parts;
if (parts.length == 1) {
return parts.first;
}
return RichText(
text: TextSpan(
children: _handleParts(parts),
),
);
}
List<InlineSpan> _handleParts(List<Math> parts) {
List<InlineSpan> result = [];
for (Math part in parts) {
result.add(WidgetSpan(
baseline: TextBaseline.alphabetic,
alignment: PlaceholderAlignment.baseline,
child: part,
));
result.add(const TextSpan(
text: ' ',
));
}
return result;
} I don't think it's the best way to achieve this, but at least it works. |
thanks, dependencies: |
* Fix `SelectableMath` compatibility with `provider` 6.0 * use MathController as a source for EquationRow's ProxyProvider
Hey,
I've followed the instructions here to implement the line breaking feature in my app. It really suits my needs, but there's a little caveat using a
Wrap
widget in order to display Tex break parts : some parts are not aligned. Here are some examples :Is there a way to align the
Math
widgets in aWrap
?Thanks !
The text was updated successfully, but these errors were encountered: