deprecated_instantiate
Instantiating '{0}' is deprecated.
Description
#The analyzer produces this diagnostic when a class annotated with @Deprecated.instantiate
is instantiated. This annotation indicates that the ability to instantiate the class is deprecated, and will soon be removed, perhaps by marking the annotated class with abstract
, or sealed
.
Example
#If the library p
defines a class annotated with @Deprecated.instantiate
:
@Deprecated.instantiate()
class C {}
Then, the following code, when in a library other than p
, produces this diagnostic:
import 'package:p/p.dart';
var c = C();
Common fixes
#Follow any directions found in the Deprecation.instantiate
annotation.
Unless stated otherwise, the documentation on this site reflects Dart 3.9.0. Page last updated on 2025-08-16. View source or report an issue.