I am creating a word app to study English vocabulary. It is based on a very large Word Bank that I plan to keep in a list. (Hard coded).
This large list is made up of Word Objects :
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: [],
),
]
There should be between 2000 and 3000 of those Word objects in the list. I have tried working with a huge list like this and the app runs rather well.
On installing FIREBASE (for other parts of the app), I had to authorize "multiDexEnabled true". I read it was because the sum of all classes and methods exceeded 64k.
Is this due to my large list ? Will this be problematic in the end ? Will it cause problems when/if I publish the app ?
multiDexEnabled
is needed when over 64 thousand JVM methods are referenced in an app. It isn't related to the size of any hardcoded data, or anything related to Dart at all.
It shouldn't be an issue, but if you wish to avoid it, there are some documented things to try on the Android Developer website.
On another note, since your data is hardcoded, try to use const
where you can.