浏览代码

Merge pull request #276 from UnityTech/yczhang1.5.4

[1.5.4] Finish upgrade material.
/main
GitHub 5 年前
当前提交
7b90a814
共有 47 个文件被更改,包括 2272 次插入925 次删除
  1. 36
      Runtime/gestures/converter.cs
  2. 755
      Runtime/gestures/events.cs
  3. 8
      Runtime/gestures/mouse_tracking.cs
  4. 2
      Runtime/material/app.cs
  5. 39
      Runtime/material/app_bar.cs
  6. 10
      Runtime/material/app_bar_theme.cs
  7. 407
      Runtime/material/bottom_navigation_bar.cs
  8. 2
      Runtime/material/button_theme.cs
  9. 106
      Runtime/material/chip.cs
  10. 22
      Runtime/material/chip_theme.cs
  11. 2
      Runtime/material/dialog.cs
  12. 3
      Runtime/material/drawer.cs
  13. 131
      Runtime/material/dropdown.cs
  14. 32
      Runtime/material/expansion_panel.cs
  15. 4
      Runtime/material/ink_well.cs
  16. 4
      Runtime/material/input_border.cs
  17. 279
      Runtime/material/input_decorator.cs
  18. 16
      Runtime/material/list_tile.cs
  19. 6
      Runtime/material/material.cs
  20. 4
      Runtime/material/material_button.cs
  21. 1
      Runtime/material/popup_menu.cs
  22. 16
      Runtime/material/progress_indicator.cs
  23. 3
      Runtime/material/radio.cs
  24. 113
      Runtime/material/scaffold.cs
  25. 10
      Runtime/material/slider.cs
  26. 4
      Runtime/material/switch.cs
  27. 9
      Runtime/material/tab_bar_theme.cs
  28. 41
      Runtime/material/tabs.cs
  29. 75
      Runtime/material/text_field.cs
  30. 12
      Runtime/material/text_form_field.cs
  31. 16
      Runtime/material/theme_data.cs
  32. 7
      Runtime/material/user_accounts_drawer_header.cs
  33. 2
      Runtime/material/floating_action_button_location.cs.meta
  34. 2
      Runtime/material/floating_action_button.cs.meta
  35. 2
      Runtime/painting/continuous_rectangle_border.cs
  36. 4
      Runtime/painting/text_painter.cs
  37. 2
      Runtime/rendering/editable.cs
  38. 87
      Runtime/ui/pointer.cs
  39. 174
      Runtime/widgets/editable_text.cs
  40. 14
      Runtime/widgets/scrollable.cs
  41. 314
      Runtime/material/floating_action_button.cs
  42. 130
      Runtime/material/floatting_action_button_theme.cs
  43. 11
      Runtime/material/floatting_action_button_theme.cs.meta
  44. 280
      Runtime/material/float_action_button.cs
  45. 0
      /Runtime/material/floating_action_button_location.cs.meta
  46. 0
      /Runtime/material/floating_action_button_location.cs
  47. 0
      /Runtime/material/floating_action_button.cs.meta

36
Runtime/gestures/converter.cs


return $"_PointerState(pointer: {this.pointer}, down: {this.down}, lastPosition: {this.lastPosition})";
}
public int _synthesiseDownButtons(int buttons, PointerDeviceKind kind) {
internal static int _synthesiseDownButtons(int buttons, PointerDeviceKind kind) {
switch (kind) {
case PointerDeviceKind.touch:
return buttons;

public static IEnumerable<PointerEvent> expand(IEnumerable<PointerData> data, float devicePixelRatio) {
foreach (PointerData datum in data) {
var position = new Offset(datum.physicalX, datum.physicalY) / devicePixelRatio;
var radiusMinor = _toLogicalPixels(datum.radiusMinor, devicePixelRatio);
var radiusMajor = _toLogicalPixels(datum.radiusMajor, devicePixelRatio);
var radiusMin = _toLogicalPixels(datum.radiusMin, devicePixelRatio);
var radiusMax = _toLogicalPixels(datum.radiusMax, devicePixelRatio);
case PointerChange.add: {
D.assert(!_pointers.ContainsKey(datum.device));
_PointerState state = _ensureStateForPointer(datum, position);
D.assert(state.lastPosition == position);
yield return new PointerAddedEvent(
timeStamp: timeStamp,
kind: kind,
device: datum.device,
position: position,
obscured: datum.obscured,
pressureMin: datum.pressureMin,
pressureMax: datum.pressureMax,
distance: datum.distance,
distanceMax: datum.distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: datum.orientation,
tilt: datum.tilt
);
break;
}
case PointerChange.down: {
_PointerState state = _ensureStateForPointer(datum, position);
if (state.down) {

state.lastPosition = position;
}
Offset scrollDelta = new Offset(_scrollData.scrollX, _scrollData.scrollY) / devicePixelRatio;
pointer: state.pointer,
delta: new Offset(_scrollData.scrollX, _scrollData.scrollY) / devicePixelRatio
scrollDelta: scrollDelta
);
break;
}

#endif
}
}
}
static float _toLogicalPixels(float physicalPixels, float devicePixelRatio) {
return physicalPixels / devicePixelRatio;
}
}
}

755
Runtime/gestures/events.cs


using System;
using Unity.UIWidgets.foundation;
public abstract class PointerEvent {
public abstract class PointerEvent : Diagnosticable {
PointerDeviceKind kind = PointerDeviceKind.mouse,
PointerDeviceKind kind = PointerDeviceKind.touch,
int buttons = 0,
bool obscured = false,
float pressure = 1.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float size = 0.0f,
float radiusMajor = 0.0f,
float radiusMinor = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f,
int platformData = 0,
bool synthesized = false
) {
this.timeStamp = timeStamp;

this.position = position ?? Offset.zero;
this.delta = delta ?? Offset.zero;
this.buttons = buttons;
this.obscured = obscured;
this.pressure = pressure;
this.pressureMin = pressureMin;
this.pressureMax = pressureMax;
this.distance = distance;
this.distanceMax = distanceMax;
this.size = size;
this.radiusMajor = radiusMajor;
this.radiusMinor = radiusMinor;
this.radiusMin = radiusMin;
this.radiusMax = radiusMax;
this.orientation = orientation;
this.tilt = tilt;
this.platformData = platformData;
this.synthesized = synthesized;
}

public readonly Offset delta;
public readonly int buttons;
public readonly bool obscured;
public readonly float pressure;
public readonly float pressureMin;
public readonly float pressureMax;
public readonly float distance;
public float distanceMin {
get { return 0.0f; }
}
public readonly float distanceMax;
public readonly float size;
public readonly float radiusMajor;
public readonly float radiusMinor;
public readonly float radiusMin;
public readonly float radiusMax;
public readonly float orientation;
public readonly float tilt;
public readonly int platformData;
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Offset>("position", this.position));
properties.add(new DiagnosticsProperty<Offset>("delta", this.delta, defaultValue: Offset.zero,
level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<TimeSpan>("timeStamp", this.timeStamp, defaultValue: TimeSpan.Zero,
level: DiagnosticLevel.debug));
properties.add(new IntProperty("pointer", this.pointer, level: DiagnosticLevel.debug));
properties.add(new EnumProperty<PointerDeviceKind>("kind", this.kind, level: DiagnosticLevel.debug));
properties.add(new IntProperty("device", this.device, defaultValue: 0, level: DiagnosticLevel.debug));
properties.add(new IntProperty("buttons", this.buttons, defaultValue: 0, level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<bool>("down", this.down, level: DiagnosticLevel.debug));
properties.add(
new FloatProperty("pressure", this.pressure, defaultValue: 1.0, level: DiagnosticLevel.debug));
properties.add(new FloatProperty("pressureMin", this.pressureMin, defaultValue: 1.0,
level: DiagnosticLevel.debug));
properties.add(new FloatProperty("pressureMax", this.pressureMax, defaultValue: 1.0,
level: DiagnosticLevel.debug));
properties.add(
new FloatProperty("distance", this.distance, defaultValue: 0.0, level: DiagnosticLevel.debug));
properties.add(new FloatProperty("distanceMin", this.distanceMin, defaultValue: 0.0,
level: DiagnosticLevel.debug));
properties.add(new FloatProperty("distanceMax", this.distanceMax, defaultValue: 0.0,
level: DiagnosticLevel.debug));
properties.add(new FloatProperty("size", this.size, defaultValue: 0.0, level: DiagnosticLevel.debug));
properties.add(new FloatProperty("radiusMajor", this.radiusMajor, defaultValue: 0.0,
level: DiagnosticLevel.debug));
properties.add(new FloatProperty("radiusMinor", this.radiusMinor, defaultValue: 0.0,
level: DiagnosticLevel.debug));
properties.add(new FloatProperty("radiusMin", this.radiusMin, defaultValue: 0.0,
level: DiagnosticLevel.debug));
properties.add(new FloatProperty("radiusMax", this.radiusMax, defaultValue: 0.0,
level: DiagnosticLevel.debug));
properties.add(new FloatProperty("orientation", this.orientation, defaultValue: 0.0,
level: DiagnosticLevel.debug));
properties.add(new FloatProperty("tilt", this.tilt, defaultValue: 0.0, level: DiagnosticLevel.debug));
properties.add(new IntProperty("platformData", this.platformData, defaultValue: 0,
level: DiagnosticLevel.debug));
properties.add(new FlagProperty("obscured", value: this.obscured, ifTrue: "obscured",
level: DiagnosticLevel.debug));
properties.add(new FlagProperty("synthesized", value: this.synthesized, ifTrue: "synthesized",
level: DiagnosticLevel.debug));
}
}
public class PointerAddedEvent : PointerEvent {

int device = 0,
Offset position = null
Offset position = null,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
position: position
) { }
position: position,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,
pressureMax: pressureMax,
distance: distance,
distanceMax: distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt
) {
}
}
public class PointerRemovedEvent : PointerEvent {

int device = 0
int device = 0,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distanceMax = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f
) : base(
timeStamp: timeStamp,
kind: kind,
device: device,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,
pressureMax: pressureMax,
distanceMax: distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax
) {
}
}
public class PointerHoverEvent : PointerEvent {
public PointerHoverEvent(
TimeSpan timeStamp,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset delta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float size = 0.0f,
float radiusMajor = 0.0f,
float radiusMinor = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f,
bool synthesized = false) : base(
timeStamp: timeStamp,
kind: kind,
device: device,
position: position,
delta: delta,
buttons: buttons,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,
pressureMax: pressureMax,
size: size,
radiusMajor: radiusMajor,
radiusMinor: radiusMinor,
distance: distance,
distanceMax: distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
synthesized: synthesized) {
}
}
public class PointerEnterEvent : PointerEvent {
public PointerEnterEvent(
TimeSpan timeStamp,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset delta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float size = 0.0f,
float radiusMajor = 0.0f,
float radiusMinor = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f,
bool synthesized = false,
bool down = false) : base(
timeStamp: timeStamp,
kind: kind,
device: device,
position: position,
delta: delta,
buttons: buttons,
down: down,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,
pressureMax: pressureMax,
size: size,
radiusMajor: radiusMajor,
radiusMinor: radiusMinor,
distance: distance,
distanceMax: distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
synthesized: synthesized) {
}
public static PointerEnterEvent fromHoverEvent(PointerHoverEvent e) {
return fromMouseEvent(e);
}
public static PointerEnterEvent fromMouseEvent(PointerEvent hover) {
return new PointerEnterEvent(
timeStamp: hover?.timeStamp ?? TimeSpan.Zero,
kind: hover?.kind ?? PointerDeviceKind.touch,
device: hover?.device ?? 0,
position: hover?.position,
delta: hover?.delta,
buttons: hover?.buttons ?? 0,
down: hover?.down ?? false,
obscured: hover?.obscured ?? false,
pressure: hover?.pressure ?? 0.0f,
pressureMin: hover?.pressureMin ?? 1.0f,
pressureMax: hover?.pressureMax ?? 1.0f,
distance: hover?.distance ?? 0.0f,
distanceMax: hover?.distanceMax ?? 0.0f,
size: hover?.size ?? 0.0f,
radiusMajor: hover?.radiusMajor ?? 0.0f,
radiusMinor: hover?.radiusMinor ?? 0.0f,
radiusMin: hover?.radiusMin ?? 0.0f,
radiusMax: hover?.radiusMax ?? 0.0f,
orientation: hover?.orientation ?? 0.0f,
tilt: hover?.tilt ?? 0.0f,
synthesized: hover?.synthesized ?? false
);
}
}
public class PointerExitEvent : PointerEvent {
public PointerExitEvent(
TimeSpan timeStamp,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset delta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float size = 0.0f,
float radiusMajor = 0.0f,
float radiusMinor = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f,
bool synthesized = false,
bool down = false) : base(
timeStamp: timeStamp,
kind: kind,
device: device,
position: position,
delta: delta,
buttons: buttons,
down: down,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,
pressureMax: pressureMax,
size: size,
radiusMajor: radiusMajor,
radiusMinor: radiusMinor,
distance: distance,
distanceMax: distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
synthesized: synthesized) {
}
public static PointerExitEvent fromHoverEvent(PointerHoverEvent e) {
return fromMouseEvent(e);
}
public static PointerExitEvent fromMouseEvent(PointerEvent hover) {
return new PointerExitEvent(
timeStamp: hover?.timeStamp ?? TimeSpan.Zero,
kind: hover?.kind ?? PointerDeviceKind.touch,
device: hover?.device ?? 0,
position: hover?.position,
delta: hover?.delta,
buttons: hover?.buttons ?? 0,
down: hover?.down ?? false,
obscured: hover?.obscured ?? false,
pressure: hover?.pressure ?? 0.0f,
pressureMin: hover?.pressureMin ?? 1.0f,
pressureMax: hover?.pressureMax ?? 1.0f,
distance: hover?.distance ?? 0.0f,
distanceMax: hover?.distanceMax ?? 0.0f,
size: hover?.size ?? 0.0f,
radiusMajor: hover?.radiusMajor ?? 0.0f,
radiusMinor: hover?.radiusMinor ?? 0.0f,
radiusMin: hover?.radiusMin ?? 0.0f,
radiusMax: hover?.radiusMax ?? 0.0f,
orientation: hover?.orientation ?? 0.0f,
tilt: hover?.tilt ?? 0.0f,
synthesized: hover?.synthesized ?? false
);
}
}
public class PointerDownEvent : PointerEvent {
public PointerDownEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float size = 0.0f,
float radiusMajor = 0.0f,
float radiusMinor = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
) : base(
timeStamp: timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
buttons: buttons,
down: true,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,
pressureMax: pressureMax,
size: size,
radiusMajor: radiusMajor,
radiusMinor: radiusMinor,
distance: distance,
distanceMax: distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt) {
}
}
public class PointerMoveEvent : PointerEvent {
public PointerMoveEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset delta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float size = 0.0f,
float radiusMajor = 0.0f,
float radiusMinor = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f,
int platformdData = 0,
bool synthesized = false
) : base(
timeStamp: timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
delta: delta,
buttons: buttons,
down: true,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,
pressureMax: pressureMax,
size: size,
radiusMajor: radiusMajor,
radiusMinor: radiusMinor,
distance: distance,
distanceMax: distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
platformData: platformdData,
synthesized: synthesized) {
}
}
public class PointerUpEvent : PointerEvent {
public PointerUpEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float size = 0.0f,
float radiusMajor = 0.0f,
float radiusMinor = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
pointer: pointer,
device: device
) { }
device: device,
position: position,
buttons: buttons,
down: false,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,
pressureMax: pressureMax,
size: size,
radiusMajor: radiusMajor,
radiusMinor: radiusMinor,
distance: distance,
distanceMax: distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt) {
}
public class PointerScrollEvent : PointerEvent {
public PointerScrollEvent(
public class PointerSignalEvent : PointerEvent {
public PointerSignalEvent(
Offset position = null
) : base(
timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position
) {
}
}
public class PointerScrollEvent : PointerSignalEvent {
public PointerScrollEvent(
TimeSpan timeStamp,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset delta = null)
Offset scrollDelta = null)
pointer: pointer,
position: position,
down: true,
delta: delta) { }
position: position) {
D.assert(position != null);
D.assert(scrollDelta != null);
this.scrollDelta = scrollDelta;
}
public readonly Offset scrollDelta;
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Offset>("scrollDelta", this.scrollDelta));
}
}
public class PointerCancelEvent : PointerEvent {
public PointerCancelEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,
float pressureMax = 1.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float size = 0.0f,
float radiusMajor = 0.0f,
float radiusMinor = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
) : base(
timeStamp: timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
buttons: buttons,
down: false,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,
pressureMax: pressureMax,
size: size,
radiusMajor: radiusMajor,
radiusMinor: radiusMinor,
distance: distance,
distanceMax: distanceMax,
radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt) {
}
}
public class PointerDragFromEditorEnterEvent : PointerEvent {

kind: kind,
device: device,
position: position
) { }
) {
}
public static PointerDragFromEditorEnterEvent fromDragFromEditorEvent(PointerEvent evt) {
return new PointerDragFromEditorEnterEvent(

kind: kind,
device: device,
position: position
) { }
) {
}
public static PointerDragFromEditorExitEvent fromDragFromEditorEvent(PointerEvent evt) {
return new PointerDragFromEditorExitEvent(

kind: kind,
device: device,
position: position
) { }
) {
}
public static PointerDragFromEditorHoverEvent fromDragFromEditorEvent(PointerEvent evt) {
return new PointerDragFromEditorHoverEvent(

objectReferences: objectReferences
);
}
}
public class PointerHoverEvent : PointerEvent {
public PointerHoverEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null)
: base(
timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
down: false) { }
public static PointerHoverEvent fromHoverEvent(PointerEvent hover) {
return new PointerHoverEvent(
timeStamp: hover.timeStamp,
pointer: hover.pointer,
kind: hover.kind,
device: hover.device,
position: hover.position
);
}
}
public class PointerEnterEvent : PointerEvent {
public PointerEnterEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null)
: base(
timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
down: false) { }
public static PointerEnterEvent fromHoverEvent(PointerEvent hover) {
return new PointerEnterEvent(
timeStamp: hover.timeStamp,
pointer: hover.pointer,
kind: hover.kind,
device: hover.device,
position: hover.position
);
}
}
public class PointerExitEvent : PointerEvent {
public PointerExitEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null)
: base(
timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
down: false) { }
public static PointerExitEvent fromHoverEvent(PointerEvent hover) {
return new PointerExitEvent(
timeStamp: hover.timeStamp,
pointer: hover.pointer,
kind: hover.kind,
device: hover.device,
position: hover.position
);
}
}
public class PointerDownEvent : PointerEvent {
public PointerDownEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null)
: base(
timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
down: true) { }
}
public class PointerMoveEvent : PointerEvent {
public PointerMoveEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null,
Offset delta = null,
bool synthesized = false)
: base(
timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
delta: delta,
down: true,
synthesized: synthesized) { }
}
public class PointerUpEvent : PointerEvent {
public PointerUpEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null)
: base(
timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
down: false) { }
}
public class PointerCancelEvent : PointerEvent {
public PointerCancelEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null)
: base(
timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position,
down: false) { }
}
public class PointerSignalEvent : PointerEvent {
public PointerSignalEvent(
TimeSpan timeStamp,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null
) : base(
timeStamp,
pointer: pointer,
kind: kind,
device: device,
position: position
) { }
}
}

