Answer
      • 2
    • This limitation is not a problem for regular Java projects, since you can have multiple class files. It is mostly relevant to Android projects, because the build toolchain combines all of the bytecode into a single classes.dex file. So the question is does Flutter running on Android have a similar issue?

Dart VM has no limitations on the number of methods in the program.

There is however a limitation on the number of classes in the program, namely Dart VM would not be able to run an application with more than 65536 classes, because of how it lays out objects in the heap - each object in the heap has a 16-bit field called "class id" which contains the index of a class of this object.

  • 1
Reply Report
      • 1
    • @VyacheslavEgorov Can you think of a way to get the number of classes on the heap by getting the max class ID? I thought observatory, but I can't remember if it's possible to connect to Dartium or if that only works for cmd line.

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions