flutter_localizations-在应用程序和程序包之间拆分翻译

时间:2018-08-29 16:59:49

标签: internationalization flutter

我在Flutter项目中使用的是flutter_localizations。我需要将一些通用代码提取到本地程序包中,以供其他项目使用,因此我将在应用程序项目和程序包项目中使用.arb文件。

现在运行应用程序时,出现以下错误:

I/flutter ( 7637): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY 
╞═══════════════════════════════════════════════════════════
I/flutter ( 7637): The following assertion was thrown building Builder(dirty):
I/flutter ( 7637): type 'en' is not a subtype of type 'S'
I/flutter ( 7637): 
I/flutter ( 7637): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 7637): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 7637): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 7637):   https://github.com/flutter/flutter/issues/new
I/flutter ( 7637): 
I/flutter ( 7637): When the exception was thrown, this was the stack:
I/flutter ( 7637): #0      _LocalizationsState.resourcesFor (package:flutter/src/widgets/localizations.dart:533:41)
I/flutter ( 7637): #1      Localizations.of (package:flutter/src/widgets/localizations.dart:445:39)

有人可以帮我吗?

谢谢。

0 个答案:

没有答案