8
Runtime/gestures/mouse_tracking.cs


if (trackedAnnotation.activeDevices.Contains(deviceId)) {
if (trackedAnnotation.annotation?.onExit != null) {
trackedAnnotation.annotation.onExit(
PointerExitEvent.fromHoverEvent(this._lastMouseEvent[deviceId]));
PointerExitEvent.fromMouseEvent(this._lastMouseEvent[deviceId]));
}
trackedAnnotation.activeDevices.Remove(deviceId);

if (!hitAnnotation.activeDevices.Contains(deviceId)) {
hitAnnotation.activeDevices.Add(deviceId);
if (hitAnnotation.annotation?.onEnter != null) {
hitAnnotation.annotation.onEnter(PointerEnterEvent.fromHoverEvent(lastEvent));
hitAnnotation.annotation.onEnter(PointerEnterEvent.fromMouseEvent(lastEvent));
if (hitAnnotation.annotation?.onHover != null) {
hitAnnotation.annotation.onHover(PointerHoverEvent.fromHoverEvent(lastEvent));
if (hitAnnotation.annotation?.onHover != null && lastEvent is PointerHoverEvent) {
hitAnnotation.annotation.onHover(lastEvent as PointerHoverEvent);
}
//leave

2
Runtime/material/app.cs


this._navigatorObservers.Add(this._heroController);
}
else {
this._navigatorObservers = null;
this._navigatorObservers = new List<NavigatorObserver>();
}
}

39
Runtime/material/app_bar.cs


Widget flexibleSpace = null,
PreferredSizeWidget bottom = null,
float? elevation = null,
ShapeBorder shape = null,
IconThemeData actionsIconTheme = null,
TextTheme textTheme = null,
bool primary = true,
bool? centerTitle = null,

this.flexibleSpace = flexibleSpace;
this.bottom = bottom;
this.elevation = elevation;
this.shape = shape;
this.actionsIconTheme = actionsIconTheme;
this.textTheme = textTheme;
this.primary = primary;
this.centerTitle = centerTitle;

public readonly float? elevation;
public readonly ShapeBorder shape;
public readonly IconThemeData actionsIconTheme;
public readonly TextTheme textTheme;

bool canPop = parentRoute?.canPop ?? false;
bool useCloseButton = parentRoute is PageRoute && ((PageRoute) parentRoute).fullscreenDialog;
IconThemeData appBarIconTheme = this.widget.iconTheme
IconThemeData overallIconTheme = this.widget.iconTheme
IconThemeData actionsIconTheme = this.widget.actionsIconTheme
?? appBarTheme.actionsIconTheme
?? overallIconTheme;
TextStyle centerStyle = this.widget.textTheme?.title
?? appBarTheme.textTheme?.title
?? themeData.primaryTextTheme.title;

sideStyle = sideStyle.copyWith(color: sideStyle.color.withOpacity(opacity));
}
appBarIconTheme = appBarIconTheme.copyWith(
opacity: opacity * (appBarIconTheme.opacity ?? 1.0f)
overallIconTheme = overallIconTheme.copyWith(
opacity: opacity * (overallIconTheme.opacity ?? 1.0f)
);
actionsIconTheme = actionsIconTheme.copyWith(
opacity: opacity * (actionsIconTheme.opacity ?? 1.0f)
);
}

tooltip: MaterialLocalizations.of(context).openAppDrawerTooltip);
}
if (actions != null) {
actions = IconTheme.merge(
data: actionsIconTheme,
child: actions
);
}
Widget toolbar = new NavigationToolbar(
leading: leading,
middle: title,

child: new CustomSingleChildLayout(
layoutDelegate: new _ToolbarContainerLayout(),
child: IconTheme.merge(
data: appBarIconTheme,
data: overallIconTheme,
child: new DefaultTextStyle(
style: sideStyle,
child: toolbar)

elevation: this.widget.elevation
?? appBarTheme.elevation
?? _defaultElevation,
shape: this.widget.shape,
child: appBar
));
}

Color backgroundColor,
Brightness? brightness,
IconThemeData iconTheme,
IconThemeData actionsIconTheme,
TextTheme textTheme,
bool primary,
bool? centerTitle,

this.backgroundColor = backgroundColor;
this.brightness = brightness;
this.iconTheme = iconTheme;
this.actionsIconTheme = actionsIconTheme;
this.textTheme = textTheme;
this.primary = primary;
this.centerTitle = centerTitle;

public readonly Color backgroundColor;
public readonly Brightness? brightness;
public readonly IconThemeData iconTheme;
public readonly IconThemeData actionsIconTheme;
public readonly TextTheme textTheme;
public readonly bool primary;
public readonly bool? centerTitle;

|| this.backgroundColor != oldDelegate.backgroundColor
|| this.brightness != oldDelegate.brightness
|| this.iconTheme != oldDelegate.iconTheme
|| this.actionsIconTheme != oldDelegate.actionsIconTheme
|| this.textTheme != oldDelegate.textTheme
|| this.primary != oldDelegate.primary
|| this.centerTitle != oldDelegate.centerTitle

Color backgroundColor = null,
Brightness? brightness = null,
IconThemeData iconTheme = null,
IconThemeData actionsIconTheme = null,
TextTheme textTheme = null,
bool primary = true,
bool? centerTitle = null,

this.backgroundColor = backgroundColor;
this.brightness = brightness;
this.iconTheme = iconTheme;
this.actionsIconTheme = actionsIconTheme;
this.textTheme = textTheme;
this.primary = primary;
this.centerTitle = centerTitle;

public readonly Brightness? brightness;
public readonly IconThemeData iconTheme;
public readonly IconThemeData actionsIconTheme;
public readonly TextTheme textTheme;

backgroundColor: this.widget.backgroundColor,
brightness: this.widget.brightness,
iconTheme: this.widget.iconTheme,
actionsIconTheme: this.widget.actionsIconTheme,
textTheme: this.widget.textTheme,
primary: this.widget.primary,
centerTitle: this.widget.centerTitle,

10
Runtime/material/app_bar_theme.cs


Color color = null,
float? elevation = null,
IconThemeData iconTheme = null,
IconThemeData actionsIconTheme = null,
TextTheme textTheme = null
) {
this.brightness = brightness;

this.actionsIconTheme = actionsIconTheme;
this.textTheme = textTheme;
}

public readonly IconThemeData iconTheme;
public readonly IconThemeData actionsIconTheme;
public readonly TextTheme textTheme;
AppBarTheme copyWith(

IconThemeData iconTheme = null,
IconThemeData actionsIconTheme = null,
TextTheme textTheme = null
) {
return new AppBarTheme(

iconTheme: iconTheme ?? this.iconTheme,
actionsIconTheme: actionsIconTheme ?? this.actionsIconTheme,
textTheme: textTheme ?? this.textTheme
);
}

color: Color.lerp(a?.color, b?.color, t),
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
iconTheme: IconThemeData.lerp(a?.iconTheme, b?.iconTheme, t),
actionsIconTheme: IconThemeData.lerp(a?.actionsIconTheme, b?.actionsIconTheme, t),
textTheme: TextTheme.lerp(a?.textTheme, b?.textTheme, t)
);
}

hashCode = (hashCode * 397) ^ this.color?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.elevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.iconTheme?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.actionsIconTheme?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.textTheme?.GetHashCode() ?? 0;
return hashCode;
}

&& other.color == this.color
&& other.elevation == this.elevation
&& other.iconTheme == this.iconTheme
&& other.actionsIconTheme == this.actionsIconTheme
&& other.textTheme == this.textTheme;
}

properties.add(new DiagnosticsProperty<Color>("color", this.color, defaultValue: null));
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation, defaultValue: null));
properties.add(new DiagnosticsProperty<IconThemeData>("iconTheme", this.iconTheme, defaultValue: null));
properties.add(new DiagnosticsProperty<IconThemeData>("actionsIconTheme", this.actionsIconTheme, defaultValue: null));
properties.add(new DiagnosticsProperty<TextTheme>("textTheme", this.textTheme, defaultValue: null));
}
}

407
Runtime/material/bottom_navigation_bar.cs


using Transform = Unity.UIWidgets.widgets.Transform;
namespace Unity.UIWidgets.material {
class BottomNavigationBarUtils {
public const float _kActiveFontSize = 14.0f;
public const float _kInactiveFontSize = 12.0f;
public const float _kTopMargin = 6.0f;
public const float _kBottomMargin = 8.0f;
}
public enum BottomNavigationBarType {
fix,
shifting

List<BottomNavigationBarItem> items = null,
ValueChanged<int> onTap = null,
int currentIndex = 0,
float elevation = 8.0f,
float iconSize = 24.0f
Color backgroundColor = null,
float iconSize = 24.0f,
Color selectedItemColor = null,
Color unselectedItemColor = null,
float selectedFontSize = 14.0f,
float unselectedFontSize = 12.0f,
bool showSelectedLabels = true,
bool? showUnselectedLabels = null
) : base(key: key) {
D.assert(items != null);
D.assert(items.Count >= 2);

D.assert(0 <= currentIndex && currentIndex < items.Count);
D.assert(elevation >= 0.0f);
D.assert(iconSize >= 0.0f);
D.assert(selectedItemColor == null || fixedColor == null,
() => "Either selectedItemColor or fixedColor can be specified, but not both!");
D.assert(selectedFontSize >= 0.0f);
D.assert(unselectedFontSize >= 0.0f);
type = _type(type, items);
this.elevation = elevation;
this.fixedColor = fixedColor;
this.backgroundColor = backgroundColor;
this.selectedItemColor = selectedItemColor ?? fixedColor;
this.unselectedItemColor = unselectedItemColor;
this.selectedFontSize = selectedFontSize;
this.unselectedFontSize = unselectedFontSize;
this.showSelectedLabels = showSelectedLabels;
this.showUnselectedLabels = showUnselectedLabels ?? _defaultShowUnselected(_type(type, items));
}
public readonly List<BottomNavigationBarItem> items;

public readonly int currentIndex;
public readonly float elevation;
public readonly Color fixedColor;
public Color fixedColor {
get { return this.selectedItemColor; }
}
public readonly Color backgroundColor;
public readonly Color selectedItemColor;
public readonly Color unselectedItemColor;
public readonly float selectedFontSize;
public readonly float unselectedFontSize;
public readonly bool showUnselectedLabels;
public readonly bool showSelectedLabels;
static BottomNavigationBarType _type(
BottomNavigationBarType? type,
List<BottomNavigationBarItem> items
) {
if (type != null) {
return type.Value;
}
return items.Count <= 3 ? BottomNavigationBarType.fix : BottomNavigationBarType.shifting;
}
static bool _defaultShowUnselected(BottomNavigationBarType type) {
switch (type) {
case BottomNavigationBarType.shifting:
return false;
case BottomNavigationBarType.fix:
return true;
}
D.assert(false);
return false;
}
public override State createState() {
return new _BottomNavigationBarState();
}

ColorTween colorTween = null,
float? flex = null,
bool selected = false,
float? selectedFontSize = null,
float? unselectedFontSize = null,
bool? showSelectedLabels = null,
bool? showUnselectedLabels = null,
D.assert(type != null);
D.assert(item != null);
D.assert(animation != null);
D.assert(selectedFontSize != null && selectedFontSize >= 0);
D.assert(unselectedFontSize != null && unselectedFontSize >= 0);
this.type = type;
this.item = item;
this.animation = animation;

this.flex = flex;
this.selected = selected;
this.selectedFontSize = selectedFontSize.Value;
this.unselectedFontSize = unselectedFontSize.Value;
this.showSelectedLabels = showSelectedLabels ?? false;
this.showUnselectedLabels = showUnselectedLabels ?? false;
this.indexLabel = indexLabel;
}

public readonly ColorTween colorTween;
public readonly float? flex;
public readonly bool selected;
public readonly float selectedFontSize;
public readonly float unselectedFontSize;
public readonly bool showSelectedLabels;
public readonly bool showUnselectedLabels;
Widget label;
float bottomPadding = this.selectedFontSize / 2.0f;
float topPadding = this.selectedFontSize / 2.0f;
if (this.showSelectedLabels && !this.showUnselectedLabels) {
bottomPadding = new FloatTween(
begin: 0.0f,
end: this.selectedFontSize / 2.0f
).evaluate(this.animation);
topPadding = new FloatTween(
begin: this.selectedFontSize,
end: this.selectedFontSize / 2.0f
).evaluate(this.animation);
}
if (!this.showSelectedLabels && !this.showUnselectedLabels) {
bottomPadding = 0.0f;
topPadding = this.selectedFontSize;
}
label = new _FixedLabel(colorTween: this.colorTween, animation: this.animation, item: this.item);
label = new _ShiftingLabel(animation: this.animation, item: this.item);
break;
default:
throw new Exception("Unknown BottomNavigationBarType: " + this.type);

children: new List<Widget> {
new InkResponse(
onTap: this.onTap == null ? (GestureTapCallback) null : () => { this.onTap(); },
child: new Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new _TileIcon(
type: this.type,
colorTween: this.colorTween,
animation: this.animation,
iconSize: this.iconSize,
selected: this.selected,
item: this.item
),
label
}
child: new Padding(
padding: EdgeInsets.only(top: topPadding, bottom: bottomPadding),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new _TileIcon(
colorTween: this.colorTween,
animation: this.animation,
iconSize: this.iconSize,
selected: this.selected,
item: this.item
),
new _Label(
colorTween: this.colorTween,
animation: this.animation,
item: this.item,
selectedFontSize: this.selectedFontSize,
unselectedFontSize: this.unselectedFontSize,
showSelectedLabels: this.showSelectedLabels,
showUnselectedLabels: this.showUnselectedLabels
)
}
)
)
)
}

