A common Dart pattern before null safety for creating static method holder classes was the following:
class MyMethodScope {
/// Prevents instantiation of this class.
factory MyMethodScope._() => null;
static void noop() {}
}
This is not possible with null safety because the return type of a factory constructor is not nullable apparently.