private void _handleOptionsChanged(GalleryOptions newOptions) { this.setState(() => { if (this._options.timeDilation != newOptions.timeDilation) { this._timeDilationTimer?.cancel(); this._timeDilationTimer = null; if (newOptions.timeDilation > 1.0f ) // We delay the time dilation change long enough that the user can see // that UI has started reacting and then we slam on the brakes so that // they see that the time is in fact now dilated. { this._timeDilationTimer = Timer.create(new TimeSpan(0, 0, 0, 0, 150), () => { scheduler_.timeDilation = newOptions.timeDilation; }); } else { scheduler_.timeDilation = newOptions.timeDilation; } } this._options = newOptions; }); }
public override void initState() { base.initState(); this._options = new GalleryOptions( theme: GalleryTheme.kLightGalleryTheme, textScaleFactor: GalleryTextScaleValue.kAllGalleryTextScaleValues[0], timeDilation: SchedulerBinding.instance.timeDilation, platform: Application.platform ); }
public GalleryOptionsPage( Key key = null, GalleryOptions options = null, ValueChanged <GalleryOptions> onOptionsChanged = null, VoidCallback onSendFeedback = null ) : base(key: key) { this.options = options; this.onOptionsChanged = onOptionsChanged; this.onSendFeedback = onSendFeedback; }
public GalleryHome( Key key = null, bool testMode = false, Widget optionsPage = null, GalleryOptions options = null ) : base(key: key) { this.testMode = testMode; this.optionsPage = optionsPage; this.options = options; }
public override void initState() { base.initState(); this._options = new GalleryOptions( themeMode: ThemeMode.system, textScaleFactor: GalleryTextScaleValue.kAllGalleryTextScaleValues[0], visualDensity: GalleryVisualDensityValue.kAllGalleryVisualDensityValues[0], timeDilation: scheduler_.timeDilation, platform: defaultTargetPlatform ); this.model = new AppStateModel(); this.model.loadProducts(); }
void _handleOptionsChanged(GalleryOptions newOptions) { this.setState(() => { if (this._options.timeDilation != newOptions.timeDilation) { this._timeDilationTimer?.cancel(); this._timeDilationTimer = null; if (newOptions.timeDilation > 1.0f) { this._timeDilationTimer = Window.instance.run(new TimeSpan(0, 0, 0, 0, 150), () => { SchedulerBinding.instance.timeDilation = newOptions.timeDilation; }); } else { SchedulerBinding.instance.timeDilation = newOptions.timeDilation; } } this._options = newOptions; }); }
public _PlatformItem(GalleryOptions options, ValueChanged <GalleryOptions> onOptionsChanged) { this.options = options; this.onOptionsChanged = onOptionsChanged; }
public _TimeDilationItem(GalleryOptions options, ValueChanged <GalleryOptions> onOptionsChanged) { this.options = options; this.onOptionsChanged = onOptionsChanged; }
public _TextDirectionItem(GalleryOptions options, ValueChanged <GalleryOptions> onOptionsChanged) { this.options = options; this.onOptionsChanged = onOptionsChanged; }
public _VisualDensityItem(GalleryOptions options, ValueChanged <GalleryOptions> onOptionsChanged) { this.options = options; this.onOptionsChanged = onOptionsChanged; }
public _TextScaleFactorItem(GalleryOptions options, ValueChanged <GalleryOptions> onOptionsChanged) { this.options = options; this.onOptionsChanged = onOptionsChanged; }
public _ThemeModeItem(GalleryOptions options, ValueChanged <GalleryOptions> onOptionsChanged) { this.options = options; this.onOptionsChanged = onOptionsChanged; }
public override void reassemble() { this._options = this._options.copyWith(platform: defaultTargetPlatform); base.reassemble(); }