public Ticker createTicker(TickerCallback onTick) { this._tickers = this._tickers ?? new HashSet<Ticker>(); var result = new _WidgetTicker<T>(onTick, this, debugLabel: "created by " + this); this._tickers.Add(result); return result; }
public Ticker createTicker(TickerCallback onTick) { D.assert(() => { if (this._ticker == null) { return(true); } throw new UIWidgetsError( this.GetType() + " is a SingleTickerProviderStateMixin but multiple tickers were created.\n" + "A SingleTickerProviderStateMixin can only be used as a TickerProvider once. If a " + "State 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 SingleTickerProviderStateMixin, use a regular TickerProviderStateMixin." ); }); Func <string> debugLabel = null; D.assert(() => { debugLabel = () => "created by " + this; return(true); }); this._ticker = new Ticker(onTick, debugLabel: debugLabel); return(this._ticker); }
internal _WidgetTicker( TickerCallback onTick, TickerProviderStateMixin<T> creator, string debugLabel = null) : base(onTick: onTick, debugLabel: debugLabel) { this._creator = creator; }
internal _AutomaticWidgetTicker( TickerCallback onTick, AutomaticKeepAliveClientWithTickerProviderStateMixin <T> creator, string debugLabel = null) : base(onTick: onTick, debugLabel: debugLabel) { this._creator = creator; }
public Ticker(TickerCallback onTick, Func <string> debugLabel = null) { D.assert(() => { this._debugCreationStack = "skipped, use StackTraceUtility.ExtractStackTrace() if you need it"; // StackTraceUtility.ExtractStackTrace(); return(true); }); this._onTick = onTick; this.debugLabel = debugLabel; }
public Ticker(TickerCallback onTick, string debugLabel = null) { D.assert(() => { _debugCreationStack = StackTraceUtility.ExtractStackTrace(); return(true); }); _onTick = onTick; this.debugLabel = debugLabel; }
public Ticker(TickerCallback onTick, string debugLabel = null) { D.assert(() => { this._debugCreationStack = new StackTrace(); return(true); }); this._onTick = onTick; this.debugLabel = debugLabel; }
public Ticker createTicker(TickerCallback onTick) { _tickers = _tickers ?? new HashSet <Ticker>(); var result = new _AutomaticWidgetTicker <T>(onTick, this, debugLabel: foundation_.kDebugMode ? "created by " + this : null); _tickers.Add(result); return(result); }
public Ticker createTicker(TickerCallback onTick) { this._tickers = this._tickers ?? new HashSet <Ticker>(); var debugLabel = ""; D.assert(() => { debugLabel = "created by " + this; return(true); }); var result = new _AutomaticWidgetTicker <T>(onTick, this, debugLabel: debugLabel); this._tickers.Add(result); return(result); }
public Ticker createTicker(TickerCallback onTick) { this._tickers = this._tickers ?? new HashSet <Ticker>(); Func <string> debugLabel = null; D.assert(() => { debugLabel = () => "created by " + this; return(true); }); var result = new _WidgetTicker <T>(onTick, this, debugLabel: debugLabel); this._tickers.Add(result); return(result); }
public Ticker createTicker(TickerCallback onTick) { D.assert(() => { if (_ticker == null) { return(true); } throw new UIWidgetsError(new List <DiagnosticsNode> { new ErrorSummary($"{GetType()} is a SingleTickerProviderStateMixin but multiple tickers were created."), new ErrorDescription("A SingleTickerProviderStateMixin can only be used as a TickerProvider once."), new ErrorHint( "If a State 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 SingleTickerProviderStateMixin, use a regular TickerProviderStateMixin." ) }); }); _ticker = new Ticker(onTick, debugLabel: foundation_.kDebugMode ? $"created by {this}" : null); return(_ticker); }
public Ticker createTicker(TickerCallback onTick) { return(new Ticker(onTick: onTick, () => $"created by {this}")); }
public Ticker createTicker(TickerCallback onTick) { Ticker _ticker = new Ticker(onTick, () => $"created by {this}"); return(_ticker); }
public Ticker createTicker(TickerCallback onTick) { return(new Ticker(onTick)); }