I keep getting an error when I try to extend the Exception class and can't figure out why. Here is the code for my custom exception:
class MyException extends Exception {
String msg;
MyException(this.msg);
String toString() => 'FooException: $msg';
}
The error resolves around the constructor. It complains that "The generative constructor 'Exception([dynamic message]) -> Exception' expected, but factory found". How do I fix this?