diff --git a/packages/flutter/lib/src/foundation/licenses.dart b/packages/flutter/lib/src/foundation/licenses.dart index 0844b626ac..285bd822a0 100644 --- a/packages/flutter/lib/src/foundation/licenses.dart +++ b/packages/flutter/lib/src/foundation/licenses.dart @@ -180,11 +180,16 @@ class LicenseEntryWithLineBreaks extends LicenseEntry { currentLineIndent += 8; state = _LicenseEntryWithLineBreaksParserState.beforeParagraph; break; + case '\r': case '\n': case '\f': if (lines.isNotEmpty) { yield getParagraph(); } + if (text[currentPosition] == '\r' && currentPosition < text.length - 1 + && text[currentPosition + 1] == '\n') { + currentPosition += 1; + } lastLineIndent = 0; currentLineIndent = 0; currentParagraphIndentation = null; diff --git a/packages/flutter/test/foundation/licenses_test.dart b/packages/flutter/test/foundation/licenses_test.dart index b223383a99..280c34b9b8 100644 --- a/packages/flutter/test/foundation/licenses_test.dart +++ b/packages/flutter/test/foundation/licenses_test.dart @@ -158,6 +158,7 @@ S test('LicenseEntryWithLineBreaks - leading and trailing whitespace', () { expect(const LicenseEntryWithLineBreaks(null, ' \n\n ').paragraphs.toList(), isEmpty); + expect(const LicenseEntryWithLineBreaks(null, ' \r\n\r\n ').paragraphs.toList(), isEmpty); List paragraphs;