浏览代码

fix future.value

/zgh-devtools
guanghuispark 4 年前
当前提交
7b061a74
共有 16 个文件被更改,包括 33 次插入39 次删除
  1. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/dialog_demo.cs
  2. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/text_form_field_demo.cs
  3. 7
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/expanding_bottom_sheet.cs
  4. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demo.cs
  5. 4
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/home.cs
  6. 13
      com.unity.uiwidgets/Runtime/material/feedback.cs
  7. 2
      com.unity.uiwidgets/Runtime/material/tabs.cs
  8. 2
      com.unity.uiwidgets/Runtime/painting/image_provider.cs
  9. 4
      com.unity.uiwidgets/Runtime/rendering/viewport_offset.cs
  10. 4
      com.unity.uiwidgets/Runtime/services/binding.cs
  11. 5
      com.unity.uiwidgets/Runtime/services/clipboard.cs
  12. 3
      com.unity.uiwidgets/Runtime/widgets/localizations.cs
  13. 6
      com.unity.uiwidgets/Runtime/widgets/scroll_position.cs
  14. 2
      com.unity.uiwidgets/Runtime/widgets/scroll_position_with_single_context.cs
  15. 2
      com.unity.uiwidgets/Runtime/widgets/scrollable.cs
  16. 12
      com.unity.uiwidgets/Runtime/widgets/widget_inspector.cs

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/dialog_demo.cs


builder: (BuildContext subContext) => new FullScreenDialogDemo(),
fullscreenDialog: true
));*/
D.assert(false, () => "TO DO >>>");
}
)

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/text_form_field_demo.cs


}
);
}
);
)?? new SynchronousFuture<bool>(false);
}

7
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/expanding_bottom_sheet.cs


// Closes the cart if the cart is open, otherwise exits the app (this should
// only be relevant for Android).
Future<bool> _onWillPop() {
if (!_isOpen) {
if (!_isOpen)
{
return new SynchronousFuture<bool>(true);
return Future.value(true).to<bool>();
return new SynchronousFuture<bool>(true);
return Future.value(true).to<bool>();
}

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demo.cs


}
);
}
);
);
return new SynchronousFuture(null);
}

4
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/home.cs


