-
Notifications
You must be signed in to change notification settings - Fork 29
fix: added fixes for flutter 3.22 #32
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,8 +51,7 @@ class Parser { | |
final TextStyle? defaultTextStyle; | ||
|
||
TextSpan _getTextSpan(String text, String style, TextStyle overrideStyle) { | ||
final Iterable<String> rules = | ||
style.split(';').where((String item) => item.trim().isNotEmpty); | ||
final Iterable<String> rules = style.split(';').where((String item) => item.trim().isNotEmpty); | ||
TextStyle textStyle = DefaultTextStyle.of(context).style; | ||
textStyle = textStyle.apply(color: const Color(0xff000000)); | ||
textStyle = textStyle.merge(defaultTextStyle); | ||
|
@@ -161,7 +160,7 @@ class Parser { | |
case 'h1': | ||
double h1; | ||
if (defaultFontSize == null) { | ||
h1 = Theme.of(context).textTheme.headline5?.fontSize ?? 24.0; | ||
h1 = Theme.of(context).textTheme.headlineLarge?.fontSize ?? 24.0; | ||
} else { | ||
h1 = defaultFontSize * 2; | ||
} | ||
|
@@ -171,7 +170,7 @@ class Parser { | |
case 'h2': | ||
double h2; | ||
if (defaultFontSize == null) { | ||
h2 = Theme.of(context).textTheme.headline6?.fontSize ?? 20.0; | ||
h2 = Theme.of(context).textTheme.headlineLarge?.fontSize ?? 20.0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be |
||
} else { | ||
h2 = defaultFontSize * 1.5; | ||
} | ||
|
@@ -181,7 +180,7 @@ class Parser { | |
case 'h3': | ||
double h3; | ||
if (defaultFontSize == null) { | ||
h3 = Theme.of(context).textTheme.subtitle1?.fontSize ?? 16.0; | ||
h3 = Theme.of(context).textTheme.headlineMedium?.fontSize ?? 16.0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be |
||
} else { | ||
h3 = defaultFontSize * 1.17; | ||
} | ||
|
@@ -191,7 +190,7 @@ class Parser { | |
case 'h4': | ||
double h4; | ||
if (defaultFontSize == null) { | ||
h4 = Theme.of(context).textTheme.bodyText1?.fontSize ?? 16.0; | ||
h4 = Theme.of(context).textTheme.headlineMedium?.fontSize ?? 16.0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be |
||
} else { | ||
h4 = defaultFontSize; | ||
} | ||
|
@@ -201,7 +200,7 @@ class Parser { | |
case 'h5': | ||
double h5; | ||
if (defaultFontSize == null) { | ||
h5 = Theme.of(context).textTheme.bodyText1?.fontSize ?? 16.0; | ||
h5 = Theme.of(context).textTheme.headlineMedium?.fontSize ?? 16.0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be |
||
} else { | ||
h5 = defaultFontSize * .83; | ||
} | ||
|
@@ -211,7 +210,7 @@ class Parser { | |
case 'h6': | ||
double h6; | ||
if (defaultFontSize == null) { | ||
h6 = Theme.of(context).textTheme.bodyText2?.fontSize ?? 14.0; | ||
h6 = Theme.of(context).textTheme.headlineSmall?.fontSize ?? 14.0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be |
||
} else { | ||
h6 = defaultFontSize * .67; | ||
} | ||
|
@@ -251,8 +250,7 @@ class Parser { | |
break; | ||
|
||
case 'a': | ||
styles = | ||
'''visit_link:__#TO_GET#__; text-decoration: underline; color: #4287f5;'''; | ||
styles = '''visit_link:__#TO_GET#__; text-decoration: underline; color: #4287f5;'''; | ||
break; | ||
|
||
// dropping partial support for ul-li bullets | ||
|
@@ -285,8 +283,7 @@ class Parser { | |
if (attribute.name == 'style') { | ||
styles = '$styles;${attribute.value}'; | ||
} else if (attribute.name == 'href') { | ||
styles = styles.replaceFirst('__#TO_GET#__', | ||
attribute.value.replaceAll(':', '__#COLON#__')); | ||
styles = styles.replaceFirst('__#TO_GET#__', attribute.value.replaceAll(':', '__#COLON#__')); | ||
} | ||
} | ||
_stack.add(_Tag(event.name, styles, overrideStyles)); | ||
|
@@ -338,8 +335,7 @@ class Parser { | |
if (spans.isNotEmpty) { | ||
final List<TextSpan> reversed = spans.reversed.toList(); | ||
|
||
while (reversed.isNotEmpty && | ||
(reversed.first.text == '\n\n' || reversed.first.text == '\n')) { | ||
while (reversed.isNotEmpty && (reversed.first.text == '\n\n' || reversed.first.text == '\n')) { | ||
reversed.removeAt(0); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be
headlineSmall