-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)a: qualityA truly polished experienceA truly polished experiencec: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
For reasons that don't matter here, I got the following exception:
E/flutter (18304): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: No MaterialLocalizations found.
E/flutter (18304): MyApp widgets require MaterialLocalizations to be provided by a Localizations widget ancestor.
E/flutter (18304): Localizations are used to generate many different messages, labels,and abbreviations which are used by the material library.
E/flutter (18304): To introduce a MaterialLocalizations, either use a MaterialApp at the root of your application to include them automatically, or add a Localization widget with a MaterialLocalizations delegate.
E/flutter (18304): The specific widget that could not find a MaterialLocalizations ancestor was:
E/flutter (18304): MyApp
E/flutter (18304): The ancestors of this widget were:
E/flutter (18304): [root]
Notice the typo on the third line, labels,and.
Ironically, we even hard-coded this typo into the relevant test:
| ' labels,and abbreviations which are used by the material library.\n' |
This is caused by omitting a space character at the end of one string in a multiline multipart string literal:
| 'Localizations are used to generate many different messages, labels,' |
To catch these in the future, we should write a test (or a lint) that looks for adjacent string literals where the last character of the first literal is not whitespace (U+0020 or U+000A).
cc @a14n if this is something that would be easy to lint.
Metadata
Metadata
Assignees
Labels
a: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)a: qualityA truly polished experienceA truly polished experiencec: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.