if (this._category != null)
{
this.setState(() => this._category = null);
return new SynchronousFuture<bool>(false);
return Future.value(false).to<bool>();
return new SynchronousFuture<bool>(true);
return Future.value(true).to<bool>();
},
child: new Backdrop(
backTitle: new Text("Options"),

13
com.unity.uiwidgets/Runtime/material/feedback.cs


public static Future forTap(BuildContext context) {
switch (_platform(context)) {
case RuntimePlatform.Android:
return
new SynchronousFuture(null); // SystemSound.play(SystemSoundType.click); TODO: replace with unity equivalent
return Future.value(); // SystemSound.play(SystemSoundType.click); TODO: replace with unity equivalent
case RuntimePlatform.IPhonePlayer:
case RuntimePlatform.LinuxEditor:
case RuntimePlatform.LinuxPlayer:

case RuntimePlatform.WindowsPlayer:
return new SynchronousFuture(null);
return Future.value();
return new SynchronousFuture(null);
return Future.value();
}
public static GestureTapCallback wrapForTap(GestureTapCallback callback, BuildContext context) {

public static Future forLongPress(BuildContext context) {
switch (_platform(context)) {
case RuntimePlatform.Android:
return new SynchronousFuture(null); // HapticFeedback.vibrate(); TODO
return Future.value(); // HapticFeedback.vibrate(); TODO
case RuntimePlatform.IPhonePlayer:
case RuntimePlatform.LinuxEditor:
case RuntimePlatform.LinuxPlayer:

case RuntimePlatform.WindowsPlayer:
return new SynchronousFuture(null);
return Future.value();
return new SynchronousFuture(null);
return Future.value();
}
public static GestureLongPressCallback

2
com.unity.uiwidgets/Runtime/material/tabs.cs


_pageController.animateToPage(_currentIndex.Value, duration: material_.kTabScrollDuration,
curve: Curves.ease).then((value) => {
if (!mounted) {
return new SynchronousFuture(null);
return Future.value();
}
setState(() => {

2
com.unity.uiwidgets/Runtime/painting/image_provider.cs


completer.complete();
}
return new SynchronousFuture(null);
return Future.value();
}
);
return completer.future.to<ImageCacheStatus>();

4
com.unity.uiwidgets/Runtime/rendering/viewport_offset.cs


public virtual Future moveTo(float to, TimeSpan? duration, Curve curve = null, bool clamp = true) {
if (duration == null || duration.Value == TimeSpan.Zero) {
jumpTo(to);
return new SynchronousFuture(null);
return Future.value();
} else {
return animateTo(to, duration: duration??TimeSpan.Zero , curve: curve ?? Curves.ease);
}

}
public override Future animateTo(float to, TimeSpan duration, Curve curve) {
return new SynchronousFuture(null);
return Future.value();
}
public override ScrollDirection userScrollDirection {

4
com.unity.uiwidgets/Runtime/services/binding.cs


}
protected virtual Future handleSystemMessage(Object systemMessage) {
return new SynchronousFuture(null);
return Future.value();
}
protected virtual void evict(string asset) {

MessageHandler handler = _handlers[channel];
if (handler == null) {
ui_.channelBuffers.push(channel, data, callback);
return new SynchronousFuture(null);
return Future.value();
}
return handler(data).then(bytes => {

5
com.unity.uiwidgets/Runtime/services/clipboard.cs


GUIUtility.systemCopyBuffer = data.text;
#endif
return new SynchronousFuture(null);
return Future.value();
return new SynchronousFuture<ClipboardData>(data);
//Future.value(FutureOr.value(data)).to<ClipboardData>();
return Future.value(FutureOr.value(data)).to<ClipboardData>();
}
#if UNITY_WEBGL

3
com.unity.uiwidgets/Runtime/widgets/localizations.cs


}
if (pendingList == null) {
return new SynchronousFuture<Dictionary<Type, object>>(output);
//Future.value(output).to<Dictionary<Type, object>>();
return new SynchronousFuture<Dictionary<Type, object>>(output);
}
return Future.wait<object>(pendingList.Select(p => p.futureValue))

6
com.unity.uiwidgets/Runtime/widgets/scroll_position.cs


}
break;
}
if (target == pixels) {
return new SynchronousFuture(null);
if (foundation_.FloatEqual(target,pixels)) {
return Future.value();
return new SynchronousFuture(null);
return Future.value();
}
curve = curve ?? Curves.ease;

2
com.unity.uiwidgets/Runtime/widgets/scroll_position_with_single_context.cs


) {
if (PhysicsUtils.nearEqual(to, pixels, physics.tolerance.distance)) {
jumpTo(to);
return new SynchronousFuture(null);
return Future.value();
}
DrivenScrollActivity activity = new DrivenScrollActivity(

2
com.unity.uiwidgets/Runtime/widgets/scrollable.cs


}
if (futures.isEmpty() || duration == TimeSpan.Zero) {
return new SynchronousFuture(null);
return Future.value();
}
if (futures.Count == 1) {

12
com.unity.uiwidgets/Runtime/widgets/widget_inspector.cs


name: name,
callback:
((IDictionary<string, string> parameters) => {
var result = new SynchronousFuture<IDictionary<string, object>>(new Dictionary<string, object>()
{{"result", callback}});
//Future.value(FutureOr.value(new Dictionary<string, object>(){{"result", callback}})).to<IDictionary<string, object>>();
var result = Future.value(FutureOr.value(new Dictionary<string, object>(){{"result", callback}})).to<IDictionary<string, object>>();
return result;
})
);

registerServiceExtension(
name: name,
callback: (IDictionary<string, string> parameters) => {
var result = new SynchronousFuture<IDictionary<string, object>>(new Dictionary<string, object>
{{"result", callback(parameters["objectGroup"])}});
//Future.value(FutureOr.value((new Dictionary<string, object>{{"result", callback(parameters["objectGroup"])}}))).to<IDictionary<string, object>>();
var result = Future.value(FutureOr.value((new Dictionary<string, object>{{"result", callback(parameters["objectGroup"])}}))).to<IDictionary<string, object>>();
return result;
}
);

binding.buildOwner.reassemble(binding.renderViewElement);
return binding.endOfFrame;
}
return new SynchronousFuture(null);
return Future.value();
}*/
static string _consoleObjectGroup = "console-group";

getter: () => FlutterError.onError == structuredExceptionHandler,
setter: (bool value)=> {
FlutterError.onError = value ? structuredExceptionHandler : defaultExceptionHandler;
return new SynchronousFuture(null);
return Future.value();
}
);

正在加载...
取消
保存