Add the abstract
class modifier to the dart:io
Platform
class.
Platform
only has static
properties so there is no reason to make instances of it.
All code that constructs Platform
(i.e. Platform()
) will break. There is one known pattern where this is done: package:dcli
implements a non-static extension on Platform
to allow users to get the line ending for the platform i.e.
Platform().eol;
In Dart 3.1:
Platform
is deprecated.Platform
contains a lineTerminator
property that obviates the need for the extension in package:dcli
.Before we mark Platform
as abstract
, I will remove the extension
from package:dcli
and give users some time to update their dependencies. Making the change in Dart 3.2 would give users an approximately 6 week period to update their dependencies and code.