class _TileIcon : StatelessWidget {
public _TileIcon(
Key key = null,
BottomNavigationBarType? type = null,
ColorTween colorTween = null,
Animation<float> animation = null,
float? iconSize = null,

this.type = type;
D.assert(selected != null);
D.assert(item != null);
this.colorTween = colorTween;
this.animation = animation;
this.iconSize = iconSize;

BottomNavigationBarType? type;
ColorTween colorTween;
Animation<float> animation;
float? iconSize;

public override Widget build(BuildContext context) {
float tweenStart;
Color iconColor;
switch (this.type) {
case BottomNavigationBarType.fix:
tweenStart = 8.0f;
iconColor = this.colorTween.evaluate(this.animation);
break;
case BottomNavigationBarType.shifting:
tweenStart = 16.0f;
iconColor = Colors.white;
break;
default:
throw new Exception("Unknown BottomNavigationBarType: " + this.type);
}
Color iconColor = this.colorTween.evaluate(this.animation);
margin: EdgeInsets.only(
top: new FloatTween(
begin: tweenStart,
end: BottomNavigationBarUtils._kTopMargin
).evaluate(this.animation)
),
child: new IconTheme(
data: new IconThemeData(
color: iconColor,

}
}
class _FixedLabel : StatelessWidget {
public _FixedLabel(
class _Label : StatelessWidget {
public _Label(
BottomNavigationBarItem item = null
BottomNavigationBarItem item = null,
float? selectedFontSize = null,
float? unselectedFontSize = null,
bool? showSelectedLabels = null,
bool? showUnselectedLabels = null
D.assert(colorTween != null);
D.assert(animation != null);
D.assert(item != null);
D.assert(selectedFontSize != null);
D.assert(unselectedFontSize != null);
D.assert(showSelectedLabels != null);
D.assert(showUnselectedLabels != null);
this.selectedFontSize = selectedFontSize.Value;
this.unselectedFontSize = unselectedFontSize.Value;
this.showSelectedLabels = showSelectedLabels.Value;
this.showUnselectedLabels = showUnselectedLabels.Value;
ColorTween colorTween;
Animation<float> animation;
BottomNavigationBarItem item;
public readonly ColorTween colorTween;
public readonly Animation<float> animation;
public readonly BottomNavigationBarItem item;
public readonly float selectedFontSize;
public readonly float unselectedFontSize;
public readonly bool showSelectedLabels;
public readonly bool showUnselectedLabels;
float t = new FloatTween(
begin: BottomNavigationBarUtils._kInactiveFontSize / BottomNavigationBarUtils._kActiveFontSize,
end: 1.0f
).evaluate(this.animation);
return new Align(
alignment: Alignment.bottomCenter,
heightFactor: 1.0f,
child: new Container(
margin: EdgeInsets.only(bottom: BottomNavigationBarUtils._kBottomMargin),
child: DefaultTextStyle.merge(
style: new TextStyle(
fontSize: BottomNavigationBarUtils._kActiveFontSize,
color: this.colorTween.evaluate(this.animation)
),
child: new Transform(
transform: Matrix3.makeScale(t),
alignment: Alignment.bottomCenter,
child: this.item.title
)
)
float t = new FloatTween(begin: this.unselectedFontSize / this.selectedFontSize, end: 1.0f)
.evaluate(this.animation);
Widget text = DefaultTextStyle.merge(
style: new TextStyle(
fontSize: this.selectedFontSize,
color: this.colorTween.evaluate(this.animation)
),
child: new Transform(
transform: Matrix3.makeAll(t, 0, 0,
0, t, 0,
0, 0, 1),
alignment: Alignment.bottomCenter,
child: this.item.title
}
}
class _ShiftingLabel : StatelessWidget {
public _ShiftingLabel(
Key key = null,
Animation<float> animation = null,
BottomNavigationBarItem item = null
) : base(key: key) {
this.animation = animation;
this.item = item;
}
Animation<float> animation;
BottomNavigationBarItem item;
public override Widget build(BuildContext context) {
if (!this.showUnselectedLabels && !this.showSelectedLabels) {
text = new Opacity(
opacity: 0.0f,
child: text
);
}
else if (this.showUnselectedLabels) {
text = new FadeTransition(
opacity: this.animation,
child: text
);
}
else if (!this.showSelectedLabels) {
text = new FadeTransition(
opacity: new FloatTween(begin: 1.0f, end: 0.0f).animate(this.animation),
child: text
);
}
child: new Container(
margin: EdgeInsets.only(
bottom: new FloatTween(
begin: 2.0f,
end: BottomNavigationBarUtils._kBottomMargin
).evaluate(this.animation)
),
child: new FadeTransition(
opacity: this.animation,
child: DefaultTextStyle.merge(
style: new TextStyle(
fontSize: BottomNavigationBarUtils._kActiveFontSize,
color: Colors.white
),
child: this.item.title
)
)
)
child: new Container(child: text)
class _BottomNavigationBarState : TickerProviderStateMixin<BottomNavigationBar> {
public List<AnimationController> _controllers = new List<AnimationController> { };

List<Widget> _createTiles() {
MaterialLocalizations localizations = MaterialLocalizations.of(this.context);
D.assert(localizations != null);
List<Widget> children = new List<Widget> { };
ThemeData themeData = Theme.of(this.context);
Color themeColor;
switch (themeData.brightness) {
case Brightness.light:
themeColor = themeData.primaryColor;
break;
case Brightness.dark:
themeColor = themeData.accentColor;
break;
default:
throw new Exception("Unknown brightness: " + themeData.brightness);
}
ColorTween colorTween;
ThemeData themeData = Theme.of(this.context);
TextTheme textTheme = themeData.textTheme;
Color themeColor;
switch (themeData.brightness) {
case Brightness.light:
themeColor = themeData.primaryColor;
break;
case Brightness.dark:
themeColor = themeData.accentColor;
break;
default:
throw new Exception("Unknown brightness: " + themeData.brightness);
}
ColorTween colorTween = new ColorTween(
begin: textTheme.caption.color,
end: this.widget.fixedColor ?? themeColor
colorTween = new ColorTween(
begin: this.widget.unselectedItemColor ?? themeData.textTheme.caption.color,
end: this.widget.selectedItemColor ?? this.widget.fixedColor ?? themeColor
for (int i = 0; i < this.widget.items.Count; i += 1) {
int index = i;
children.Add(
new _BottomNavigationTile(this.widget.type, this.widget.items[i], this._animations[i],
this.widget.iconSize,
onTap: () => {
if (this.widget.onTap != null) {
this.widget.onTap(index);
}
},
colorTween: colorTween,
selected: i == this.widget.currentIndex,
indexLabel: localizations.tabLabel(tabIndex: i + 1,
tabCount: this.widget.items.Count)
)
);
}
for (int i = 0; i < this.widget.items.Count; i += 1) {
int index = i;
children.Add(
new _BottomNavigationTile(this.widget.type, this.widget.items[i], this._animations[i],
this.widget.iconSize,
onTap: () => {
if (this.widget.onTap != null) {
this.widget.onTap(index);
}
},
flex:
this._evaluateFlex(this._animations[i]),
selected: i == this.widget.currentIndex,
indexLabel: localizations.tabLabel(tabIndex: i + 1,
tabCount: this.widget.items.Count)
)
);
}
colorTween = new ColorTween(
begin: this.widget.unselectedItemColor ?? Colors.white,
end: this.widget.selectedItemColor ?? Colors.white
);
break;
default:
throw new UIWidgetsError($"Unknown bottom navigation bar type: {this.widget.type}");
}
break;
List<Widget> tiles = new List<Widget>();
for (int i = 0; i < this.widget.items.Count; i++) {
int index = i;
tiles.Add(new _BottomNavigationTile(
this.widget.type,
this.widget.items[i],
this._animations[i],
this.widget.iconSize,
selectedFontSize: this.widget.selectedFontSize,
unselectedFontSize: this.widget.unselectedFontSize,
onTap: () => {
if (this.widget.onTap != null) {
this.widget.onTap(index);
}
},
colorTween: colorTween,
flex: this._evaluateFlex(this._animations[i]),
selected: i == this.widget.currentIndex,
showSelectedLabels: this.widget.showSelectedLabels,
showUnselectedLabels: this.widget.showUnselectedLabels,
indexLabel: localizations.tabLabel(tabIndex: i+1, tabCount: this.widget.items.Count)
));
return children;
return tiles;
}
Widget _createContainer(List<Widget> tiles) {

D.assert(MaterialD.debugCheckHasMaterialLocalizations(context));
float additionalBottomPadding =
Mathf.Max(MediaQuery.of(context).padding.bottom - BottomNavigationBarUtils._kBottomMargin, 0.0f);
Mathf.Max(MediaQuery.of(context).padding.bottom - this.widget.selectedFontSize / 2.0f, 0.0f);
Color backgroundColor = null;
switch (this.widget.type) {
case BottomNavigationBarType.fix:

return new Material(
elevation: 8.0f,
elevation: this.widget.elevation,
color: backgroundColor,
child: new ConstrainedBox(
constraints: new BoxConstraints(

2
Runtime/material/button_theme.cs


return fillColor;
}
if (button is FlatButton || button is OutlineButton) {
if (button is FlatButton || button is OutlineButton || button.GetType() == typeof(MaterialButton)) {
return null;
}

106
Runtime/material/chip.cs


MaterialTapTargetSize? materialTapTargetSize { get; }
float? elevation { get; }
Color shadowColor { get; }
}
public interface DeletableChipAttributes {

string tooltip { get; }
ShapeBorder avatarBorder { get; }
Color selectedShadowColor { get; }
}
public interface DisabledChipAttributes {

Color backgroundColor = null,
EdgeInsets padding = null,
MaterialTapTargetSize? materialTapTargetSize = null,
float? elevation = null
float? elevation = null,
Color shadowColor = null
) : base(key: key) {
D.assert(label != null);
D.assert(elevation == null || elevation >= 0.0f);

this._padding = padding;
this._materialTapTargetSize = materialTapTargetSize;
this._elevation = elevation;
this._shadowColor = shadowColor;
}
public Widget avatar {

}
float? _elevation;
public Color shadowColor {
get { return this._shadowColor; }
}
Color _shadowColor;
public override Widget build(BuildContext context) {
D.assert(MaterialD.debugCheckHasMaterial(context));

padding: this.padding,
materialTapTargetSize: this.materialTapTargetSize,
elevation: this.elevation,
shadowColor: this.shadowColor,
isEnabled: true
);
}

EdgeInsets padding = null,
MaterialTapTargetSize? materialTapTargetSize = null,
float? elevation = null,
Color shadowColor = null,
Color selectedShadowColor = null,
ShapeBorder avatarBorder = null
) : base(key: key) {

this._padding = padding;
this._materialTapTargetSize = materialTapTargetSize;
this._elevation = elevation;
this._shadowColor = shadowColor;
this._selectedShadowColor = selectedShadowColor;
}
public Widget avatar {

float? _elevation;
public Color shadowColor {
get { return this._shadowColor; }
}
Color _shadowColor;
public Color selectedShadowColor {
get { return this._selectedShadowColor; }
}
Color _selectedShadowColor;
public ShapeBorder avatarBorder {
get { return this._avatarBorder; }
}

padding: this.padding,
materialTapTargetSize: this.materialTapTargetSize,
elevation: this.elevation,
shadowColor: this.shadowColor,
selectedShadowColor: this.selectedShadowColor,
isEnabled: this.isEnabled == true &&
(this.onSelected != null || this.onDeleted != null || this.onPressed != null),
avatarBorder: this.avatarBorder

EdgeInsets padding = null,
MaterialTapTargetSize? materialTapTargetSize = null,
float? elevation = null,
Color shadowColor = null,
Color selectedShadowColor = null,
ShapeBorder avatarBorder = null
) : base(key: key) {
D.assert(selected != null);

this._padding = padding;
this._materialTapTargetSize = materialTapTargetSize;
this._elevation = elevation;
this._shadowColor = shadowColor;
this._selectedShadowColor = selectedShadowColor;
}
public Widget avatar {

float? _elevation;
public Color shadowColor {
get { return this._shadowColor; }
}
Color _shadowColor;
public Color selectedShadowColor {
get { return this._selectedShadowColor; }
}
Color _selectedShadowColor;
public ShapeBorder avatarBorder {
get { return this._avatarBorder; }
}

isEnabled: this.isEnabled,
materialTapTargetSize: this.materialTapTargetSize,
elevation: this.elevation,
shadowColor: this.shadowColor,
selectedShadowColor: this.selectedShadowColor,
avatarBorder: this.avatarBorder
);
}

EdgeInsets padding = null,
MaterialTapTargetSize? materialTapTargetSize = null,
float? elevation = null,
Color shadowColor = null,
Color selectedShadowColor = null,
ShapeBorder avatarBorder = null
) : base(key: key) {
D.assert(label != null);

this._padding = padding;
this._materialTapTargetSize = materialTapTargetSize;
this._elevation = elevation;
this._shadowColor = shadowColor;
this._selectedShadowColor = selectedShadowColor;
}
public Widget avatar {

float? _elevation;
public Color shadowColor {
get { return this._shadowColor; }
}
Color _shadowColor;
public Color selectedShadowColor {
get { return this._selectedShadowColor; }
}
Color _selectedShadowColor;
public ShapeBorder avatarBorder {
get { return this._avatarBorder; }
}

isEnabled: this.isEnabled,
materialTapTargetSize: this.materialTapTargetSize,
elevation: this.elevation,
shadowColor: this.shadowColor,
selectedShadowColor: this.selectedShadowColor,
avatarBorder: this.avatarBorder
);
}

Color backgroundColor = null,
EdgeInsets padding = null,
MaterialTapTargetSize? materialTapTargetSize = null,
float? elevation = null
float? elevation = null,
Color shadowColor = null
) : base(key: key) {
D.assert(label != null);
D.assert(

this._padding = padding;
this._materialTapTargetSize = materialTapTargetSize;
this._elevation = elevation;
this._shadowColor = shadowColor;
}

float? _elevation;
public Color shadowColor {
get { return this._shadowColor; }
}
Color _shadowColor;
public override Widget build(BuildContext context) {
D.assert(MaterialD.debugCheckHasMaterial(context));
return new RawChip(

labelPadding: this.labelPadding,
isEnabled: true,
materialTapTargetSize: this.materialTapTargetSize,
elevation: this.elevation
elevation: this.elevation,
shadowColor: this._shadowColor
);
}
}

Color backgroundColor = null,
MaterialTapTargetSize? materialTapTargetSize = null,
float? elevation = null,
Color shadowColor = null,
Color selectedShadowColor = null,
ShapeBorder avatarBorder = null
) : base(key: key) {
D.assert(label != null);

this._backgroundColor = backgroundColor;
this._materialTapTargetSize = materialTapTargetSize;
this._elevation = elevation;
this._shadowColor = shadowColor;
this._selectedShadowColor = selectedShadowColor;
}

float? _elevation;
public Color shadowColor {
get { return this._shadowColor; }
}
Color _shadowColor;
public Color selectedShadowColor {
get { return this._selectedShadowColor; }
}
Color _selectedShadowColor;
public ShapeBorder avatarBorder {
get { return this._avatarBorder; }
}

ShapeBorder shape = this.widget.shape ?? chipTheme.shape;
float elevation = this.widget.elevation ?? (chipTheme.elevation ?? _defaultElevation);
float pressElevation = this.widget.pressElevation ?? (chipTheme.pressElevation ?? _defaultPressElevation);
Color shadowColor = this.widget.shadowColor ?? chipTheme.shadowColor ?? _defaultShadowColor;
Color selectedShadowColor = this.widget.selectedShadowColor ?? chipTheme.selectedShadowColor ?? _defaultShadowColor;
bool selected = this.widget.selected ?? false;
shadowColor: selected ? selectedShadowColor : shadowColor,
child: new InkResponse(
child: new InkWell(
onTapCancel: this.canTap ? this._handleTapCancel : (GestureTapCallback) null,
onTapCancel: this.canTap ? this._handleTapCancel : (GestureTapCancelCallback) null,
customBorder: shape,
child: new AnimatedBuilder(
animation: ListenableUtils.merge(new List<Listenable>
{this.selectController, this.enableController}),

22
Runtime/material/chip_theme.cs


Color disabledColor = null,
Color selectedColor = null,
Color secondarySelectedColor = null,
Color shadowColor = null,
Color selectedShadowColor = null,
EdgeInsets labelPadding = null,
EdgeInsets padding = null,
ShapeBorder shape = null,

this.disabledColor = disabledColor;
this.selectedColor = selectedColor;
this.secondarySelectedColor = secondarySelectedColor;
this.shadowColor = shadowColor;
this.selectedShadowColor = selectedShadowColor;
this.labelPadding = labelPadding;
this.padding = padding;
this.shape = shape;

public readonly Color secondarySelectedColor;
public readonly Color shadowColor;
public readonly Color selectedShadowColor;
public readonly EdgeInsets labelPadding;
public readonly EdgeInsets padding;

Color disabledColor = null,
Color selectedColor = null,
Color secondarySelectedColor = null,
Color shadowColor = null,
Color selectedShadowColor = null,
EdgeInsets labelPadding = null,
EdgeInsets padding = null,
ShapeBorder shape = null,

disabledColor: disabledColor ?? this.disabledColor,
selectedColor: selectedColor ?? this.selectedColor,
secondarySelectedColor: secondarySelectedColor ?? this.secondarySelectedColor,
shadowColor: shadowColor ?? this.shadowColor,
selectedShadowColor: selectedShadowColor ?? this.selectedShadowColor,
labelPadding: labelPadding ?? this.labelPadding,
padding: padding ?? this.padding,
shape: shape ?? this.shape,

disabledColor: Color.lerp(a?.disabledColor, b?.disabledColor, t),
selectedColor: Color.lerp(a?.selectedColor, b?.selectedColor, t),
secondarySelectedColor: Color.lerp(a?.secondarySelectedColor, b?.secondarySelectedColor, t),
shadowColor: Color.lerp(a?.shadowColor, b?.shadowColor, t),
selectedShadowColor: Color.lerp(a?.selectedShadowColor, b?.selectedShadowColor, t),
labelPadding: EdgeInsets.lerp(a?.labelPadding, b?.labelPadding, t),
padding: EdgeInsets.lerp(a?.padding, b?.padding, t),
shape: ShapeBorder.lerp(a?.shape, b?.shape, t),

hashCode = (hashCode * 397) ^ this.disabledColor.GetHashCode();
hashCode = (hashCode * 397) ^ this.selectedColor.GetHashCode();
hashCode = (hashCode * 397) ^ this.secondarySelectedColor.GetHashCode();
hashCode = (hashCode * 397) ^ this.shadowColor?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.selectedShadowColor?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.labelPadding.GetHashCode();
hashCode = (hashCode * 397) ^ this.padding.GetHashCode();
hashCode = (hashCode * 397) ^ this.shape.GetHashCode();

&& other.disabledColor == this.disabledColor
&& other.selectedColor == this.selectedColor
&& other.secondarySelectedColor == this.secondarySelectedColor
&& other.shadowColor == this.shadowColor
&& other.selectedShadowColor == this.selectedShadowColor
&& other.labelPadding == this.labelPadding
&& other.padding == this.padding
&& other.shape == this.shape

defaultValue: defaultData.selectedColor));
properties.add(new DiagnosticsProperty<Color>("secondarySelectedColor", this.secondarySelectedColor,
defaultValue: defaultData.secondarySelectedColor));
properties.add(new DiagnosticsProperty<Color>("shadowColor", this.shadowColor,
defaultValue: defaultData.shadowColor));
properties.add(new DiagnosticsProperty<Color>("selectedShadowColor", this.selectedShadowColor,
defaultValue: defaultData.selectedShadowColor));
properties.add(new DiagnosticsProperty<EdgeInsets>("labelPadding", this.labelPadding,
defaultValue: defaultData.labelPadding));
properties.add(

2
Runtime/material/dialog.cs


) {
D.assert(MaterialD.debugCheckHasMaterialLocalizations(context));
ThemeData theme = Theme.of(context, shadowThemeOnly: true);
ThemeData theme = Theme.of(context, shadowThemeOnly: true);
Widget pageChild = new Builder(builder: builder);
return new SafeArea(
child: new Builder(

3
Runtime/material/drawer.cs


Widget child = null,
DrawerAlignment? alignment = null,
DrawerCallback drawerCallback = null,
DragStartBehavior? dragStartBehavior = null
DragStartBehavior dragStartBehavior = DragStartBehavior.start
D.assert(dragStartBehavior != null);
this.child = child;
this.alignment = alignment ?? DrawerAlignment.start;
this.drawerCallback = drawerCallback;

131
Runtime/material/dropdown.cs


public override Widget buildPage(BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation) {
return new LayoutBuilder(
builder: (ctx, constraints) => {
return new _DropdownRoutePage<T>(
route: this,
constraints: constraints,
items: this.items,
padding: this.padding,
buttonRect: this.buttonRect,
selectedIndex: this.selectedIndex,
elevation: this.elevation,
theme: this.theme,
style: this.style
);
}
);
}
internal void _dismiss() {
this.navigator?.removeRoute(this);
}
}
class _DropdownRoutePage<T> : StatelessWidget where T : class {
public _DropdownRoutePage(
Key key = null,
_DropdownRoute<T> route = null,
BoxConstraints constraints = null,
List<DropdownMenuItem<T>> items = null,
EdgeInsets padding = null,
Rect buttonRect = null,
int? selectedIndex = null,
int elevation = 0,
ThemeData theme = null,
TextStyle style = null
) : base(key: key) {
this.route = route;
this.constraints = constraints;
this.items = items;
this.padding = padding;
this.buttonRect = buttonRect;
this.selectedIndex = selectedIndex;
this.elevation = elevation;
this.theme = theme;
this.style = style;
}
public readonly _DropdownRoute<T> route;
public readonly BoxConstraints constraints;
public readonly List<DropdownMenuItem<T>> items;
public readonly EdgeInsets padding;
public readonly Rect buttonRect;
public readonly int? selectedIndex;
public readonly int elevation;
public readonly ThemeData theme;
public readonly TextStyle style;
public override Widget build(BuildContext context) {
float screenHeight = MediaQuery.of(context).size.height;
float maxMenuHeight = screenHeight - 2.0f * DropdownConstants._kMenuItemHeight;
float availableHeight = this.constraints.maxHeight;
float maxMenuHeight = availableHeight - 2.0f * DropdownConstants._kMenuItemHeight;
float buttonBottom = this.buttonRect.bottom;
float buttonBottom = Mathf.Min(this.buttonRect.bottom, availableHeight);
float bottomLimit = Mathf.Max(screenHeight - DropdownConstants._kMenuItemHeight, buttonBottom);
float bottomLimit = Mathf.Max(availableHeight - DropdownConstants._kMenuItemHeight, buttonBottom);
float? selectedItemOffset = this.selectedIndex * DropdownConstants._kMenuItemHeight +
Constants.kMaterialListPadding.top;

menuTop = menuBottom - menuHeight;
}
if (this.scrollController == null) {
if (this.route.scrollController == null) {
this.scrollController = new ScrollController(initialScrollOffset: scrollOffset);
this.route.scrollController = new ScrollController(initialScrollOffset: scrollOffset);
route: this,
route: this.route,
padding: this.padding
);

}
)
);
}
public void _dismiss() {
this.navigator?.removeRoute(this);
}
}

ValueChanged<T> onChanged = null,
int elevation = 8,
TextStyle style = null,
Widget underline = null,
Widget icon = null,
Color iconDisabledColor = null,
Color iconEnabledColor = null,
float iconSize = 24.0f,
bool isDense = false,
bool isExpanded = false

this.onChanged = onChanged;
this.elevation = elevation;
this.style = style;
this.underline = underline;
this.icon = icon;
this.iconDisabledColor = iconDisabledColor;
this.iconEnabledColor = iconEnabledColor;
this.iconSize = iconSize;
this.isDense = isDense;
this.isExpanded = isExpanded;

public readonly TextStyle style;
public readonly Widget underline;
public readonly Widget icon;
public readonly Color iconDisabledColor;
public readonly Color iconEnabledColor;
public readonly float iconSize;
public readonly bool isDense;

}
}
Color _downArrowColor {
Color _iconColor {
if (Theme.of(this.context).brightness == Brightness.light) {
return Colors.grey.shade700;
if (this.widget.iconEnabledColor != null) {
return this.widget.iconEnabledColor;
else {
return Colors.white70;
switch (Theme.of(this.context).brightness) {
case Brightness.light:
return Colors.grey.shade700;
case Brightness.dark:
return Colors.white70;
if (Theme.of(this.context).brightness == Brightness.light) {
return Colors.grey.shade400;
if (this.widget.iconDisabledColor != null) {
return this.widget.iconDisabledColor;
else {
return Colors.white10;
switch (Theme.of(this.context).brightness) {
case Brightness.light:
return Colors.grey.shade400;
case Brightness.dark:
return Colors.white10;
D.assert(false);
return null;
}
}

children: items
);
Icon defaultIcon = new Icon(Icons.arrow_drop_down);
Widget result = new DefaultTextStyle(
style: this._textStyle,
child: new Container(

mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
this.widget.isExpanded ? new Expanded(child: innerItemsWidget) : (Widget) innerItemsWidget,
new Icon(Icons.arrow_drop_down,
size: this.widget.iconSize,
color: this._downArrowColor
new IconTheme(
data: new IconThemeData(
color: this._iconColor,
size: this.widget.iconSize
),
child: this.widget.icon ?? defaultIcon
)
}
)

left: 0.0f,
right: 0.0f,
bottom: bottom,
child: new Container(
child: this.widget.underline ?? new Container(
height: 1.0f,
decoration: new BoxDecoration(
border: new Border(

32
Runtime/material/expansion_panel.cs


public ExpansionPanel(
ExpansionPanelHeaderBuilder headerBuilder = null,
Widget body = null,
bool isExpanded = false) {
bool isExpanded = false,
bool canTapOnHeader = false) {
this.canTapOnHeader = false;
}
public readonly ExpansionPanelHeaderBuilder headerBuilder;

public readonly bool isExpanded;
public readonly bool canTapOnHeader;
}

ExpansionPanelHeaderBuilder headerBuilder = null,
Widget body = null) : base(body: body, headerBuilder: headerBuilder) {
Widget body = null,
bool canTapOnHeader = false)
: base(body: body, headerBuilder: headerBuilder, canTapOnHeader: canTapOnHeader) {
D.assert(headerBuilder != null);
D.assert(body != null);
D.assert(value != null);

}
ExpansionPanel child = this.widget.children[index];
Widget headerWidget = child.headerBuilder(
context,
this._isChildExpanded(index)
);
Row header = new Row(
children: new List<Widget> {
new Expanded(

child: new ConstrainedBox(
constraints: new BoxConstraints(
minHeight: ExpansionPanelUtils._kPanelHeaderCollapsedHeight),
child: child.headerBuilder(
context,
this._isChildExpanded(index))
child: headerWidget
)
)
),

isExpanded: this._isChildExpanded(index),
padding: EdgeInsets.all(16.0f),
onPressed: (bool isExpanded) => this._handlePressed(isExpanded, expandIndex)
onPressed: !child.canTapOnHeader
? (ValueChanged<bool>) ((bool isExpanded) => {
this._handlePressed(isExpanded, expandIndex);
})
: null
)
)
}

key: new _SaltedKey<BuildContext, int>(context, index * 2),
child: new Column(
children: new List<Widget> {
header,
child.canTapOnHeader
? (Widget) new InkWell(
onTap: () =>
this._handlePressed(this._isChildExpanded(expandIndex), expandIndex),
child: header
)
: header,
new AnimatedCrossFade(
firstChild: new Container(height: 0.0f),
secondChild: child.body,

4
Runtime/material/ink_well.cs


Widget child = null,
GestureTapCallback onTap = null,
GestureTapDownCallback onTapDown = null,
GestureTapCallback onTapCancel = null,
GestureTapCancelCallback onTapCancel = null,
GestureTapCallback onDoubleTap = null,
GestureLongPressCallback onLongPress = null,
ValueChanged<bool> onHighlightChanged = null,

public readonly GestureTapDownCallback onTapDown;
public readonly GestureTapCallback onTapCancel;
public readonly GestureTapCancelCallback onTapCancel;
public readonly GestureTapCallback onDoubleTap;

4
Runtime/material/input_border.cs


const float cornerArcSweep = Mathf.PI / 2.0f;
float tlCornerArcSweep = start < center.tlRadiusX
? Mathf.Asin(start / center.tlRadiusX)
? Mathf.Asin((start / center.tlRadiusX).clamp(-1.0f, 1.0f))
: Mathf.PI / 2.0f;
Path path = new Path();

}
else {
float extent = MathUtils.lerpFloat(0.0f, gapExtent + this.gapPadding * 2.0f, gapPercentage);
Path path = this._gapBorderPath(canvas, center, gapStart - this.gapPadding, extent);
Path path = this._gapBorderPath(canvas, center, Mathf.Max(0.0f,gapStart - this.gapPadding), extent);
canvas.drawPath(path, paint);
}
}

279
Runtime/material/input_decorator.cs


public _RenderDecoration(
_Decoration decoration,
TextBaseline? textBaseline,
bool isFocused
bool isFocused,
bool expands
) {
D.assert(decoration != null);
D.assert(textBaseline != null);

this._expands = expands;
public const float subtextGap = 8.0f;
public readonly Dictionary<_DecorationSlot, RenderBox> slotToChild =
new Dictionary<_DecorationSlot, RenderBox>();

bool _isFocused;
public bool expands {
get { return this._expands; }
set {
if (this._expands == value) {
return;
}
this._expands = value;
this.markNeedsLayout();
}
}
bool _expands = false;
public override void attach(object owner) {
base.attach(owner);
foreach (RenderBox child in this._children) {

get { return this.decoration.contentPadding; }
}
float _layoutLineBox(RenderBox box, BoxConstraints constraints) {
if (box == null) {
return 0.0f;
}
box.layout(constraints, parentUsesSize: true);
float baseline = box.getDistanceToBaseline(this.textBaseline.Value).Value;
D.assert(baseline >= 0.0f);
return baseline;
}
float aboveBaseline = 0.0f;
float belowBaseline = 0.0f;
boxToBaseline[this.prefix] = this._layoutLineBox(this.prefix, boxConstraints);
boxToBaseline[this.suffix] = this._layoutLineBox(this.suffix, boxConstraints);
boxToBaseline[this.icon] = this._layoutLineBox(this.icon, boxConstraints);
boxToBaseline[this.prefixIcon] = this._layoutLineBox(this.prefixIcon, boxConstraints);
boxToBaseline[this.suffixIcon] = this._layoutLineBox(this.suffixIcon, boxConstraints);
void layoutLineBox(RenderBox box) {
if (box == null) {
return;
}
float inputWidth = Math.Max(0.0f, this.constraints.maxWidth - (
_boxSize(this.icon).width
+ this.contentPadding.left
+ _boxSize(this.prefixIcon).width
+ _boxSize(this.prefix).width
+ _boxSize(this.suffix).width
+ _boxSize(this.suffixIcon).width
+ this.contentPadding.right));
boxToBaseline[this.label] = this._layoutLineBox(this.label,
boxConstraints.copyWith(maxWidth: inputWidth)
);
boxToBaseline[this.hint] = this._layoutLineBox(this.hint,
boxConstraints.copyWith(minWidth: inputWidth, maxWidth: inputWidth)
);
boxToBaseline[this.counter] = this._layoutLineBox(this.counter, boxConstraints);
box.layout(boxConstraints, parentUsesSize: true);
float baseline = box.getDistanceToBaseline(this.textBaseline ?? 0.0f) ?? 0.0f;
D.assert(baseline >= 0.0f);
boxToBaseline[box] = baseline;
aboveBaseline = Mathf.Max(baseline, aboveBaseline);
belowBaseline = Mathf.Max(box.size.height - baseline, belowBaseline);
}
boxToBaseline[this.helperError] = this._layoutLineBox(this.helperError,
boxConstraints.copyWith(
maxWidth: Math.Max(0.0f, boxConstraints.maxWidth
- _boxSize(this.icon).width
- _boxSize(this.counter).width
- this.contentPadding.horizontal
)
)
);
layoutLineBox(this.prefix);
layoutLineBox(this.suffix);
float labelHeight = this.label == null
? 0
: this.decoration.floatingLabelHeight;
float topHeight = this.decoration.border.isOutline
? Math.Max(labelHeight - boxToBaseline[this.label], 0)
: labelHeight;
float counterHeight = this.counter == null
? 0
: boxToBaseline[this.counter] + subtextGap;
bool helperErrorExists = this.helperError?.size != null
&& this.helperError.size.height > 0;
float helperErrorHeight = !helperErrorExists
? 0
: this.helperError.size.height + subtextGap;
float bottomHeight = Math.Max(
counterHeight,
helperErrorHeight
);
boxToBaseline[this.input] = this._layoutLineBox(this.input,
boxConstraints.deflate(EdgeInsets.only(
top: this.contentPadding.top + topHeight,
bottom: this.contentPadding.bottom + bottomHeight
)).copyWith(
minWidth: inputWidth,
maxWidth: inputWidth
)
);
if (this.icon != null) {
this.icon.layout(boxConstraints, parentUsesSize: true);
}
// The field can be occupied by a hint or by the input itself
float hintHeight = this.hint == null ? 0 : this.hint.size.height;
float inputDirectHeight = this.input == null ? 0 : this.input.size.height;
float inputHeight = Math.Max(hintHeight, inputDirectHeight);
float inputInternalBaseline = Math.Max(
boxToBaseline[this.input],
boxToBaseline[this.hint]
);
if (this.prefixIcon != null) {
this.prefixIcon.layout(boxConstraints, parentUsesSize: true);
}
// Calculate the amount that prefix/suffix affects height above and below
// the input.
float prefixHeight = this.prefix == null ? 0 : this.prefix.size.height;
float suffixHeight = this.suffix == null ? 0 : this.suffix.size.height;
float fixHeight = Math.Max(
boxToBaseline[this.prefix],
boxToBaseline[this.suffix]
);
float fixAboveInput = Math.Max(0, fixHeight - inputInternalBaseline);
float fixBelowBaseline = Math.Max(
prefixHeight - boxToBaseline[this.prefix],
suffixHeight - boxToBaseline[this.suffix]
);
float fixBelowInput = Math.Max(
0,
fixBelowBaseline - (inputHeight - inputInternalBaseline)
);
// Calculate the height of the input text container.
float prefixIconHeight = this.prefixIcon == null ? 0 : this.prefixIcon.size.height;
float suffixIconHeight = this.suffixIcon == null ? 0 : this.suffixIcon.size.height;
float fixIconHeight = Math.Max(prefixIconHeight, suffixIconHeight);
float contentHeight = Math.Max(
fixIconHeight,
topHeight
+ this.contentPadding.top
+ fixAboveInput
+ inputHeight
+ fixBelowInput
+ this.contentPadding.bottom
);
float maxContainerHeight = boxConstraints.maxHeight - bottomHeight;
float containerHeight = this.expands
? maxContainerHeight
: Math.Min(contentHeight, maxContainerHeight);
if (this.suffixIcon != null) {
this.suffixIcon.layout(boxConstraints, parentUsesSize: true);
}
// Always position the prefix/suffix in the same place (baseline).
float overflow = Math.Max(0, contentHeight - maxContainerHeight);
float baselineAdjustment = fixAboveInput - overflow;
float inputWidth = Mathf.Max(0.0f, this.constraints.maxWidth - (
_boxSize(this.icon).width
+ this.contentPadding.left
+ _boxSize(this.prefixIcon).width
+ _boxSize(this.prefix).width
+ _boxSize(this.suffix).width
+ _boxSize(this.suffixIcon).width
+ this.contentPadding.right));
// The baselines that will be used to draw the actual input text content.
float inputBaseline = this.contentPadding.top
+ topHeight
+ inputInternalBaseline
+ baselineAdjustment;
// The text in the input when an outline border is present is centered
// within the container less 2.0 dps at the top to account for the vertical
// space occupied by the floating label.
float outlineBaseline = inputInternalBaseline
+ baselineAdjustment / 2
+ (containerHeight - (2.0f + inputHeight)) / 2.0f;
boxConstraints = boxConstraints.copyWith(maxWidth: inputWidth);
if (this.label != null) {
if (this.decoration.alignLabelWithHint == true) {
layoutLineBox(this.label);
}
else {
this.label.layout(boxConstraints, parentUsesSize: true);
}
// Find the positions of the text below the input when it exists.
float subtextCounterBaseline = 0;
float subtextHelperBaseline = 0;
float subtextCounterHeight = 0;
float subtextHelperHeight = 0;
if (this.counter != null) {
subtextCounterBaseline =
containerHeight + subtextGap + boxToBaseline[this.counter];
subtextCounterHeight = this.counter.size.height + subtextGap;
boxConstraints = boxConstraints.copyWith(minWidth: inputWidth);
layoutLineBox(this.hint);
layoutLineBox(this.input);
float inputBaseline = this.contentPadding.top + aboveBaseline;
float containerHeight = this.contentPadding.top
+ aboveBaseline
+ belowBaseline
+ this.contentPadding.bottom;
if (this.label != null) {
containerHeight += this.decoration.floatingLabelHeight;
inputBaseline += this.decoration.floatingLabelHeight;
if (helperErrorExists) {
subtextHelperBaseline =
containerHeight + subtextGap + boxToBaseline[this.helperError];
subtextHelperHeight = helperErrorHeight;
containerHeight = Mathf.Max(
containerHeight,
Mathf.Max(
_boxSize(this.suffixIcon).height,
_boxSize(this.prefixIcon).height));
float outlineBaseline = aboveBaseline +
(containerHeight - (2.0f + aboveBaseline + belowBaseline)) / 2.0f;
float subtextBaseline = 0.0f;
float subtextHeight = 0.0f;
if (this.helperError != null || this.counter != null) {
boxConstraints = layoutConstraints.loosen();
aboveBaseline = 0.0f;
belowBaseline = 0.0f;
layoutLineBox(this.counter);
boxConstraints = boxConstraints.copyWith(
maxWidth: Mathf.Max(0.0f, boxConstraints.maxWidth
- _boxSize(this.icon).width
- _boxSize(this.counter).width
- this.contentPadding.horizontal
)
);
layoutLineBox(this.helperError);
if (aboveBaseline + belowBaseline > 0.0f) {
const float subtextGap = 8.0f;
subtextBaseline = containerHeight + subtextGap + aboveBaseline;
subtextHeight = subtextGap + aboveBaseline + belowBaseline;
}
}
float subtextBaseline = Math.Max(
subtextCounterBaseline,
subtextHelperBaseline
);
float subtextHeight = Math.Max(
subtextCounterHeight,
subtextHelperHeight
);
return new _RenderDecorationLayout(
boxToBaseline: boxToBaseline,

protected override float computeMinIntrinsicHeight(float width) {
float subtextHeight = this._lineHeight(width, new List<RenderBox> {this.helperError, this.counter});
if (subtextHeight > 0.0f) {
subtextHeight += 8.0f;
subtextHeight += subtextGap;
}
return this.contentPadding.top

}
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
D.assert(false, () => "not implemented");
return 0.0f;
return _boxParentData(this.input).offset.dy + this.input.getDistanceToActualBaseline(baseline);
}
Matrix3 _labelTransform;

Key key = null,
_Decoration decoration = null,
TextBaseline? textBaseline = null,
bool isFocused = false
bool isFocused = false,
bool? expands = null
D.assert(expands != null);
this.expands = expands.Value;
public readonly bool expands;
public override Element createElement() {
return new _RenderDecorationElement(this);

return new _RenderDecoration(
decoration: this.decoration,
textBaseline: this.textBaseline,
isFocused: this.isFocused
isFocused: this.isFocused,
expands: this.expands
);
}

renderObject.textBaseline = this.textBaseline;
renderObject.isFocused = this.isFocused;
renderObject.expands = this.expands;
}
}

TextStyle baseStyle = null,
TextAlign? textAlign = null,
bool isFocused = false,
bool expands = false,
bool isEmpty = false,
Widget child = null
) : base(key: key) {

this.isFocused = isFocused;
this.expands = expands;
this.isEmpty = isEmpty;
this.child = child;
}

public readonly TextAlign? textAlign;
public readonly bool isFocused;
public readonly bool expands;
public readonly bool isEmpty;

properties.add(new DiagnosticsProperty<InputDecoration>("decoration", this.decoration));
properties.add(new DiagnosticsProperty<TextStyle>("baseStyle", this.baseStyle, defaultValue: null));
properties.add(new DiagnosticsProperty<bool>("isFocused", this.isFocused));
properties.add(new DiagnosticsProperty<bool>("expands", this.expands));
properties.add(new DiagnosticsProperty<bool>("isEmpty", this.isEmpty));
}
}

container: container
),
textBaseline: textBaseline,
isFocused: this.isFocused
isFocused: this.isFocused,
expands: this.widget.expands
);
}
}

bool? alignLabelWithHint = null
) {
D.assert(enabled != null);
D.assert(!(prefix != null && prefixText != null), () => "Declaring both prefix and prefixText is not supported");
D.assert(!(suffix != null && suffixText != null), () => "Declaring both suffix and suffixText is not supported");
D.assert(!(prefix != null && prefixText != null),
() => "Declaring both prefix and prefixText is not supported");
D.assert(!(suffix != null && suffixText != null),
() => "Declaring both suffix and suffixText is not supported");
this.isCollapsed = false;
this.icon = icon;
this.labelText = labelText;

16
Runtime/material/list_tile.cs


bool hasTrailing = this.trailing != null;
bool isTwoLine = !this.isThreeLine && hasSubtitle;
bool isOneLine = !this.isThreeLine && !hasSubtitle;
BoxConstraints maxIconHeightConstrains = new BoxConstraints(
maxHeight: this.isDense ? 48.0f: 56.0f
);
BoxConstraints iconConstraints = looseConstraints.enforce(maxIconHeightConstrains);
Size leadingSize = _layoutBox(this.leading, looseConstraints);
Size trailingSize = _layoutBox(this.trailing, looseConstraints);
Size leadingSize = _layoutBox(this.leading, iconConstraints);
Size trailingSize = _layoutBox(this.trailing, iconConstraints);
D.assert(
tileWidth != leadingSize.width,
() => "Leading widget consumes entire width. Please use a sized widget."
);
D.assert(
tileWidth != trailingSize.width,
() => "Trailing widget consumes entire width. Please use a sized widget."
);
float titleStart = hasLeading
? Mathf.Max(_minLeadingWidth, leadingSize.width) + _horizontalTitleGap

6
Runtime/material/material.cs


public override Widget build(BuildContext context) {
Color backgroundColor = this._getBackgroundColor(context);
D.assert(backgroundColor != null || this.widget.type == MaterialType.transparency);
D.assert(backgroundColor != null || this.widget.type == MaterialType.transparency,
() => "If Material type is not MaterialType.transparency, a color must" +
"either be passed in through the 'color' property, or be defined " +
"in the theme (ex. canvasColor != null if type is set to " +
"MaterialType.canvas");
Widget contents = this.widget.child;
if (contents != null) {
contents = new AnimatedDefaultTextStyle(

4
Runtime/material/material_button.cs


return new RawMaterialButton(
onPressed: this.onPressed,
onHighlightChanged: this.onHighlightChanged,
fillColor: this.color,
fillColor: buttonTheme.getFillColor(this),
textStyle: theme.textTheme.button.copyWith(color: buttonTheme.getTextColor(this)),
highlightColor: this.highlightColor ?? theme.highlightColor,
splashColor: this.splashColor ?? theme.splashColor,

constraints: buttonTheme.getConstraints(this).copyWith(
minWidth: this.minWidth,
minHeight: this.height),
shape: buttonTheme.shape,
shape: buttonTheme.getShape(this),
clipBehavior: this.clipBehavior ?? Clip.none,
animationDuration: buttonTheme.getAnimationDuration(this),
child: this.child,

1
Runtime/material/popup_menu.cs


float elevation = 8.0f
) {
D.assert(context != null);
D.assert(position != null);
D.assert(items != null && items.isNotEmpty());
D.assert(MaterialD.debugCheckHasMaterialLocalizations(context));

16
Runtime/material/progress_indicator.cs


class _CircularProgressIndicatorPainter : AbstractCustomPainter {
public _CircularProgressIndicatorPainter(
Color backgroundColor = null,
Color valueColor = null,
float? value = null,
float? headValue = null,

float? strokeWidth = null
) {
this.backgroundColor = backgroundColor;
this.valueColor = valueColor;
this.value = value;
this.headValue = headValue;

: Mathf.Max(headValue * 3 / 2 * Mathf.PI - tailValue * 3 / 2 * Mathf.PI ?? 0.0f, _epsilon);
}
public readonly Color backgroundColor;
public readonly Color valueColor;
public readonly float? value;
public readonly float? headValue;

paint.strokeWidth = this.strokeWidth ?? 0.0f;
paint.style = PaintingStyle.stroke;
if (this.backgroundColor != null) {
Paint backgroundPaint = new Paint() {
color = this.backgroundColor,
strokeWidth = this.strokeWidth ?? 0.0f,
style = PaintingStyle.stroke
};
canvas.drawArc(Offset.zero & size, 0, _sweep, false, backgroundPaint);
}
if (this.value == null)
{
paint.strokeCap = StrokeCap.square;

public override bool shouldRepaint(CustomPainter oldPainter) {
D.assert(oldPainter is _CircularProgressIndicatorPainter);
_CircularProgressIndicatorPainter painter = oldPainter as _CircularProgressIndicatorPainter;
return painter.valueColor != this.valueColor
return painter.backgroundColor != this.backgroundColor
|| painter.valueColor != this.valueColor
|| painter.value != this.value
|| painter.headValue != this.headValue
|| painter.tailValue != this.tailValue

),
child: new CustomPaint(
painter: new _CircularProgressIndicatorPainter(
backgroundColor: this.widget.backgroundColor,
valueColor: this.widget._getValueColor(context),
value: this.widget.value,
headValue: headValue,

3
Runtime/material/radio.cs


public override void paint(PaintingContext context, Offset offset) {
Canvas canvas = context.canvas;
this.paintRadialReaction(canvas, offset,
new Offset(Constants.kRadialReactionRadius, Constants.kRadialReactionRadius));
this.paintRadialReaction(canvas, offset, this.size.center(Offset.zero));
Offset center = (offset & this.size).center;
Color radioColor = this.onChanged != null ? this.activeColor : this.inactiveColor;

113
Runtime/material/scaffold.cs


}
}
class _BodyBoxConstraints : BoxConstraints {
public _BodyBoxConstraints(
float minWidth = 0.0f,
float maxWidth = float.PositiveInfinity,
float minHeight = 0.0f,
float maxHeight = float.PositiveInfinity,
float? bottomWidgetsHeight = null
) : base(minWidth: minWidth, maxWidth: maxWidth, minHeight: minHeight, maxHeight: maxHeight) {
D.assert(bottomWidgetsHeight != null);
D.assert(bottomWidgetsHeight >= 0);
this.bottomWidgetsHeight = bottomWidgetsHeight.Value;
}
public readonly float bottomWidgetsHeight;
public bool Equals(_BodyBoxConstraints other) {
if (ReferenceEquals(null, other)) {
return false;
}
if (ReferenceEquals(this, other)) {
return true;
}
return this.bottomWidgetsHeight.Equals(other.bottomWidgetsHeight)
&& base.Equals(other);
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((_BodyBoxConstraints) obj);
}
public override int GetHashCode() {
unchecked {
var hashCode = base.GetHashCode();
hashCode = (hashCode * 397) ^ this.bottomWidgetsHeight.GetHashCode();
return hashCode;
}
}
public static bool operator ==(_BodyBoxConstraints left, _BodyBoxConstraints right) {
return Equals(left, right);
}
public static bool operator !=(_BodyBoxConstraints left, _BodyBoxConstraints right) {
return !Equals(left, right);
}
}
class _BodyBuilder : StatelessWidget {
public _BodyBuilder(Key key = null, Widget body = null) : base(key: key) {
this.body = body;
}
public readonly Widget body;
public override Widget build(BuildContext context) {
return new LayoutBuilder(
builder: (ctx, constraints) => {
_BodyBoxConstraints bodyConstraints = (_BodyBoxConstraints) constraints;
MediaQueryData metrics = MediaQuery.of(context);
return new MediaQuery(
data: metrics.copyWith(
padding: metrics.padding.copyWith(
bottom: Mathf.Max(metrics.padding.bottom, bodyConstraints.bottomWidgetsHeight)
)
)
);
}
);
}
}
class _ScaffoldLayout : MultiChildLayoutDelegate {
public _ScaffoldLayout(
EdgeInsets minInsets,

float floatingActionButtonMoveAnimationProgress,
FloatingActionButtonAnimator floatingActionButtonMotionAnimator
FloatingActionButtonAnimator floatingActionButtonMotionAnimator,
bool extendBody
) {
D.assert(minInsets != null);
D.assert(geometryNotifier != null);

this.currentFloatingActionButtonLocation = currentFloatingActionButtonLocation;
this.floatingActionButtonMoveAnimationProgress = floatingActionButtonMoveAnimationProgress;
this.floatingActionButtonMotionAnimator = floatingActionButtonMotionAnimator;
this.extendBody = extendBody;
public readonly bool extendBody;
public readonly EdgeInsets minInsets;
public readonly _ScaffoldGeometryNotifier geometryNotifier;

float contentBottom = Mathf.Max(0.0f, bottom - Mathf.Max(this.minInsets.bottom, bottomWidgetsHeight));
if (this.hasChild(_ScaffoldSlot.body)) {
BoxConstraints bodyConstraints = new BoxConstraints(
float bodyMaxHeight = Mathf.Max(0.0f, contentBottom - contentTop);
if (this.extendBody) {
bodyMaxHeight += bottomWidgetsHeight;
D.assert(bodyMaxHeight <= Mathf.Max(0.0f, looseConstraints.maxHeight - contentTop));
}
BoxConstraints bodyConstraints = new _BodyBoxConstraints(
maxHeight: Mathf.Max(0.0f, contentBottom - contentTop)
maxHeight: bodyMaxHeight,
bottomWidgetsHeight: this.extendBody ? bottomWidgetsHeight : 0.0f
);
this.layoutChild(_ScaffoldSlot.body, bodyConstraints);
this.positionChild(_ScaffoldSlot.body, new Offset(0.0f, contentTop));

bool? resizeToAvoidBottomPadding = null,
bool? resizeToAvoidBottomInset = null,
bool primary = true,
DragStartBehavior drawerDragStartBehavior = DragStartBehavior.down
DragStartBehavior drawerDragStartBehavior = DragStartBehavior.start,
bool extendBody = false
) : base(key: key) {
this.appBar = appBar;
this.body = body;

this.resizeToAvoidBottomInset = resizeToAvoidBottomInset;
this.primary = primary;
this.drawerDragStartBehavior = drawerDragStartBehavior;
this.extendBody = extendBody;
public readonly bool extendBody;
public readonly PreferredSizeWidget appBar;

this._addIfNonNull(
children: children,
child: this.widget.body,
child: this.widget.body != null && this.widget.extendBody
? new _BodyBuilder(body: this.widget.body) : this.widget.body,
childId: _ScaffoldSlot.body,
removeLeftPadding: false,
removeTopPadding: this.widget.appBar != null,

bottom: this._resizeToAvoidBottomInset ? mediaQuery.viewInsets.bottom : 0.0f
);
bool _extendBody = !(minInsets.bottom > 0) && this.widget.extendBody;
return new _ScaffoldScope(
hasDrawer: this.hasDrawer,
geometryNotifier: this._geometryNotifier,

return new CustomMultiChildLayout(
children: new List<Widget>(children),
layoutDelegate: new _ScaffoldLayout(
extendBody: _extendBody,
minInsets: minInsets,
currentFloatingActionButtonLocation: this._floatingActionButtonLocation,
floatingActionButtonMoveAnimationProgress: this

10
Runtime/material/slider.cs


sliderTheme: this._sliderTheme
).width;
if ((trackRect.width - tickMarkWidth) / this.divisions.Value >= 3.0f * tickMarkWidth) {
float adjustedTrackWidth = trackRect.width - tickMarkWidth;
if (adjustedTrackWidth / this.divisions.Value >= 3.0f * tickMarkWidth) {
float dy = trackRect.center.dy;
float tickX = trackRect.left +
tickValue * (trackRect.width - tickMarkWidth) + tickMarkWidth / 2;
float tickY = trackRect.center.dy;
Offset tickMarkOffset = new Offset(tickX, tickY);
float dx = trackRect.left + tickValue * adjustedTrackWidth + tickMarkWidth / 2;
Offset tickMarkOffset = new Offset(dx, dy);
this._sliderTheme.tickMarkShape.paint(
context,
tickMarkOffset,

4
Runtime/material/switch.cs


ImageProvider activeThumbImage = null,
ImageProvider inactiveThumbImage = null,
MaterialTapTargetSize? materialTapTargetSize = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
DragStartBehavior dragStartBehavior = DragStartBehavior.start
) : this(
key: key,
value: value,

ImageProvider inactiveThumbImage = null,
MaterialTapTargetSize? materialTapTargetSize = null,
_SwitchType switchType = _SwitchType.material,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
DragStartBehavior dragStartBehavior = DragStartBehavior.start
) : base(key: key) {
D.assert(value != null);
this.value = value.Value;

9
Runtime/material/tab_bar_theme.cs


Decoration indicator = null,
TabBarIndicatorSize? indicatorSize = null,
Color labelColor = null,
EdgeInsets labelPadding = null,
TextStyle labelStyle = null,
Color unselectedLabelColor = null,
TextStyle unselectedLabelStyle = null) {

this.labelPadding = labelPadding;
this.labelStyle = labelStyle;
this.unselectedLabelColor = unselectedLabelColor;
this.unselectedLabelStyle = unselectedLabelStyle;

public readonly Color labelColor;
public readonly EdgeInsets labelPadding;
public readonly TextStyle labelStyle;
public readonly Color unselectedLabelColor;

Decoration indicator = null,
TabBarIndicatorSize? indicatorSize = null,
Color labelColor = null,
EdgeInsets labelPadding = null,
TextStyle labelStyle = null,
Color unselectedLabelColor = null,
TextStyle unselectedLabelStyle = null

indicatorSize: indicatorSize ?? this.indicatorSize,
labelColor: labelColor ?? this.labelColor,
labelPadding: labelPadding ?? this.labelPadding,
labelStyle: labelStyle ?? this.labelStyle,
unselectedLabelColor: unselectedLabelColor ?? this.unselectedLabelColor,
unselectedLabelStyle: unselectedLabelStyle ?? this.unselectedLabelStyle);

indicator: Decoration.lerp(a.indicator, b.indicator, t),
indicatorSize: t < 0.5 ? a.indicatorSize : b.indicatorSize,
labelColor: Color.lerp(a.labelColor, b.labelColor, t),
labelPadding: EdgeInsets.lerp(a.labelPadding, b.labelPadding, t),
labelStyle: TextStyle.lerp(a.labelStyle, b.labelStyle, t),
unselectedLabelColor: Color.lerp(a.unselectedLabelColor, b.unselectedLabelColor, t),
unselectedLabelStyle: TextStyle.lerp(a.unselectedLabelStyle, b.unselectedLabelStyle, t)

var hashCode = this.indicator != null ? this.indicator.GetHashCode() : 0;
hashCode = (hashCode * 397) ^ (this.indicatorSize != null ? this.indicatorSize.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.labelColor != null ? this.labelColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.labelPadding != null ? this.labelPadding.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.labelStyle != null ? this.labelStyle.GetHashCode() : 0);
hashCode = (hashCode * 397) ^
(this.unselectedLabelColor != null ? this.unselectedLabelColor.GetHashCode() : 0);

return other.indicator == this.indicator &&
other.indicatorSize == this.indicatorSize &&
other.labelColor == this.labelColor &&
other.labelPadding == this.labelPadding &&
other.unselectedLabelColor == this.unselectedLabelColor;
}

41
Runtime/material/tabs.cs


protected internal override Widget build(BuildContext context) {
ThemeData themeData = Theme.of(context);
TabBarTheme tabBarTheme = TabBarTheme.of(context);
TextStyle defaultStyle = this.labelStyle ?? tabBarTheme.labelStyle ?? themeData.primaryTextTheme.body2;
TextStyle defaultUnselectedStyle = this.unselectedLabelStyle
Animation<float> animation = (Animation<float>) this.listenable;
TextStyle defaultStyle = (this.labelStyle
?? tabBarTheme.labelStyle
?? themeData.primaryTextTheme.body2).copyWith(inherit: true);
TextStyle defaultUnselectedStyle = (this.unselectedLabelStyle
?? this.labelStyle ?? themeData.primaryTextTheme.body2;
Animation<float> animation = (Animation<float>) this.listenable;
?? this.labelStyle
?? themeData.primaryTextTheme.body2).copyWith(inherit: true);
TextStyle textStyle = this.selected
? TextStyle.lerp(defaultStyle, defaultUnselectedStyle, animation.value)
: TextStyle.lerp(defaultUnselectedStyle, defaultStyle, animation.value);

EdgeInsets labelPadding = null,
Color unselectedLabelColor = null,
TextStyle unselectedLabelStyle = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
ValueChanged<int> onTap = null
) : base(key: key) {
indicatorPadding = indicatorPadding ?? EdgeInsets.zero;

return true;
});
D.assert(() => {
if (newController.length != this.widget.tabs.Count) {
throw new UIWidgetsError(
$"Controller's length property {newController.length} does not match the\n" +
$"number of tab elements {this.widget.tabs.Count} present in TabBar's tabs property."
);
}
return true;
});
if (newController == this._controller) {
return;
}

);
}
TabBarTheme tabBarTheme = TabBarTheme.of(context);
padding: this.widget.labelPadding ?? Constants.kTabLabelPadding,
padding: this.widget.labelPadding ?? tabBarTheme.labelPadding ?? Constants.kTabLabelPadding,
child: new KeyedSubtree(
key: this._tabKeys[i],
child: this.widget.tabs[i]

List<Widget> children = null,
TabController controller = null,
ScrollPhysics physics = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
DragStartBehavior dragStartBehavior = DragStartBehavior.start
) : base(key: key) {
D.assert(children != null);
this.children = children;

"TabController using the \"controller\" property, or you must ensure that there " +
"is a DefaultTabController above the " + this.widget.GetType() + ".\n" +
"In this case, there was neither an explicit controller nor a default controller."
);
}
return true;
});
D.assert(() => {
if (newController.length != this.widget.children.Count) {
throw new UIWidgetsError(
$"Controller's length property {newController.length} does not match the\n" +
$"number of elements {this.widget.children.Count} present in TabBarView's children property."
);
}

75
Runtime/material/text_field.cs


bool? isFocused);
public class TextField : StatefulWidget {
public TextField(Key key = null, TextEditingController controller = null, FocusNode focusNode = null,
InputDecoration decoration = null, bool noDecoration = false, TextInputType keyboardType = null,
public TextField(Key key = null,
TextEditingController controller = null,
FocusNode focusNode = null,
InputDecoration decoration = null,
bool noDecoration = false,
TextInputType keyboardType = null,
TextCapitalization textCapitalization = TextCapitalization.none, TextStyle style = null,
TextCapitalization textCapitalization = TextCapitalization.none,
TextStyle style = null,
TextAlign textAlign = TextAlign.left, TextDirection textDirection = TextDirection.ltr,
bool autofocus = false, bool obscureText = false, bool autocorrect = false, int? maxLines = 1,
int? maxLength = null, bool maxLengthEnforced = true, ValueChanged<string> onChanged = null,
TextAlign textAlign = TextAlign.left,
TextDirection textDirection = TextDirection.ltr,
bool autofocus = false,
bool obscureText = false,
bool autocorrect = false,
int? maxLines = 1,
int? minLines = null,
bool expands = false,
int? maxLength = null,
bool maxLengthEnforced = true,
ValueChanged<string> onChanged = null,
ValueChanged<string> onSubmitted = null, List<TextInputFormatter> inputFormatters = null,
bool? enabled = null, float? cursorWidth = 2.0f, Radius cursorRadius = null, Color cursorColor = null,
Brightness? keyboardAppearance = null, EdgeInsets scrollPadding = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
ValueChanged<string> onSubmitted = null,
List<TextInputFormatter> inputFormatters = null,
bool? enabled = null,
float? cursorWidth = 2.0f,
Radius cursorRadius = null,
Color cursorColor = null,
Brightness? keyboardAppearance = null,
EdgeInsets scrollPadding = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
InputCounterWidgetBuilder buildCounter = null
InputCounterWidgetBuilder buildCounter = null,
ScrollPhysics scrollPhysics = null
D.assert(minLines == null || minLines > 0);
D.assert((maxLines == null) || (minLines == null) || (maxLines >= minLines),
() => "minLines can't be greater than maxLines");
D.assert(!expands || (maxLines == null && minLines == null),
() => "minLines and maxLines must be null when expands is true.");
D.assert(maxLength == null || maxLength == TextField.noMaxLength || maxLength > 0);
this.controller = controller;

this.obscureText = obscureText;
this.autocorrect = autocorrect;
this.maxLines = maxLines;
this.minLines = minLines;
this.expands = expands;
this.maxLength = maxLength;
this.maxLengthEnforced = maxLengthEnforced;
this.onChanged = onChanged;

this.scrollPadding = scrollPadding ?? EdgeInsets.all(20.0f);
this.dragStartBehavior = dragStartBehavior;
this.buildCounter = buildCounter;
this.scrollPhysics = scrollPhysics;
}
public readonly TextEditingController controller;

public readonly bool autocorrect;
public readonly int? maxLines;
public readonly int? minLines;
public readonly bool expands;
public const long noMaxLength = -1;

public readonly bool? enableInteractiveSelection;
public readonly DragStartBehavior dragStartBehavior;
public readonly ScrollPhysics scrollPhysics;
public bool selectionEnabled {
get {

properties.add(new DiagnosticsProperty<bool>("obscureText", this.obscureText, defaultValue: false));
properties.add(new DiagnosticsProperty<bool>("autocorrect", this.autocorrect, defaultValue: true));
properties.add(new IntProperty("maxLines", this.maxLines, defaultValue: 1));
properties.add(new IntProperty("minLines", this.minLines, defaultValue: null));
properties.add(new DiagnosticsProperty<bool>("expands", this.expands, defaultValue: false));
properties.add(new IntProperty("maxLength", this.maxLength, defaultValue: null));
properties.add(new FlagProperty("maxLengthEnforced", value: this.maxLengthEnforced, defaultValue: true,
ifFalse: "maxLength not enforced"));

properties.add(new DiagnosticsProperty<Brightness?>("keyboardAppearance", this.keyboardAppearance, defaultValue: null));
properties.add(new DiagnosticsProperty<EdgeInsets>("scrollPadding", this.scrollPadding, defaultValue: EdgeInsets.all(20.0f)));
properties.add(new FlagProperty("selectionEnabled", value: this.selectionEnabled, defaultValue: true, ifFalse: "selection disabled"));
properties.add(new DiagnosticsProperty<ScrollPhysics>("scrollPhysics", this.scrollPhysics, defaultValue: null));
}
}

}
void _handleSelectionChanged(TextSelection selection, SelectionChangedCause cause) {
if (Theme.of(this.context).platform == RuntimePlatform.IPhonePlayer
&& cause == SelectionChangedCause.longPress) {
this._editableTextKey.currentState?.bringIntoView(selection.basePos);
switch (Theme.of(this.context).platform) {
case RuntimePlatform.IPhonePlayer:
if (cause == SelectionChangedCause.longPress) {
this._editableTextKey.currentState?.bringIntoView(selection.basePos);
}
return;
case RuntimePlatform.Android:
break;
}
}

obscureText: this.widget.obscureText,
autocorrect: this.widget.autocorrect,
maxLines: this.widget.maxLines,
minLines: this.widget.minLines,
expands: this.widget.expands,
selectionColor: themeData.textSelectionColor,
selectionControls: this.widget.selectionEnabled ? textSelectionControls : null,
onChanged: this.widget.onChanged,

scrollPadding: this.widget.scrollPadding,
keyboardAppearance: keyboardAppearance,
enableInteractiveSelection: this.widget.enableInteractiveSelection == true,
dragStartBehavior: this.widget.dragStartBehavior
dragStartBehavior: this.widget.dragStartBehavior,
scrollPhysics: this.widget.scrollPhysics
)
);

textAlign: this.widget.textAlign,
isFocused: focusNode.hasFocus,
isEmpty: controller.value.text.isEmpty(),
expands: this.widget.expands,
child: _child
);
},

12
Runtime/material/text_form_field.cs


bool autocorrect = true,
bool autovalidate = false,
bool maxLengthEnforced = true,
int maxLines = 1,
int? maxLines = 1,
int? minLines = null,
bool expands = false,
int? maxLength = null,
VoidCallback onEditingComplete = null,
ValueChanged<string> onFieldSubmitted = null,

autocorrect: autocorrect,
maxLengthEnforced: maxLengthEnforced,
maxLines: maxLines,
minLines: minLines,
expands: expands,
maxLength: maxLength,
onChanged: field.didChange,
onEditingComplete: onEditingComplete,

) {
D.assert(initialValue == null || controller == null);
D.assert(maxLines > 0);
D.assert(maxLines == null || maxLines > 0);
D.assert(minLines == null || minLines > 0);
D.assert((maxLines == null) || (minLines == null) || (maxLines >= minLines),
() => "minLines can't be greater than maxLines");
D.assert(!expands || (maxLines == null && minLines == null),
() => "minLines and maxLines must be null when expands is true.");
D.assert(maxLength == null || maxLength > 0);
this.controller = controller;
}

16
Runtime/material/theme_data.cs


BottomAppBarTheme bottomAppBarTheme = null,
ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
FloatingActionButtonThemeData floatingActionButtonTheme = null,
Typography typography = null
) {
brightness = brightness ?? Brightness.light;

labelStyle: textTheme.body2
);
dialogTheme = dialogTheme ?? new DialogTheme();
floatingActionButtonTheme = floatingActionButtonTheme ?? new FloatingActionButtonThemeData();
D.assert(brightness != null);
D.assert(primaryColor != null);

D.assert(cardTheme != null);
D.assert(chipTheme != null);
D.assert(dialogTheme != null);
D.assert(floatingActionButtonTheme != null);
this.brightness = brightness ?? Brightness.light;
this.primaryColor = primaryColor;

this.bottomAppBarTheme = bottomAppBarTheme;
this.colorScheme = colorScheme;
this.dialogTheme = dialogTheme;
this.floatingActionButtonTheme = floatingActionButtonTheme;
this.typography = typography;
}

BottomAppBarTheme bottomAppBarTheme = null,
ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
FloatingActionButtonThemeData floatingActionButtonTheme = null,
Typography typography = null
) {
D.assert(brightness != null);

D.assert(cardTheme != null);
D.assert(chipTheme != null);
D.assert(dialogTheme != null);
D.assert(floatingActionButtonTheme != null);
return new ThemeData(
brightness: brightness,

bottomAppBarTheme: bottomAppBarTheme,
colorScheme: colorScheme,
dialogTheme: dialogTheme,
floatingActionButtonTheme: floatingActionButtonTheme,
typography: typography);
}

public readonly ColorScheme colorScheme;
public readonly DialogTheme dialogTheme;
public readonly FloatingActionButtonThemeData floatingActionButtonTheme;
public readonly Typography typography;

BottomAppBarTheme bottomAppBarTheme = null,
ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
FloatingActionButtonThemeData floatingActionButtonTheme = null,
Typography typography = null
) {
return raw(

bottomAppBarTheme: bottomAppBarTheme ?? this.bottomAppBarTheme,
colorScheme: colorScheme ?? this.colorScheme,
dialogTheme: dialogTheme ?? this.dialogTheme,
floatingActionButtonTheme: floatingActionButtonTheme ?? this.floatingActionButtonTheme,
typography: typography ?? this.typography
);
}

bottomAppBarTheme: BottomAppBarTheme.lerp(a.bottomAppBarTheme, b.bottomAppBarTheme, t),
colorScheme: ColorScheme.lerp(a.colorScheme, b.colorScheme, t),
dialogTheme: DialogTheme.lerp(a.dialogTheme, b.dialogTheme, t),
floatingActionButtonTheme: FloatingActionButtonThemeData.lerp(a.floatingActionButtonTheme, b.floatingActionButtonTheme, t),
typography: Typography.lerp(a.typography, b.typography, t)
);
}

other.bottomAppBarTheme == this.bottomAppBarTheme &&
other.colorScheme == this.colorScheme &&
other.dialogTheme == this.dialogTheme &&
other.floatingActionButtonTheme == this.floatingActionButtonTheme &&
other.typography == this.typography;
}

hashCode = (hashCode * 397) ^ this.bottomAppBarTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.colorScheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.dialogTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.floatingActionButtonTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.typography.GetHashCode();
this._cachedHashCode = hashCode;

defaultValue: defaultData.colorScheme));
properties.add(new DiagnosticsProperty<DialogTheme>("dialogTheme", this.dialogTheme,
defaultValue: defaultData.dialogTheme));
properties.add(new DiagnosticsProperty<FloatingActionButtonThemeData>("floatingActionButtonTheme",
this.floatingActionButtonTheme, defaultValue: defaultData.floatingActionButtonTheme));
properties.add(new DiagnosticsProperty<Typography>("typography", this.typography,
defaultValue: defaultData.typography));
}

7
Runtime/material/user_accounts_drawer_header.cs


public override void didUpdateWidget(StatefulWidget _oldWidget) {
base.didUpdateWidget(_oldWidget);
_AccountDetails oldWidget = _oldWidget as _AccountDetails;
if (this._animation.status == AnimationStatus.dismissed ||
this._animation.status == AnimationStatus.reverse) {
if (oldWidget.isOpen == this.widget.isOpen) {
return;
}
if(this.widget.isOpen ?? false) {
this._controller.forward();
}
else {

2
Runtime/material/floating_action_button_location.cs.meta


fileFormatVersion: 2
guid: cfa1c894caa2a46b19d419f6f53ae91f
guid: 6c8b71fe76d6bdb4ca66ecad56f25d3f
MonoImporter:
externalObjects: {}
serializedVersion: 2

2
Runtime/material/floating_action_button.cs.meta


fileFormatVersion: 2
guid: 274f3c1005cd046a28b169d8048c0292
guid: 44d53f5996891c54780cbc0073567bfd
MonoImporter:
externalObjects: {}
serializedVersion: 2

2
Runtime/painting/continuous_rectangle_border.cs


}
public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
D.assert(t != null);
if (a is ContinuousRectangleBorder) {
return new ContinuousRectangleBorder(
side: BorderSide.lerp((a as ContinuousRectangleBorder).side, this.side, t),

}
public override ShapeBorder lerpTo(ShapeBorder b, float t) {
D.assert(t != null);
if (b is ContinuousRectangleBorder) {
return new ContinuousRectangleBorder(
side: BorderSide.lerp(this.side, (b as ContinuousRectangleBorder).side, t),

4
Runtime/painting/text_painter.cs


return this._caretMetrics.offset;
}
public float getFullHeightForCaret(TextPosition position, Rect caretPrototype) {
public float? getFullHeightForCaret(TextPosition position, Rect caretPrototype) {
return this._caretMetrics.fullHeight ?? 0;
return this._caretMetrics.fullHeight;
}
_CaretMetrics _caretMetrics;

2
Runtime/rendering/editable.cs


caretRect.left,
caretRect.top - _kCaretHeightOffset,
caretRect.width,
this._textPainter.getFullHeightForCaret(textPosition, this._caretPrototype)
this._textPainter.getFullHeightForCaret(textPosition, this._caretPrototype).Value
);
}
#endif

87
Runtime/ui/pointer.cs


mouse,
}
public enum PointerSignalKind {
none,
scroll,
unknown,
}
int device,
float physicalX,
float physicalY) {
PointerSignalKind signalKind = PointerSignalKind.none,
int device = 0,
float physicalX = 0.0f,
float physicalY = 0.0f,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 0.0f,
float pressureMax = 0.0f,
float distance = 0.0f,
float distanceMax = 0.0f,
float size = 0.0f,
float radiusMajor = 0.0f,
float radiusMinor = 0.0f,
float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f,
int platformData = 0,
float scrollDeltaX = 0.0f,
float scrollDeltaY = 0.0f) {
this.signalKind = signalKind;
this.buttons = buttons;
this.obscured = obscured;
this.pressure = pressure;
this.pressureMin = pressureMin;
this.pressureMax = pressureMax;
this.distance = distance;
this.distanceMax = distanceMax;
this.size = size;
this.radiusMajor = radiusMajor;
this.radiusMinor = radiusMinor;
this.radiusMin = radiusMin;
this.radiusMax = radiusMax;
this.orientation = orientation;
this.tilt = tilt;
this.platformData = platformData;
this.scrollDeltaX = scrollDeltaX;
this.scrollDeltaY = scrollDeltaY;
public PointerChange change;
public PointerDeviceKind kind;
public int device;
public float physicalX;
public float physicalY;
public readonly PointerChange change;
public readonly PointerDeviceKind kind;
public readonly PointerSignalKind signalKind;
public readonly int device;
public readonly float physicalX;
public readonly float physicalY;
public readonly int buttons;
public readonly bool obscured;
public readonly float pressure;
public readonly float pressureMin;
public readonly float pressureMax;
public readonly float distance;
public readonly float distanceMax;
public readonly float size;
public readonly float radiusMajor;
public readonly float radiusMinor;
public readonly float radiusMin;
public readonly float radiusMax;
public readonly float orientation;
public readonly float tilt;
public readonly int platformData;
public readonly float scrollDeltaX;
public readonly float scrollDeltaY;
}
public class ScrollData : PointerData {

PointerDeviceKind kind,
int device,
float physicalX,
float physicalY,
float scrollX,
float scrollY) : base(timeStamp, change, kind, device, physicalX, physicalY) {
PointerSignalKind signalKind = PointerSignalKind.none,
int device = 0,
float physicalX = 0.0f,
float physicalY = 0.0f,
float scrollX = 0.0f,
float scrollY = 0.0f) : base(timeStamp, change, kind, signalKind, device, physicalX, physicalY) {
this.scrollX = scrollX;
this.scrollY = scrollY;
}

174
Runtime/widgets/editable_text.cs


get { return this.value.text; }
set {
this.value = this.value.copyWith(text: value, selection: TextSelection.collapsed(-1),
this.value = this.value.copyWith(
text: value,
selection: TextSelection.collapsed(-1),
composing: TextRange.empty);
}
}

}
public class EditableText : StatefulWidget {
public readonly TextEditingController controller;
public readonly FocusNode focusNode;
public readonly bool obscureText;
public readonly bool autocorrect;
public readonly TextStyle style;
public StrutStyle strutStyle {
get {
if (this._strutStyle == null) {
return this.style != null
? StrutStyle.fromTextStyle(this.style, forceStrutHeight: true)
: StrutStyle.disabled;
}
return this._strutStyle.inheritFromTextStyle(this.style);
}
}
readonly StrutStyle _strutStyle;
public readonly TextAlign textAlign;
public readonly TextDirection? textDirection;
public readonly TextCapitalization textCapitalization;
public readonly float? textScaleFactor;
public readonly Color cursorColor;
public readonly Color backgroundCursorColor;
public readonly int? maxLines;
public readonly bool autofocus;
public readonly Color selectionColor;
public readonly TextSelectionControls selectionControls;
public readonly TextInputType keyboardType;
public readonly TextInputAction? textInputAction;
public readonly ValueChanged<string> onChanged;
public readonly VoidCallback onEditingComplete;
public readonly ValueChanged<string> onSubmitted;
public readonly SelectionChangedCallback onSelectionChanged;
public readonly List<TextInputFormatter> inputFormatters;
public readonly bool rendererIgnoresPointer;
public readonly bool unityTouchKeyboard;
public EditableText(
TextEditingController controller = null,
FocusNode focusNode = null, TextStyle style = null,

TextDirection? textDirection = null,
float? textScaleFactor = null,
int? maxLines = 1,
int? minLines = null,
bool expands = false,
bool autofocus = false,
Color selectionColor = null,
TextSelectionControls selectionControls = null,

bool paintCursorAboveText = false,
Brightness? keyboardAppearance = Brightness.light,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
bool? enableInteractiveSelection = null
bool? enableInteractiveSelection = null,
ScrollPhysics scrollPhysics = null
) : base(key) {
D.assert(controller != null);
D.assert(focusNode != null);

D.assert(minLines == null || minLines > 0);
D.assert((maxLines == null) || (minLines == null) || (maxLines >= minLines),
() => "minLines can't be greater than maxLines");
D.assert(!expands || (maxLines == null && minLines == null),
() => "minLines and maxLines must be null when expands is true.");
// D.assert(backgroundCursorColor != null); // TODO: remove comment
this.keyboardType = keyboardType ?? (maxLines == 1 ? TextInputType.text : TextInputType.multiline);

this.cursorColor = cursorColor;
this.backgroundCursorColor = backgroundCursorColor ?? Colors.grey; // TODO: remove ??
this.maxLines = maxLines;
this.minLines = minLines;
this.expands = expands;
this.autofocus = autofocus;
this.selectionColor = selectionColor;
this.onChanged = onChanged;

this.keyboardAppearance = keyboardAppearance;
this.enableInteractiveSelection = enableInteractiveSelection;
this.dragStartBehavior = dragStartBehavior;
this.scrollPhysics = scrollPhysics;
public readonly TextEditingController controller;
public readonly FocusNode focusNode;
public readonly bool obscureText;
public readonly bool autocorrect;
public readonly TextStyle style;
public StrutStyle strutStyle {
get {
if (this._strutStyle == null) {
return this.style != null
? StrutStyle.fromTextStyle(this.style, forceStrutHeight: true)
: StrutStyle.disabled;
}
return this._strutStyle.inheritFromTextStyle(this.style);
}
}
readonly StrutStyle _strutStyle;
public readonly TextAlign textAlign;
public readonly TextDirection? textDirection;
public readonly TextCapitalization textCapitalization;
public readonly float? textScaleFactor;
public readonly Color cursorColor;
public readonly Color backgroundCursorColor;
public readonly int? maxLines;
public readonly int? minLines;
public readonly bool expands;
public readonly bool autofocus;
public readonly Color selectionColor;
public readonly TextSelectionControls selectionControls;
public readonly TextInputType keyboardType;
public readonly TextInputAction? textInputAction;
public readonly ValueChanged<string> onChanged;
public readonly VoidCallback onEditingComplete;
public readonly ValueChanged<string> onSubmitted;
public readonly SelectionChangedCallback onSelectionChanged;
public readonly List<TextInputFormatter> inputFormatters;
public readonly bool rendererIgnoresPointer;
public readonly bool unityTouchKeyboard;
public readonly float? cursorWidth;
public readonly Radius cursorRadius;
public readonly bool cursorOpacityAnimates;

public readonly EdgeInsets scrollPadding;
public readonly DragStartBehavior dragStartBehavior;
public readonly ScrollPhysics scrollPhysics;
public bool selectionEnabled {
get { return this.enableInteractiveSelection ?? !this.obscureText; }

properties.add(new DiagnosticsProperty<float?>("textScaleFactor", this.textScaleFactor,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new DiagnosticsProperty<int?>("maxLines", this.maxLines, defaultValue: 1));
properties.add(new DiagnosticsProperty<int?>("minLines", this.minLines,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new DiagnosticsProperty<bool>("expands", this.expands, defaultValue: false));
properties.add(new DiagnosticsProperty<ScrollPhysics>("scrollPhysics", this.scrollPhysics,
defaultValue: Diagnostics.kNullDefaultValue));
}
}

public void performAction(TextInputAction action) {
switch (action) {
case TextInputAction.newline:
if (this.widget.maxLines == 1) {
if (!this._isMultiline) {
this._finalizeEditing(true);
}

public void updateFloatingCursor(RawFloatingCursorPoint point) {
switch (point.state) {
case FloatingCursorDragState.Start:
if (this._floatingCursorResetController.isAnimating) {
this._floatingCursorResetController.stop();
this._onFloatingCursorResetTick();
}
TextPosition currentTextPosition =
new TextPosition(offset: this.renderEditable.selection.baseOffset);
this._startCaretRect = this.renderEditable.getLocalRectForCaret(currentTextPosition);

}
public override Widget build(BuildContext context) {
D.assert(WidgetsD.debugCheckHasMediaQuery(context));
FocusScope.of(context).reparentIfNeeded(this.widget.focusNode);
base.build(context); // See AutomaticKeepAliveClientMixin.

physics: new ClampingScrollPhysics(),
physics: this.widget.scrollPhysics,
dragStartBehavior: this.widget.dragStartBehavior,
viewportBuilder: (BuildContext _context, ViewportOffset offset) =>
new CompositedTransformTarget(

: this._cursorVisibilityNotifier,
hasFocus: this._hasFocus,
maxLines: this.widget.maxLines,
minLines: this.widget.minLines,
expands: this.widget.expands,
strutStyle: this.widget.strutStyle,
selectionColor: this.widget.selectionColor,
textScaleFactor: this.widget.textScaleFactor ?? MediaQuery.textScaleFactorOf(context),

public readonly ValueNotifier<bool> showCursor;
public readonly bool hasFocus;
public readonly int? maxLines;
public readonly int? minLines;
public readonly bool expands;
public readonly StrutStyle strutStyle;
public readonly Color selectionColor;
public readonly float textScaleFactor;

public readonly float? devicePixelRatio;
public _Editable(TextSpan textSpan = null, TextEditingValue value = null,
Color cursorColor = null, Color backgroundCursorColor = null, ValueNotifier<bool> showCursor = null,
public _Editable(TextSpan textSpan = null,
TextEditingValue value = null,
Color cursorColor = null,
Color backgroundCursorColor = null,
ValueNotifier<bool> showCursor = null,
int? maxLines = null, StrutStyle strutStyle = null, Color selectionColor = null,
int? maxLines = null,
int? minLines = null,
bool expands = false,
StrutStyle strutStyle = null,
Color selectionColor = null,
TextDirection? textDirection = null, bool obscureText = false, TextAlign textAlign = TextAlign.left,
bool autocorrect = false, ViewportOffset offset = null, SelectionChangedHandler onSelectionChanged = null,
CaretChangedHandler onCaretChanged = null, bool rendererIgnoresPointer = false,
Key key = null, TextSelectionDelegate textSelectionDelegate = null, float? cursorWidth = null,
Radius cursorRadius = null, Offset cursorOffset = null, bool enableInteractiveSelection = true,
bool? paintCursorAboveText = null, float? devicePixelRatio = null) : base(key) {
TextDirection? textDirection = null,
bool obscureText = false,
TextAlign textAlign = TextAlign.left,
bool autocorrect = false,
ViewportOffset offset = null,
SelectionChangedHandler onSelectionChanged = null,
CaretChangedHandler onCaretChanged = null,
bool rendererIgnoresPointer = false,
Key key = null,
TextSelectionDelegate textSelectionDelegate = null,
float? cursorWidth = null,
Radius cursorRadius = null,
Offset cursorOffset = null,
bool enableInteractiveSelection = true,
bool? paintCursorAboveText = null,
float? devicePixelRatio = null) : base(key) {
this.textSpan = textSpan;
this.value = value;
this.cursorColor = cursorColor;

this.maxLines = maxLines;
this.minLines = minLines;
this.strutStyle = strutStyle;
this.selectionColor = selectionColor;
this.textScaleFactor = textScaleFactor;

backgroundCursorColor: this.backgroundCursorColor,
hasFocus: this.hasFocus,
maxLines: this.maxLines,
minLines: this.minLines,
expands: this.expands,
strutStyle: this.strutStyle,
selectionColor: this.selectionColor,
textScaleFactor: this.textScaleFactor,

14
Runtime/widgets/scrollable.cs


this.position.maxScrollExtent);
}
// TODO: float _receivedPointerSignal(PointerSignalEvent event) {
// }
void _receivedPointerSignal(PointerSignalEvent e) {
if (e is PointerScrollEvent && this.position != null) {
float targetScrollOffset = this._targetScrollOffsetForPointerScroll(e as PointerScrollEvent);
if (targetScrollOffset != this.position.pixels) {
GestureBinding.instance.pointerSignalResolver.register(e, this._handlePointerScroll);
}
}
}
void _handlePointerrScroll(PointerEvent e) {
void _handlePointerScroll(PointerEvent e) {
D.assert(e is PointerScrollEvent);
float targetScrollOffset = this._targetScrollOffsetForPointerScroll(e as PointerScrollEvent);
if (targetScrollOffset != this.position.pixels) {

scrollable: this,
position: this.position,
child: new Listener(
// TODO: onPointerSignal: _receivePointerSignal,
onPointerSignal: this._receivedPointerSignal,
child: new RawGestureDetector(
key: this._gestureDetectorKey,
gestures: this._gestureRecognizers,

314
Runtime/material/floating_action_button.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.material {
static class FloatActionButtonUtils {
public static readonly BoxConstraints _kSizeConstraints = BoxConstraints.tightFor(width: 56.0f, height: 56.0f);
public static readonly BoxConstraints _kMiniSizeConstraints =
BoxConstraints.tightFor(width: 40.0f, height: 40.0f);
public static readonly BoxConstraints _kExtendedSizeConstraints =
new BoxConstraints(minHeight: 48.0f, maxHeight: 48.0f);
}
class _DefaultHeroTag {
public _DefaultHeroTag() {
}
public override string ToString() {
return "<default FloatingActionButton tag>";
}
}
public class FloatingActionButton : StatelessWidget {
FloatingActionButton(
Key key = null,
Widget child = null,
string tooltip = null,
Color foregroundColor = null,
Color backgroundColor = null,
object heroTag = null,
float? elevation = null,
float? highlightElevation = null,
float? disabledElevation = null,
VoidCallback onPressed = null,
bool mini = false,
ShapeBorder shape = null,
Clip clipBehavior = Clip.none,
MaterialTapTargetSize? materialTapTargetSize = null,
bool isExtended = false,
BoxConstraints _sizeConstraints = null
) : base(key: key) {
D.assert(elevation == null || elevation >= 0.0f);
D.assert(highlightElevation == null || highlightElevation >= 0.0f);
D.assert(disabledElevation == null || disabledElevation >= 0.0f);
heroTag = heroTag ?? new _DefaultHeroTag();
this.child = child;
this.tooltip = tooltip;
this.foregroundColor = foregroundColor;
this.backgroundColor = backgroundColor;
this.heroTag = heroTag;
this.elevation = elevation;
this.highlightElevation = highlightElevation;
this.onPressed = onPressed;
this.mini = mini;
this.shape = shape;
this.clipBehavior = clipBehavior;
this.materialTapTargetSize = materialTapTargetSize;
this.isExtended = isExtended;
this.disabledElevation = disabledElevation;
this._sizeConstraints = _sizeConstraints ?? (mini
? FloatActionButtonUtils._kMiniSizeConstraints
: FloatActionButtonUtils._kSizeConstraints);
}
public FloatingActionButton(
Key key = null,
Widget child = null,
string tooltip = null,
Color foregroundColor = null,
Color backgroundColor = null,
object heroTag = null,
float elevation = 6.0f,
float highlightElevation = 12.0f,
VoidCallback onPressed = null,
bool mini = false,
ShapeBorder shape = null,
Clip clipBehavior = Clip.none,
MaterialTapTargetSize? materialTapTargetSize = null,
bool isExtended = false
) : this(key: key,
child: child,
tooltip: tooltip,
foregroundColor: foregroundColor,
backgroundColor: backgroundColor,
heroTag: heroTag,
elevation: elevation,
highlightElevation: highlightElevation,
onPressed: onPressed,
mini: mini,
shape: shape,
clipBehavior: clipBehavior,
materialTapTargetSize: materialTapTargetSize,
isExtended: isExtended,
_sizeConstraints: null) {
}
public static FloatingActionButton extended(
Key key = null,
string tooltip = null,
Color foregroundColor = null,
Color backgroundColor = null,
object heroTag = null,
float? elevation = null,
float? highlightElevation = null,
float? disabledElevation = null,
VoidCallback onPressed = null,
ShapeBorder shape = null,
bool isExtended = true,
MaterialTapTargetSize? materialTapTargetSize = null,
Clip clipBehavior = Clip.none,
Widget icon = null,
Widget label = null
) {
D.assert(elevation == null || elevation >= 0.0f);
D.assert(highlightElevation == null || highlightElevation >= 0.0f);
D.assert(disabledElevation == null || disabledElevation >= 0.0f);
D.assert(label != null);
heroTag = heroTag ?? new _DefaultHeroTag();
BoxConstraints _sizeConstraints = FloatActionButtonUtils._kExtendedSizeConstraints;
bool mini = false;
Widget child = new _ChildOverflowBox(
child: new Row(
mainAxisSize: MainAxisSize.min,
children: icon == null
? new List<Widget> {
new SizedBox(width: 20.0f),
label,
new SizedBox(width: 20.0f),
}
: new List<Widget> {
new SizedBox(width: 16.0f),
icon,
new SizedBox(width: 8.0f),
label,
new SizedBox(width: 20.0f)
}));
return new FloatingActionButton(
key: key,
child: child,
tooltip: tooltip,
foregroundColor: foregroundColor,
backgroundColor: backgroundColor,
heroTag: heroTag,
elevation: elevation,
highlightElevation: highlightElevation,
disabledElevation: disabledElevation,
onPressed: onPressed,
mini: mini,
shape: shape,
clipBehavior: clipBehavior,
materialTapTargetSize: materialTapTargetSize,
isExtended: isExtended,
_sizeConstraints: _sizeConstraints
);
}
public readonly Widget child;
public readonly string tooltip;
public readonly Color foregroundColor;
public readonly Color backgroundColor;
public readonly object heroTag;
public readonly VoidCallback onPressed;
public readonly float? elevation;
public readonly float? highlightElevation;
public readonly float? disabledElevation;
public readonly bool mini;
public readonly ShapeBorder shape;
public readonly Clip clipBehavior;
public readonly bool isExtended;
public readonly MaterialTapTargetSize? materialTapTargetSize;
readonly BoxConstraints _sizeConstraints;
const float _defaultElevation = 6;
const float _defaultHighlightElevation = 12;
readonly ShapeBorder _defaultShape = new CircleBorder();
readonly ShapeBorder _defaultExtendedShape = new StadiumBorder();
public override Widget build(BuildContext context) {
ThemeData theme = Theme.of(context);
FloatingActionButtonThemeData floatingActionButtonTheme = theme.floatingActionButtonTheme;
Color backgroundColor = this.backgroundColor
?? floatingActionButtonTheme.backgroundColor
?? theme.colorScheme.secondary;
Color foregroundColor = this.foregroundColor
?? floatingActionButtonTheme.foregroundColor
?? theme.accentIconTheme.color
?? theme.colorScheme.onSecondary;
float elevation = this.elevation
?? floatingActionButtonTheme.elevation
?? _defaultElevation;
float disabledElevation = this.disabledElevation
?? floatingActionButtonTheme.disabledElevation
?? elevation;
float highlightElevation = this.highlightElevation
?? floatingActionButtonTheme.highlightElevation
?? _defaultHighlightElevation;
MaterialTapTargetSize materialTapTargetSize = this.materialTapTargetSize
?? theme.materialTapTargetSize;
TextStyle textStyle = theme.accentTextTheme.button.copyWith(
color: foregroundColor,
letterSpacing: 1.2f
);
ShapeBorder shape = this.shape
?? floatingActionButtonTheme.shape
?? (this.isExtended ? this._defaultExtendedShape : this._defaultShape);
Widget result = null;
if (this.child != null) {
result = IconTheme.merge(
data: new IconThemeData(
color: foregroundColor),
child: this.child
);
}
result = new RawMaterialButton(
onPressed: this.onPressed,
elevation: elevation,
highlightElevation: highlightElevation,
disabledElevation: disabledElevation,
constraints: this._sizeConstraints,
materialTapTargetSize: materialTapTargetSize,
fillColor: backgroundColor,
textStyle: textStyle,
shape: shape,
clipBehavior: this.clipBehavior,
child: result);
if (this.tooltip != null) {
result = new Tooltip(
message: this.tooltip,
child: result);
}
if (this.heroTag != null) {
result = new Hero(
tag: this.heroTag,
child: result);
}
return result;
}
}
class _ChildOverflowBox : SingleChildRenderObjectWidget {
public _ChildOverflowBox(
Key key = null,
Widget child = null) : base(key: key, child: child) {
}
public override RenderObject createRenderObject(BuildContext context) {
return new _RenderChildOverflowBox();
}
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
}
}
class _RenderChildOverflowBox : RenderAligningShiftedBox {
public _RenderChildOverflowBox(
RenderBox child = null) : base(child: child, alignment: Alignment.center) {
}
protected override float computeMinIntrinsicWidth(float height) {
return 0.0f;
}
protected override float computeMinIntrinsicHeight(float width) {
return 0.0f;
}
protected override void performLayout() {
if (this.child != null) {
this.child.layout(new BoxConstraints(), parentUsesSize: true);
this.size = new Size(
Mathf.Max(this.constraints.minWidth, Mathf.Min(this.constraints.maxWidth, this.child.size.width)),
Mathf.Max(this.constraints.minHeight, Mathf.Min(this.constraints.maxHeight, this.child.size.height))
);
this.alignChild();
}
else {
this.size = this.constraints.biggest;
}
}
}
}

130
Runtime/material/floatting_action_button_theme.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.material {
public class FloatingActionButtonThemeData : Diagnosticable {
public FloatingActionButtonThemeData(
Color backgroundColor = null,
Color foregroundColor = null,
float? elevation = null,
float? disabledElevation = null,
float? highlightElevation = null,
ShapeBorder shape = null
) {
this.backgroundColor = backgroundColor;
this.foregroundColor = foregroundColor;
this.elevation = elevation;
this.disabledElevation = disabledElevation;
this.highlightElevation = highlightElevation;
this.shape = shape;
}
public readonly Color backgroundColor;
public readonly Color foregroundColor;
public readonly float? elevation;
public readonly float? disabledElevation;
public readonly float? highlightElevation;
public readonly ShapeBorder shape;
public FloatingActionButtonThemeData copyWith(
Color backgroundColor,
Color foregroundColor,
float? elevation,
float? disabledElevation,
float? highlightElevation,
ShapeBorder shape
) {
return new FloatingActionButtonThemeData(
backgroundColor: backgroundColor ?? this.backgroundColor,
foregroundColor: foregroundColor ?? this.foregroundColor,
elevation: elevation ?? this.elevation,
disabledElevation: disabledElevation ?? this.disabledElevation,
highlightElevation: highlightElevation ?? this.highlightElevation,
shape: shape ?? this.shape
);
}
public static FloatingActionButtonThemeData lerp(FloatingActionButtonThemeData a, FloatingActionButtonThemeData b,
float t) {
D.assert(t != null);
if (a == null && b == null) {
return null;
}
return new FloatingActionButtonThemeData(
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
foregroundColor: Color.lerp(a?.foregroundColor, b?.foregroundColor, t),
elevation: MathUtils.lerpFloat(a?.elevation ?? 0, b?.elevation ?? 0, t),
disabledElevation: MathUtils.lerpFloat(a?.disabledElevation ?? 0, b?.disabledElevation ?? 0, t),
highlightElevation: MathUtils.lerpFloat(a?.highlightElevation ?? 0, b?.highlightElevation ?? 0, t),
shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
);
}
public override int GetHashCode() {
var hashCode = this.backgroundColor?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.foregroundColor?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.elevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.disabledElevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.highlightElevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.shape?.GetHashCode() ?? 0;
return hashCode;
}
public bool Equals(FloatingActionButtonThemeData other) {
if (ReferenceEquals(null, other)) {
return false;
}
if (ReferenceEquals(this, other)) {
return true;
}
return Equals(this.backgroundColor, other.backgroundColor)
&& Equals(this.elevation, other.elevation)
&& Equals(this.shape, other.shape)
&& Equals(this.foregroundColor, other.foregroundColor)
&& Equals(this.disabledElevation, other.disabledElevation)
&& Equals(this.highlightElevation, other.highlightElevation);
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((FloatingActionButtonThemeData) obj);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
FloatingActionButtonThemeData defaultData = new FloatingActionButtonThemeData();
properties.add(new DiagnosticsProperty<Color>("backgroundColor", this.backgroundColor,
defaultValue: defaultData.backgroundColor));
properties.add(new DiagnosticsProperty<Color>("foregroundColor", this.foregroundColor,
defaultValue: defaultData.foregroundColor));
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation,
defaultValue: defaultData.elevation));
properties.add(new DiagnosticsProperty<float?>("disabledElevation", this.disabledElevation,
defaultValue: defaultData.disabledElevation));
properties.add(new DiagnosticsProperty<float?>("highlightElevation", this.highlightElevation,
defaultValue: defaultData.highlightElevation));
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape, defaultValue: defaultData.shape));
}
}
}

11
Runtime/material/floatting_action_button_theme.cs.meta


fileFormatVersion: 2
guid: f2f4277e1c02b5b4281b4fc2b7ac3e21
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

280
Runtime/material/float_action_button.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
namespace Unity.UIWidgets.material {
static class FloatActionButtonUtils {
public static readonly BoxConstraints _kSizeConstraints = BoxConstraints.tightFor(width: 56.0f, height: 56.0f);
public static readonly BoxConstraints _kMiniSizeConstraints =
BoxConstraints.tightFor(width: 40.0f, height: 40.0f);
public static readonly BoxConstraints _kExtendedSizeConstraints =
new BoxConstraints(minHeight: 48.0f, maxHeight: 48.0f);
}
class _DefaultHeroTag {
public _DefaultHeroTag() {
}
public override string ToString() {
return "<default FloatingActionButton tag>";
}
}
public class FloatingActionButton : StatelessWidget {
FloatingActionButton(
Key key = null,
Widget child = null,
string tooltip = null,
Color foregroundColor = null,
Color backgroundColor = null,
object heroTag = null,
float elevation = 6.0f,
float highlightElevation = 12.0f,
float? disabledElevation = null,
VoidCallback onPressed = null,
bool mini = false,
ShapeBorder shape = null,
Clip clipBehavior = Clip.none,
MaterialTapTargetSize? materialTapTargetSize = null,
bool isExtended = false,
BoxConstraints _sizeConstraints = null
) : base(key: key) {
D.assert(elevation >= 0.0f);
D.assert(highlightElevation >= 0.0f);
D.assert(disabledElevation == null || disabledElevation >= 0.0f);
heroTag = heroTag ?? new _DefaultHeroTag();
shape = shape ?? new CircleBorder();
this.child = child;
this.tooltip = tooltip;
this.foregroundColor = foregroundColor;
this.backgroundColor = backgroundColor;
this.heroTag = heroTag;
this.elevation = elevation;
this.highlightElevation = highlightElevation;
this.onPressed = onPressed;
this.mini = mini;
this.shape = shape;
this.clipBehavior = clipBehavior;
this.materialTapTargetSize = materialTapTargetSize;
this.isExtended = isExtended;
this.disabledElevation = disabledElevation;
this._sizeConstraints = _sizeConstraints ?? (mini
? FloatActionButtonUtils._kMiniSizeConstraints
: FloatActionButtonUtils._kSizeConstraints);
}
public FloatingActionButton(
Key key = null,
Widget child = null,
string tooltip = null,
Color foregroundColor = null,
Color backgroundColor = null,
object heroTag = null,
float elevation = 6.0f,
float highlightElevation = 12.0f,
VoidCallback onPressed = null,
bool mini = false,
ShapeBorder shape = null,
Clip clipBehavior = Clip.none,
MaterialTapTargetSize? materialTapTargetSize = null,
bool isExtended = false
) : this(key: key,
child: child,
tooltip: tooltip,
foregroundColor: foregroundColor,
backgroundColor: backgroundColor,
heroTag: heroTag,
elevation: elevation,
highlightElevation: highlightElevation,
onPressed: onPressed,
mini: mini,
shape: shape,
clipBehavior: clipBehavior,
materialTapTargetSize: materialTapTargetSize,
isExtended: isExtended,
_sizeConstraints: null) {
}
public static FloatingActionButton extended(
Key key = null,
string tooltip = null,
Color foregroundColor = null,
Color backgroundColor = null,
object heroTag = null,
float elevation = 6.0f,
float highlightElevation = 12.0f,
float? disabledElevation = null,
VoidCallback onPressed = null,
ShapeBorder shape = null,
bool isExtended = true,
MaterialTapTargetSize? materialTapTargetSize = null,
Clip clipBehavior = Clip.none,
Widget icon = null,
Widget label = null
) {
D.assert(elevation >= 0.0f);
D.assert(highlightElevation >= 0.0f);
D.assert(disabledElevation == null || disabledElevation >= 0.0f);
D.assert(icon != null);
D.assert(label != null);
heroTag = heroTag ?? new _DefaultHeroTag();
shape = shape ?? new StadiumBorder();
BoxConstraints _sizeConstraints = FloatActionButtonUtils._kExtendedSizeConstraints;
bool mini = false;
Widget child = new _ChildOverflowBox(
child: new Row(
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new SizedBox(width: 16.0f),
icon,
new SizedBox(width: 8.0f),
label,
new SizedBox(width: 20.0f)
}));
return new FloatingActionButton(
key: key,
child: child,
tooltip: tooltip,
foregroundColor: foregroundColor,
backgroundColor: backgroundColor,
heroTag: heroTag,
elevation: elevation,
highlightElevation: highlightElevation,
disabledElevation: disabledElevation ?? elevation,
onPressed: onPressed,
mini: mini,
shape: shape,
clipBehavior: clipBehavior,
materialTapTargetSize: materialTapTargetSize,
isExtended: isExtended,
_sizeConstraints: _sizeConstraints
);
}
public readonly Widget child;
public readonly string tooltip;
public readonly Color foregroundColor;
public readonly Color backgroundColor;
public readonly object heroTag;
public readonly VoidCallback onPressed;
public readonly float elevation;
public readonly float highlightElevation;
public readonly float? disabledElevation;
public readonly bool mini;
public readonly ShapeBorder shape;
public readonly Clip clipBehavior;
public readonly bool isExtended;
public readonly MaterialTapTargetSize? materialTapTargetSize;
public readonly BoxConstraints _sizeConstraints;
public override Widget build(BuildContext context) {
ThemeData theme = Theme.of(context);
Color foregroundColor = this.foregroundColor ?? theme.accentIconTheme.color;
Widget result = null;
if (this.child != null) {
result = IconTheme.merge(
data: new IconThemeData(
color: foregroundColor),
child: this.child
);
}
result = new RawMaterialButton(
onPressed: this.onPressed,
elevation: this.elevation,
highlightElevation: this.highlightElevation,
disabledElevation: this.disabledElevation ?? this.elevation,
constraints: this._sizeConstraints,
materialTapTargetSize: this.materialTapTargetSize ?? theme.materialTapTargetSize,
fillColor: this.backgroundColor ?? theme.accentColor,
textStyle: theme.accentTextTheme.button.copyWith(
color: foregroundColor,
letterSpacing: 1.2f),
shape: this.shape,
clipBehavior: this.clipBehavior,
child: result);
if (this.tooltip != null) {
result = new Tooltip(
message: this.tooltip,
child: result);
}
if (this.heroTag != null) {
result = new Hero(
tag: this.heroTag,
child: result);
}
return result;
}
}
class _ChildOverflowBox : SingleChildRenderObjectWidget {
public _ChildOverflowBox(
Key key = null,
Widget child = null) : base(key: key, child: child) {
}
public override RenderObject createRenderObject(BuildContext context) {
return new _RenderChildOverflowBox();
}
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
}
}
class _RenderChildOverflowBox : RenderAligningShiftedBox {
public _RenderChildOverflowBox(
RenderBox child = null) : base(child: child, alignment: Alignment.center) {
}
protected override float computeMinIntrinsicWidth(float height) {
return 0.0f;
}
protected override float computeMinIntrinsicHeight(float width) {
return 0.0f;
}
protected override void performLayout() {
if (this.child != null) {
this.child.layout(new BoxConstraints(), parentUsesSize: true);
this.size = new Size(
Mathf.Max(this.constraints.minWidth, Mathf.Min(this.constraints.maxWidth, this.child.size.width)),
Mathf.Max(this.constraints.minHeight, Mathf.Min(this.constraints.maxHeight, this.child.size.height))
);
this.alignChild();
}
else {
this.size = this.constraints.biggest;
}
}
}
}

/Runtime/material/float_action_button_location.cs.meta → /Runtime/material/floating_action_button_location.cs.meta

/Runtime/material/float_action_button_location.cs → /Runtime/material/floating_action_button_location.cs

/Runtime/material/float_action_button.cs.meta → /Runtime/material/floating_action_button.cs.meta

正在加载...
取消
保存