浏览代码

update

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
43ed6fb6
共有 16 个文件被更改,包括 566 次插入43 次删除
  1. 2
      com.unity.uiwidgets/Runtime/material/bottom_sheet.cs
  2. 2
      com.unity.uiwidgets/Runtime/material/date_picker.cs
  3. 2
      com.unity.uiwidgets/Runtime/material/debug.cs
  4. 165
      com.unity.uiwidgets/Runtime/material/dialog.cs
  5. 2
      com.unity.uiwidgets/Runtime/material/dropdown.cs
  6. 2
      com.unity.uiwidgets/Runtime/material/feedback.cs
  7. 1
      com.unity.uiwidgets/Runtime/material/flat_button.cs
  8. 2
      com.unity.uiwidgets/Runtime/material/material_localizations.cs
  9. 2
      com.unity.uiwidgets/Runtime/material/popup_menu.cs
  10. 2
      com.unity.uiwidgets/Runtime/material/refresh_indicator.cs
  11. 2
      com.unity.uiwidgets/Runtime/material/scaffold.cs
  12. 2
      com.unity.uiwidgets/Runtime/material/search.cs
  13. 2
      com.unity.uiwidgets/Runtime/material/tabs.cs
  14. 20
      com.unity.uiwidgets/Runtime/material/text_theme.cs
  15. 398
      com.unity.uiwidgets/Runtime/material/about.cs
  16. 3
      com.unity.uiwidgets/Runtime/material/about.cs.meta

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


using System;
using RSG;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;

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


using System;
using System.Collections.Generic;
using com.unity.uiwidgets.Runtime.rendering;
using RSG;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async;

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


