浏览代码

material fixes (6)

/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
63a94891
共有 7 个文件被更改,包括 30 次插入30 次删除
  1. 8
      com.unity.uiwidgets/Runtime/material/banner.cs
  2. 6
      com.unity.uiwidgets/Runtime/material/bottom_app_bar.cs
  3. 8
      com.unity.uiwidgets/Runtime/material/bottom_sheet.cs
  4. 12
      com.unity.uiwidgets/Runtime/material/divider.cs
  5. 2
      com.unity.uiwidgets/Runtime/material/ink_well.cs
  6. 20
      com.unity.uiwidgets/Runtime/material/tooltip.cs
  7. 4
      com.unity.uiwidgets/Runtime/widgets/framework.cs

8
com.unity.uiwidgets/Runtime/material/banner.cs


MaterialBannerThemeData bannerTheme = MaterialBannerTheme.of(context);
bool isSingleRow = actions.Count == 1 && !forceActionsBelow;
EdgeInsetsGeometry padding = this.padding ?? bannerTheme.padding ?? (isSingleRow
EdgeInsetsGeometry padding = this.padding ?? bannerTheme?.padding ?? (isSingleRow
?? bannerTheme.padding
?? bannerTheme?.padding
?? EdgeInsetsDirectional.only(end: 16.0f);
Widget buttonBar = new ButtonBar(

Color backgroundColor = this.backgroundColor
?? bannerTheme.backgroundColor
?? bannerTheme?.backgroundColor
?? bannerTheme.contentTextStyle
?? bannerTheme?.contentTextStyle
?? theme.textTheme.bodyText2;
var rowList = new List<Widget>();

6
com.unity.uiwidgets/Runtime/material/bottom_app_bar.cs


public override Widget build(BuildContext context) {
BottomAppBarTheme babTheme = BottomAppBarTheme.of(context);
NotchedShape notchedShape = widget.shape ?? babTheme.shape;
NotchedShape notchedShape = widget.shape ?? babTheme?.shape;
CustomClipper<Path> clipper = notchedShape != null
? (CustomClipper<Path>) new _BottomAppBarClipper(
geometry: geometryListenable,

: new ShapeBorderClipper(shape: new RoundedRectangleBorder());
float elevation = widget.elevation ?? babTheme.elevation ?? _defaultElevation;
Color color = widget.color ?? babTheme.color ?? Theme.of(context).bottomAppBarColor;
float elevation = widget.elevation ?? babTheme?.elevation ?? _defaultElevation;
Color color = widget.color ?? babTheme?.color ?? Theme.of(context).bottomAppBarColor;
Color effectiveColor = ElevationOverlay.applyOverlay(context, color, elevation);
return new PhysicalShape(
clipper: clipper,

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


public override Widget build(BuildContext context) {
BottomSheetThemeData bottomSheetTheme = Theme.of(context).bottomSheetTheme;
Color color = widget.backgroundColor ?? bottomSheetTheme.backgroundColor;
float elevation = widget.elevation ?? bottomSheetTheme.elevation ?? 0;
ShapeBorder shape = widget.shape ?? bottomSheetTheme.shape;
Clip clipBehavior = widget.clipBehavior ?? bottomSheetTheme.clipBehavior ?? Clip.none;
Color color = widget.backgroundColor ?? bottomSheetTheme?.backgroundColor;
float elevation = widget.elevation ?? bottomSheetTheme?.elevation ?? 0;
ShapeBorder shape = widget.shape ?? bottomSheetTheme?.shape;
Clip clipBehavior = widget.clipBehavior ?? bottomSheetTheme?.clipBehavior ?? Clip.none;
Widget bottomSheet = new Material(
key: _childKey,

12
com.unity.uiwidgets/Runtime/material/divider.cs


public static BorderSide createBorderSide(BuildContext context, Color color = null, float? width = null) {
Color effectiveColor = color
?? (context != null
? (DividerTheme.of(context).color ?? Theme.of(context).dividerColor)
? (DividerTheme.of(context)?.color ?? Theme.of(context).dividerColor)
?? (context != null ? DividerTheme.of(context).thickness : null)
?? (context != null ? DividerTheme.of(context)?.thickness : null)
?? 0.0f;
// Prevent assertion since it is possible that context is null and no color

public override Widget build(BuildContext context) {
DividerThemeData dividerTheme = DividerTheme.of(context);
float height = this.height ?? dividerTheme.space ?? 16.0f;
float thickness = this.thickness ?? dividerTheme.thickness ?? 0.0f;
float indent = this.indent ?? dividerTheme.indent ?? 0.0f;
float endIndent = this.endIndent ?? dividerTheme.endIndent ?? 0.0f;
float height = this.height ?? dividerTheme?.space ?? 16.0f;
float thickness = this.thickness ?? dividerTheme?.thickness ?? 0.0f;
float indent = this.indent ?? dividerTheme?.indent ?? 0.0f;
float endIndent = this.endIndent ?? dividerTheme?.endIndent ?? 0.0f;
return new SizedBox(
height: height,

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


}
D.assert(_currentSplash == null);
foreach (_HighlightType highlight in _highlights.Keys) {
foreach (_HighlightType highlight in _highlights.Keys.ToList()) {
_highlights[highlight]?.dispose();
_highlights[highlight] = null;
}

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


);
}
height = widget.height ?? tooltipTheme.height ?? _defaultTooltipHeight;
padding = widget.padding ?? tooltipTheme.padding ?? _defaultPadding;
margin = widget.margin ?? tooltipTheme.margin ?? _defaultMargin;
verticalOffset = widget.verticalOffset ?? tooltipTheme.verticalOffset ?? _defaultVerticalOffset;
preferBelow = widget.preferBelow ?? tooltipTheme.preferBelow ?? _defaultPreferBelow;
excludeFromSemantics = widget.excludeFromSemantics ?? tooltipTheme.excludeFromSemantics ?? _defaultExcludeFromSemantics;
decoration = widget.decoration ?? tooltipTheme.decoration ?? defaultDecoration;
textStyle = widget.textStyle ?? tooltipTheme.textStyle ?? defaultTextStyle;
waitDuration = widget.waitDuration ?? tooltipTheme.waitDuration ?? _defaultWaitDuration;
showDuration = widget.showDuration ?? tooltipTheme.showDuration ?? _defaultShowDuration;
height = widget.height ?? tooltipTheme?.height ?? _defaultTooltipHeight;
padding = widget.padding ?? tooltipTheme?.padding ?? _defaultPadding;
margin = widget.margin ?? tooltipTheme?.margin ?? _defaultMargin;
verticalOffset = widget.verticalOffset ?? tooltipTheme?.verticalOffset ?? _defaultVerticalOffset;
preferBelow = widget.preferBelow ?? tooltipTheme?.preferBelow ?? _defaultPreferBelow;
excludeFromSemantics = widget.excludeFromSemantics ?? tooltipTheme?.excludeFromSemantics ?? _defaultExcludeFromSemantics;
decoration = widget.decoration ?? tooltipTheme?.decoration ?? defaultDecoration;
textStyle = widget.textStyle ?? tooltipTheme?.textStyle ?? defaultTextStyle;
waitDuration = widget.waitDuration ?? tooltipTheme?.waitDuration ?? _defaultWaitDuration;
showDuration = widget.showDuration ?? tooltipTheme?.showDuration ?? _defaultShowDuration;
Widget result = new GestureDetector(
behavior: HitTestBehavior.opaque,

4
com.unity.uiwidgets/Runtime/widgets/framework.cs


}
}
public class ParentDataElement<T> : ParentDataElement where T : ParentData {
public class ParentDataElement<T> : ParentDataElement where T : IParentData {
public ParentDataElement(ParentDataWidget<T> widget) : base(widget)
{
}

((RenderObjectElement) child)._updateParentData(widget);
}
else {
D.assert(!(child is ParentDataElement<ParentData>));
D.assert(!(child is ParentDataElement<IParentData>));
child.visitChildren(applyParentDataToChild);
}
};

正在加载...
取消
保存