颤振飞镖/数据列表大小


我正在创建一个单词应用程序来学习英语词汇。它是基于一个非常大的单词库,我计划保存在一个列表中。(硬编码(。

这个大列表由单词对象组成:

List<Word> wordBank = [
Word(
id: 0,
main: 'alligator',
articleEng: 'an',
ortho2: '',
phon: 'ælɪgeɪtər',
syllabe: 'alliGAtor',
son: 'eɪ',
remPhon: '',
marqueur: '',
plur: 'alligators',
nature: 'noun',
theme: ['banimals', 'banimaux'],
subTheme: [
T(e: 'reptiles', f: 'reptiles'),
T(e: 'wild animals', f: 'animaux sauvages')
],
level: 2,
mainFr: 'alligator',
articleFr: 'un',
french: [],
syn: [],
ant: [],
wDef:
'a large reptile similar to a crocodile, with a long tail, hard skin and very big jaws, that lives in rivers and lakes in North and South America and China',
oDef: '',
wPhrase: 'There are alligators in this river! Beware!',
wPhraseFr: 'Il y a des alligators dans cette rivière! Faites attention!',
oPhrase: '',
remarque: '',
past: [],
),
]

列表中应该有2000到3000个这样的Word对象。我试过处理这样一个庞大的列表,这个应用程序运行得相当好。

在安装FIREBASE(用于应用程序的其他部分(时,我必须授权";multiDexEnabled true";。我读到它是因为所有类和方法的总和超过了64k。

这是因为我的单子太多吗?这最终会有问题吗?当/如果我发布应用程序,它会引起问题吗?

multiDexEnabled在应用程序中引用超过64000个JVM方法时是必需的。它与任何硬编码数据的大小无关,也与Dart无关。

这不应该是一个问题,但如果你想避免它,在安卓开发者网站上有一些记录在案的东西可以尝试。

另一方面,由于数据是硬编码的,请尽可能使用const

最新更新