using Unity.UIWidgets.material;
using Unity.UIWidgets.widgets;
namespace uiwidgets {
namespace Unity.UIWidgets.material {
public partial class material_ {
public static bool debugCheckHasMaterial(BuildContext context) {
D.assert(() => {

165
com.unity.uiwidgets/Runtime/material/dialog.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;

namespace Unity.UIWidgets.material {
public partial class material_ {
public static readonly EdgeInsets _defaultInsetPadding =
EdgeInsets.symmetric(horizontal: 40.0f, vertical: 24.0f);
}
public class Dialog : StatelessWidget {
public Dialog(
Key key = null,

Curve insetAnimationCurve = null,
EdgeInsets insetPadding = null,
Clip clipBehavior = Clip.none,
if (insetPadding == null) {
insetPadding = material_._defaultInsetPadding;
}
this.insetPadding = insetPadding;
this.clipBehavior = clipBehavior;
this.shape = shape;
}

public readonly Curve insetAnimationCurve;
public readonly EdgeInsets insetPadding;
public readonly Clip clipBehavior;
public readonly ShapeBorder shape;
public readonly Widget child;

public override Widget build(BuildContext context) {
DialogTheme dialogTheme = DialogTheme.of(context);
EdgeInsets effectivePadding = MediaQuery.of(context).viewInsets + (insetPadding ?? EdgeInsets.all(0.0f));
padding: MediaQuery.of(context).viewInsets + EdgeInsets.symmetric(horizontal: 40.0f, vertical: 24.0f),
padding: effectivePadding,
duration: insetAnimationDuration,
curve: insetAnimationCurve,
child: MediaQuery.removeViewInsets(

constraints: new BoxConstraints(minWidth: 280.0f),
child: new Material(
color: backgroundColor ?? dialogTheme.backgroundColor ??
Theme.of(context).dialogBackgroundColor,
Theme.of(context).dialogBackgroundColor,
clipBehavior: clipBehavior,
child: child
)
)

EdgeInsets contentPadding = null,
TextStyle contentTextStyle = null,
List<Widget> actions = null,
EdgeInsetsGeometry actionsPadding = null,
VerticalDirection actionsOverflowDirection = VerticalDirection.up,
float actionsOverflowButtonSpacing = 0,
EdgeInsetsGeometry buttonPadding = null,
ShapeBorder shape = null
EdgeInsets insetPadding = null,
Clip clipBehavior = Clip.none,
ShapeBorder shape = null,
bool scrollable = false
) : base(key: key) {
this.title = title;
this.titlePadding = titlePadding;

this.contentTextStyle = contentTextStyle;
this.actions = actions;
this.actionsPadding = actionsPadding ?? EdgeInsets.zero;
this.actionsOverflowDirection = actionsOverflowDirection;
this.actionsOverflowButtonSpacing = actionsOverflowButtonSpacing;
this.buttonPadding = buttonPadding;
this.insetPadding = insetPadding ?? material_._defaultInsetPadding;
this.clipBehavior = clipBehavior;
this.scrollable = scrollable;
}
public readonly Widget title;

public readonly EdgeInsets contentPadding;
public readonly TextStyle contentTextStyle;
public readonly List<Widget> actions;
public readonly EdgeInsetsGeometry actionsPadding;
public readonly VerticalDirection actionsOverflowDirection;
public readonly float actionsOverflowButtonSpacing;
public readonly EdgeInsetsGeometry buttonPadding;
public readonly EdgeInsets insetPadding;
public readonly Clip clipBehavior;
public readonly bool scrollable;
// D.assert(debugCheckHasMaterialLocalizations(context));
D.assert(material_.debugCheckHasMaterialLocalizations(context));
List<Widget> children = new List<Widget>();
Widget titleWidget = null;
Widget contentWidget = null;
Widget actionsWidget = null;
children.Add(new Padding(
padding: titlePadding ??
EdgeInsets.fromLTRB(24.0f, 24.0f, 24.0f, content == null ? 20.0f : 0.0f),
titleWidget = new Padding(
padding: titlePadding ?? EdgeInsets.fromLTRB(24.0f, 24.0f, 24.0f, content == null ? 20.0f : 0.0f),
style: titleTextStyle ?? dialogTheme.titleTextStyle ?? theme.textTheme.title,
style: titleTextStyle ?? dialogTheme.titleTextStyle ?? theme.textTheme.headline6,
));
);
children.Add(new Flexible(
child: new Padding(
padding: contentPadding,
child: new DefaultTextStyle(
style: contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subhead,
child: content
)
contentWidget = new Padding(
padding: contentPadding,
child: new DefaultTextStyle(
style: contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subtitle1,
child: content
));
);
children.Add(ButtonTheme.bar(
actionsWidget = new Padding(
padding: actionsPadding,
buttonPadding: buttonPadding,
overflowDirection: actionsOverflowDirection,
overflowButtonSpacing: actionsOverflowButtonSpacing,
));
);
}
List<Widget> columnChildren;
if (scrollable) {
var titleList = new List<Widget>();
if (title != null) {
titleList.Add(titleWidget);
}
if (content != null) {
titleList.Add(contentWidget);
}
columnChildren = new List<Widget>();
if (title != null || content != null) {
columnChildren.Add(new Flexible(
child: new SingleChildScrollView(
child: new Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: titleList
)
)
));
}
if (actions != null) {
columnChildren.Add(actionsWidget);
}
}
else {
columnChildren = new List<Widget>();
if (title != null) {
columnChildren.Add(titleWidget);
}
if (content != null) {
columnChildren.Add(new Flexible(child: contentWidget));
}
if (actions != null) {
columnChildren.Add(actionsWidget);
}
}
Widget dialogChild = new IntrinsicWidth(

children: children
children: columnChildren
)
);

insetPadding: insetPadding,
clipBehavior: clipBehavior,
shape: shape,
child: dialogChild
);

EdgeInsets padding = null,
this.padding = padding;
this.child = child;
}

public readonly EdgeInsets padding;
padding: EdgeInsets.symmetric(vertical: 8.0f, horizontal: 24.0f),
padding: padding ?? EdgeInsets.symmetric(vertical: 8.0f, horizontal: 24.0f),
child: child
)
);

public override Widget build(BuildContext context) {
D.assert(material_.debugCheckHasMaterialLocalizations(context));
ThemeData theme = Theme.of(context);
List<Widget> body = new List<Widget>();

child: new DefaultTextStyle(
style: Theme.of(context).textTheme.title,
style: theme.textTheme.headline6,
child: title
)
));

}
}
public static class DialogUtils {
static Widget _buildmaterial_ialogTransitions(BuildContext context, Animation<float> animation,
public partial class material_ {
static Widget _buildMaterialDialogTransitions(BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation, Widget child) {
return new FadeTransition(
opacity: new CurvedAnimation(

);
}
public static IPromise<object> showDialog(
public static Future<T> showDialog<T>(
WidgetBuilder builder = null
WidgetBuilder builder = null,
bool useRootNavigator = true,
RouteSettings routeSettings = null
D.assert(material_.debugCheckHasMaterialLocalizations(context));
D.assert(debugCheckHasMaterialLocalizations(context));
return widgets.DialogUtils.showGeneralDialog(
return widgets.DialogUtils.showGeneralDialog<T>(
context: context,
pageBuilder: (buildContext, animation, secondaryAnimation) => {
Widget pageChild = new Builder(builder: builder);

barrierDismissible: barrierDismissible,
barrierColor: Colors.black54,
transitionDuration: new TimeSpan(0, 0, 0, 0, 150),
transitionBuilder: _buildmaterial_ialogTransitions
transitionBuilder: _buildMaterialDialogTransitions,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings
);
}
}

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


using System;
using System.Collections.Generic;
using System.Linq;
using RSG;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;

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


using RSG;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.widgets;
using UnityEngine;

1
com.unity.uiwidgets/Runtime/material/flat_button.cs


using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using Brightness = Unity.UIWidgets.service.Brightness;
namespace Unity.UIWidgets.material {
public class FlatButton : MaterialButton {

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


using System;
using System.Collections.Generic;
using System.Text;
using RSG;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

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


using System;
using System.Collections.Generic;
using RSG;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;

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


using System;
using System.Collections.Generic;
using RSG;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;

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


using System;
using System.Collections.Generic;
using System.Linq;
using RSG;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;

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


using System;
using System.Collections.Generic;
using RSG;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;

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


using System.Collections.Generic;
using RSG;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;

20
com.unity.uiwidgets/Runtime/material/text_theme.cs


}
public readonly TextStyle headline1;
public readonly TextStyle headline2;
public readonly TextStyle headline3;
public readonly TextStyle headline4;
public readonly TextStyle headline5;
public readonly TextStyle headline6;
public readonly TextStyle subtitle1;
public readonly TextStyle subtitle2;
public readonly TextStyle bodyText1;
public readonly TextStyle bodyText2;
public readonly TextStyle display4;
public readonly TextStyle display3;

398
com.unity.uiwidgets/Runtime/material/about.cs


using System.Collections.Generic;
using developer;
using uiwidgets;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using DialogUtils = Unity.UIWidgets.material.DialogUtils;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.material {
public class AboutListTile : StatelessWidget {
public AboutListTile(
Key key,
Widget icon = null,
Widget child = null,
string applicationName = null,
string applicationVersion = null,
Widget applicationIcon = null,
string applicationLegalese = null,
List<Widget> aboutBoxChildren = null,
bool dense = false
) : base(key: key) {
this.icon = icon;
this.child = child;
this.applicationName = applicationName;
this.applicationVersion = applicationVersion;
this.applicationIcon = applicationIcon;
this.applicationLegalese = applicationLegalese;
this.aboutBoxChildren = aboutBoxChildren;
this.dense = dense;
}
public readonly Widget icon;
public readonly Widget child;
public readonly string applicationName;
public readonly string applicationVersion;
public readonly Widget applicationIcon;
public readonly string applicationLegalese;
public readonly List<Widget> aboutBoxChildren;
public readonly bool dense;
public override Widget build(BuildContext context) {
D.assert(material_.debugCheckHasMaterial(context));
D.assert(material_.debugCheckHasMaterialLocalizations(context));
return new ListTile(
leading: icon,
title: child ?? new Text(MaterialLocalizations.of(context).aboutListTileTitle(
applicationName ?? material_._defaultApplicationName(context)
)),
dense: dense,
onTap: () => {
material_.showAboutDialog(
context: context,
applicationName: applicationName,
applicationVersion: applicationVersion,
applicationIcon: applicationIcon,
applicationLegalese: applicationLegalese,
children: aboutBoxChildren
);
}
);
}
}
public partial class material_ {
public static void showAboutDialog(
BuildContext context,
string applicationName = null,
string applicationVersion = null,
Widget applicationIcon = null,
string applicationLegalese = null,
List<Widget> children = null,
bool useRootNavigator = true,
RouteSettings routeSettings = null
) {
D.assert(context != null);
D.assert(useRootNavigator != null);
DialogUtils.showDialog<object>(
context: context,
useRootNavigator: useRootNavigator,
builder: (BuildContext context) => {
return new AboutDialog(
applicationName: applicationName,
applicationVersion: applicationVersion,
applicationIcon: applicationIcon,
applicationLegalese: applicationLegalese,
children: children
);
}
,
routeSettings: routeSettings
);
}
public static void showLicensePage(
BuildContext context,
string applicationName = null,
string applicationVersion = null,
Widget applicationIcon = null,
string applicationLegalese = null,
bool useRootNavigator = false
) {
D.assert(context != null);
D.assert(useRootNavigator != null);
Navigator.of(context, rootNavigator: useRootNavigator).push(new MaterialPageRoute(
builder: (BuildContext context) => new LicensePage(
applicationName: applicationName,
applicationVersion: applicationVersion,
applicationIcon: applicationIcon,
applicationLegalese: applicationLegalese
)
));
}
}
public class AboutDialog : StatelessWidget {
public AboutDialog(
Key key = null,
string applicationName = null,
string applicationVersion = null,
Widget applicationIcon = null,
string applicationLegalese = null,
List<Widget> children = null
) : base(key: key) {
this.applicationName = applicationName;
this.applicationVersion = applicationVersion;
this.applicationIcon = applicationIcon;
this.applicationLegalese = applicationLegalese;
this.children = children;
}
public readonly string applicationName;
public readonly string applicationVersion;
public readonly Widget applicationIcon;
public readonly string applicationLegalese;
public readonly List<Widget> children;
public override Widget build(BuildContext context) {
D.assert(material_.debugCheckHasMaterialLocalizations(context));
string name = applicationName ?? material_._defaultApplicationName(context);
string version = applicationVersion ?? material_._defaultApplicationVersion(context);
Widget icon = applicationIcon ?? material_._defaultApplicationIcon(context);
var listChildren = new List<Widget>();
var rowChildren = new List<Widget>();
if (icon != null) {
rowChildren.Add(new IconTheme(data: Theme.of(context).iconTheme, child: icon));
}
rowChildren.Add(new Expanded(
child: new Padding(
padding: EdgeInsets.symmetric(horizontal: 24.0f),
child: new ListBody(
children: new List<Unity.UIWidgets.widgets.Widget>() {
new Text(name, style: Theme.of(context).textTheme.headline5),
new Text(version, style: Theme.of(context).textTheme.bodyText2),
new Container(height: 18.0f),
new Text(applicationLegalese ?? "", style: Theme.of(context).textTheme.caption)
}
)
)
));
listChildren.Add(new Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: rowChildren
)
);
listChildren.AddRange(children);
return new AlertDialog(
content: new ListBody(
children: listChildren
),
actions: new List<Unity.UIWidgets.widgets.Widget>(){
new FlatButton(
child: new Text(MaterialLocalizations.of(context).viewLicensesButtonLabel),
onPressed: () => {
material_.showLicensePage(
context: context,
applicationName: applicationName,
applicationVersion: applicationVersion,
applicationIcon: applicationIcon,
applicationLegalese: applicationLegalese
);
}
),
new FlatButton(
child: new Text(MaterialLocalizations.of(context).closeButtonLabel),
onPressed: () => { Navigator.pop(context); }
)
},
scrollable: true
);
}
}
public class LicensePage : StatefulWidget {
public LicensePage(
Key key = null,
string applicationName = null,
string applicationVersion = null,
Widget applicationIcon = null,
string applicationLegalese = null
) : base(key: key) {
this.applicationName = applicationName;
this.applicationVersion = applicationVersion;
this.applicationIcon = applicationIcon;
this.applicationLegalese = applicationLegalese;
}
public readonly string applicationName;
public readonly string applicationVersion;
public readonly Widget applicationIcon;
public readonly string applicationLegalese;
public override State createState() => new _LicensePageState();
}
public class _LicensePageState : State<LicensePage> {
public override void initState() {
base.initState();
_initLicenses();
}
readonly List<Widget> _licenses = new List<Widget>();
bool _loaded = false;
Future _initLicenses() {
int debugFlowId = -1;
// D.assert(() => {
// Flow flow = Flow.begin();
// Timeline.timeSync("_initLicenses()", () { }, flow: flow);
// debugFlowId = flow.id;
// return true;
// }());
// Future.forEach(LicenseRegistry.licenses, license => { });
// await for (final LicenseEntry license in LicenseRegistry.licenses) {
// if (!mounted) {
// return;
// }
// D.assert(() {
// Timeline.timeSync("_initLicenses()", () { }, flow: Flow.step(debugFlowId));
// return true;
// }());
// final List<LicenseParagraph> paragraphs =
// await SchedulerBinding.instance.scheduleTask<List<LicenseParagraph>>(
// license.paragraphs.toList,
// Priority.animation,
// debugLabel: "License",
// );
// if (!mounted) {
// return;
// }
// setState(() {
// _licenses.add(const Padding(
// padding: EdgeInsets.symmetric(vertical: 18.0),
// child: Text(
// "🍀‬", // That"s U+1F340. Could also use U+2766 (❦) if U+1F340 doesn"t work everywhere.
// textAlign: TextAlign.center,
// ),
// ));
// _licenses.add(Container(
// decoration: const BoxDecoration(
// border: Border(bottom: BorderSide(width: 0.0))
// ),
// child: Text(
// license.packages.join(", "),
// style: const TextStyle(fontWeight: FontWeight.bold),
// textAlign: TextAlign.center,
// ),
// ));
// for (final LicenseParagraph paragraph in paragraphs) {
// if (paragraph.indent == LicenseParagraph.centeredIndent) {
// _licenses.add(Padding(
// padding: const EdgeInsets.only(top: 16.0),
// child: Text(
// paragraph.text,
// style: const TextStyle(fontWeight: FontWeight.bold),
// textAlign: TextAlign.center,
// ),
// ));
// } else {
// D.assert(paragraph.indent >= 0);
// _licenses.add(Padding(
// padding: EdgeInsetsDirectional.only(top: 8.0, start: 16.0 * paragraph.indent),
// child: Text(paragraph.text),
// ));
// }
// }
// });
// }
//TODO: implement
setState(() => { _loaded = true; });
return Future.value();
// D.assert(() {
// Timeline.timeSync("Build scheduled", () { }, flow: Flow.end(debugFlowId));
// return true;
// }());
}
public override Widget build(BuildContext context) {
D.assert(material_.debugCheckHasMaterialLocalizations(context));
string name = widget.applicationName ?? material_._defaultApplicationName(context);
string version = widget.applicationVersion ?? material_._defaultApplicationVersion(context);
Widget icon = widget.applicationIcon ?? material_._defaultApplicationIcon(context);
MaterialLocalizations localizations = MaterialLocalizations.of(context);
var list = new List<Widget>();
list.Add(new Text(name, style: Theme.of(context).textTheme.headline5, textAlign: TextAlign.center));
if (icon != null) {
list.Add(new IconTheme(data: Theme.of(context).iconTheme, child: icon));
}
list.Add(new Text(version, style: Theme.of(context).textTheme.bodyText2, textAlign: TextAlign.center));
list.Add(new Container(height: 18.0f));
list.Add(new Text(widget.applicationLegalese ?? "", style: Theme.of(context).textTheme.caption,
textAlign: TextAlign.center));
list.Add(new Container(height: 18.0f));
list.Add(new Text("Powered by Flutter", style: Theme.of(context).textTheme.bodyText2,
textAlign: TextAlign.center));
list.Add(new Container(height: 24.0f));
list.AddRange(_licenses);
if (!_loaded) {
list.Add(new Padding(
padding: EdgeInsets.symmetric(vertical: 24.0f),
child: new Center(
child: new CircularProgressIndicator()
)
));
}
return new Scaffold(
appBar: new AppBar(
title: new Text(localizations.licensesPageTitle)
),
// All of the licenses page text is English. We don"t want localized text
// or text direction.
body: new Localizations(
locale: new Locale("en", "US"),
context: context,
child: new DefaultTextStyle(
style: Theme.of(context).textTheme.caption,
child: new SafeArea(
bottom: false,
child: new Scrollbar(
child: new ListView(
padding: EdgeInsets.symmetric(horizontal: 8.0f, vertical: 12.0f),
children: list
)
)
)
)
)
);
}
}
public partial class material_ {
internal static string _defaultApplicationName(BuildContext context) {
// This doesn"t handle the case of the application"s title dynamically
// changing. In theory, we should make Title expose the current application
// title using an InheritedWidget, and so forth. However, in practice, if
// someone really wants their application title to change dynamically, they
// can provide an explicit applicationName to the widgets defined in this
// file, instead of relying on the default.
Title ancestorTitle = context.findAncestorWidgetOfExactType<Title>();
return ancestorTitle?.title ?? Platform.resolvedExecutable.split(Platform.pathSeparator).last;
}
internal static string _defaultApplicationVersion(BuildContext context) {
// TODO(ianh): Get this from the embedder somehow.
return "";
}
internal static Widget _defaultApplicationIcon(BuildContext context) {
// TODO(ianh): Get this from the embedder somehow.
return null;
}
}
}

3
com.unity.uiwidgets/Runtime/material/about.cs.meta


fileFormatVersion: 2
guid: 47be38a1340b436f906cd35c53c1bc83
timeCreated: 1611111948
正在加载...
取消
保存