createTicker method
Creates a ticker with the given callback.
The kind of ticker provided depends on the kind of ticker provider.
Implementation
@override
Ticker createTicker(TickerCallback onTick) {
assert(() {
if (_ticker == null) return true;
throw FlutterError.fromParts(
<DiagnosticsNode>[
ErrorSummary(
'$runtimeType is a SingleTickerProviderWidgetModelMixin but multiple tickers were created.',
),
ErrorDescription(
'A SingleTickerProviderWidgetModelMixin can only be used as a TickerProvider once.',
),
ErrorHint(
'If a WidgetModel is used for multiple AnimationController objects, or if it is passed to other '
'objects and those objects might use it more than one time in total, then instead of '
'mixing in a SingleTickerProviderWidgetModelMixin, implement your own TickerProviderWidgetModelMixin.',
),
],
);
}());
_ticker =
Ticker(onTick, debugLabel: kDebugMode ? 'created by $this' : null);
return _ticker!;
}