-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
[flutter_markdown] Text Alignment in table is incorrect for IOS and Android #160746
Open
Labels
found in release: 3.27
Found to occur in 3.27
found in release: 3.28
Found to occur in 3.28
has reproducible steps
The issue has been confirmed reproducible and is ready to work on
p: flutter_markdown
flutter/packages flutter_markdown
package
flutter/packages repository. See also p: labels.
platform-android
Android applications specifically
platform-ios
iOS applications specifically
team-ecosystem
Owned by Ecosystem team
Comments
Open
11 tasks
Hello @andrechalella, Thanks for filing the issue. I am able to reproduce the issue on android and ios and works fine for macos and web
✅ : No Issue flutter_markdownNative Webcode sampleimport 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:markdown/markdown.dart' as md;
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
return const SwMarkDownWidget(mdContent: md_content);
}
}
const String md_content = '''
# Example of horizontal rules
---
This is a paragraph.
***
This is another paragraph.
___
|Header 1|Header 2|Header 3|
|:----|:----:|----:|
|Col 1|Col 2|VERY LONG LINE|
''';
class SwMarkDownWidget extends StatelessWidget {
final String mdContent;
const SwMarkDownWidget({
super.key,
required this.mdContent,
});
@override
Widget build(BuildContext context) {
return MarkdownBody(
data: mdContent,
builders: {
'hr': HorizontalRuleBuilder(),
},
);
}
}
class HorizontalRuleBuilder extends MarkdownElementBuilder {
@override
bool isBlockElement() => true;
@override
Widget visitText(md.Text text, TextStyle? preferredStyle) {
debugPrint("visitText: ${text.text}"); // Debug statement
return super.visitText(text, preferredStyle) ?? Container();
}
@override
Widget? visitElementAfter(md.Element element, TextStyle? preferredStyle) {
debugPrint("visitElementAfter: ${element.tag}");
return Container(
color: Colors.red,
height: 2,
margin: const EdgeInsets.symmetric(
vertical: 10,
), // Add some spacing around the hr
);
}
}
flutter doctor -v[✓] Flutter (Channel stable, 3.27.1, on macOS 15.1.1 24B2091 darwin-arm64, locale en-US)
• Flutter version 3.27.1 on channel stable at /Users/mahesh/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 17025dd882 (2 days ago), 2024-12-17 03:23:09 +0900
• Engine revision cb4b5fff73
• Dart version 3.6.0
• DevTools version 2.40.2
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/mahesh/Library/Android/sdk
• Platform android-35, build-tools 34.0.0
• ANDROID_HOME = /Users/mahesh/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16A242d
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 61.2.4
• Dart plugin version 212.5080.8
[✓] VS Code (version 1.94.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.100.0
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.1.1 24B2091 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.1.1 24B2091 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 128.0.6613.85
[✓] Network resources
• All expected network resources are available.
• No issues found!
|
maheshj01
changed the title
Alignment in table still doesn't work (when text wraps)
[flutter_markdown] Text Alignment in table is incorrect
Dec 28, 2024
maheshj01
changed the title
[flutter_markdown] Text Alignment in table is incorrect
[flutter_markdown] Text Alignment in table is incorrect for IOS and Android
Dec 28, 2024
maheshj01
added
package
flutter/packages repository. See also p: labels.
team-ecosystem
Owned by Ecosystem team
has reproducible steps
The issue has been confirmed reproducible and is ready to work on
p: flutter_markdown
flutter/packages flutter_markdown
found in release: 3.27
Found to occur in 3.27
found in release: 3.28
Found to occur in 3.28
platform-android
Android applications specifically
platform-ios
iOS applications specifically
and removed
in triage
Presently being triaged by the triage team
labels
Dec 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
found in release: 3.27
Found to occur in 3.27
found in release: 3.28
Found to occur in 3.28
has reproducible steps
The issue has been confirmed reproducible and is ready to work on
p: flutter_markdown
flutter/packages flutter_markdown
package
flutter/packages repository. See also p: labels.
platform-android
Android applications specifically
platform-ios
iOS applications specifically
team-ecosystem
Owned by Ecosystem team
What package does this bug report belong to?
flutter_markdown
What target platforms are you seeing this bug on?
Android, Windows
Have you already upgraded your packages?
Yes
Dependency versions
pubspec.lock
Steps to reproduce
Make a table with custom aligned columns where wrapping occurs in table cells
Expected results
Wrapped text should align according to the custom alignment
Actual results
Wrapped text aligns to left
Code sample
Code sample
Screenshots or Videos
No response
Logs
No response
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: