Dart Libraries and visibility
Unlike Java, Dart doesn’t have the keywords public, protected, and private. If an identifier startswith an underscore _, it’s private to its library.
If you for example have class A in a separate library file (eg, other.dart), such as:
and then import it into your main app, such as:
You get the expected output: