How to declare factory constructor in abstract classes? : <p>I want to declare, but not define a factory constructor in an abstract class.</p>

<p>In my case, I want to create a method that accepts any class that implements a <code>String toJson()</code> method as well as a <code>fromJson(Map&lt;String, dynamic&gt; data)</code> factory constructor.</p>

<p>Is there any way to achieve that in Dart?
I'm looking for something like the following, which is not valid Dart code:</p>

<pre class="lang-dart prettyprint-override"><code>abstract class JsonSerializable {
  factory fromJson(Map&lt;String, dynamic&gt; data);
  String toJson();
}
</code></pre>
