If you open int.dart class source code, you'll find isEven is written as:
/** Returns true if and only if this integer is even. */
bool get isEven;
I want to know in which class this method is implemented?
It's implemented in the implementation class which implements the int interface.
Which class that is (or if there really is a class) depends on the backend.
The VM has a number of classes implementing int, but all of them get their isEven implementation from the same superclass.
When compiling to JavaScript, integers are represented directly by JavaScript numbers.
The compiled code treats those as Dart objects implementing the internal class, and that too implements isEven.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With