How to test a private function, in Dart?

While I agree that private methods/classes shouldn’t be part of your tests, the meta package does provide an @visibleForTesting attribute, and the analyzer will give you a warning if you attempt to use the member outside of its original library or a test. You can use it like this: import ‘package:meta/meta.dart’; @visibleForTesting String hello() { … Read more