|
|
|
|
|
|
using System; |
|
|
|
using Unity.UIWidgets.editor; |
|
|
|
using Unity.UIWidgets.foundation; |
|
|
|
using Unity.UIWidgets.ui; |
|
|
|
using Unity.UIWidgets.widgets; |
|
|
|
|
|
|
|
|
|
|
public readonly bool pure; |
|
|
|
|
|
|
|
public readonly UIWidgetsEditorWindow host; |
|
|
|
|
|
|
|
UIWidgetsEditorWindow host = null, |
|
|
|
ViewModelBuilder<ViewModel> builder = null, |
|
|
|
StoreConverter<State, ViewModel> converter = null, |
|
|
|
bool pure = false, |
|
|
|
|
|
|
D.assert(converter != null); |
|
|
|
this.host = host; |
|
|
|
this.pure = pure; |
|
|
|
this.builder = builder; |
|
|
|
this.converter = converter; |
|
|
|
|
|
|
builder: this.builder, |
|
|
|
converter: this.converter, |
|
|
|
pure: this.pure, |
|
|
|
shouldRebuild: this.shouldRebuild |
|
|
|
shouldRebuild: this.shouldRebuild, |
|
|
|
host : this.host |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public readonly bool pure; |
|
|
|
|
|
|
|
public readonly UIWidgetsEditorWindow host; |
|
|
|
|
|
|
|
public _StoreListener( |
|
|
|
ViewModelBuilder<ViewModel> builder = null, |
|
|
|
StoreConverter<State, ViewModel> converter = null, |
|
|
|
|
|
|
UIWidgetsEditorWindow host = null, |
|
|
|
Key key = null) : base(key) { |
|
|
|
D.assert(builder != null); |
|
|
|
D.assert(converter != null); |
|
|
|
|
|
|
this.converter = converter; |
|
|
|
this.pure = pure; |
|
|
|
this.shouldRebuild = shouldRebuild; |
|
|
|
this.host = host; |
|
|
|
} |
|
|
|
|
|
|
|
public override widgets.State createState() { |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void _handleStateChanged(State state) { |
|
|
|
if (Window.hasInstance) { |
|
|
|
if (this.widget.host != null) { |
|
|
|
var preInstance = Window.instance; |
|
|
|
using (WindowProvider.of(this.widget.host).getScope()) { |
|
|
|
this._innerStateChanged(state); |
|
|
|
} |
|
|
|
Window.instance = preInstance; |
|
|
|
} |
|
|
|
else if (Window.hasInstance) { |
|
|
|
this._innerStateChanged(state); |
|
|
|
} |
|
|
|
else { |
|
|
|