The code below demonstrates two issues that I ran into, and I am unsure if I am doing wrong, or if these are bugs.
It causes the following run-time crash:
I/flutter (18372): The following assertion was thrown while finalizing the widget tree:
I/flutter (18372): _TestWidgetState.dispose failed to call super.dispose.
I/flutter (18372): dispose() implementations must always call their superclass dispose() method, to ensure that all the
I/flutter (18372): resources used by the widget are fully released.
Explicitly implementing a dispose() method that calls super.dispose() does not change the situation. I do not get what causes this, and I would like to understand (possibly the analyser should have picked up on it if invalid code?)
This same code also demonstrates errors when running `dartdoc` on the code. The generation fails with the message:
[error] The class 'TickerProviderStateMixin' can't be used as a mixin because it extends a class other than Object.
import 'package:flutter/material.dart';
abstract class _TestState<T extends StatefulWidget> extends State<T> {
@override
Widget build(BuildContext context);
}
class TestWidget extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _TestWidgetState();
}
class _TestWidgetState extends _TestState<TestWidget> with TickerProviderStateMixin {
@override
Widget build(BuildContext context) => const Text( "foo" );
}
I like to understand why these two issues occur. Thanks in advance for any replies.
Cheers,
Hugo