|
|
|
|
|
|
using System; |
|
|
|
using Unity.UIWidgets.animation; |
|
|
|
using Unity.UIWidgets.foundation; |
|
|
|
using Unity.UIWidgets.gestures; |
|
|
|
using Unity.UIWidgets.painting; |
|
|
|
|
|
|
inherit:false, |
|
|
|
fontSize: 13.4f, |
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
//color: CupertinoColors.black,
|
|
|
|
height: 1.036f, |
|
|
|
letterSpacing: -0.25f, |
|
|
|
textBaseline: TextBaseline.alphabetic |
|
|
|
|
|
|
public const float _kMinButtonFontSize = 10.0f; |
|
|
|
public const float _kDialogCornerRadius = 12.0f; |
|
|
|
public const float _kDividerThickness = 1.0f; |
|
|
|
public const float _kMaxRegularTextScaleFactor = 1.4f; |
|
|
|
|
|
|
|
//public static readonly Color _kDialogColor = new Color(0xC0FFFFFF);
|
|
|
|
//public static readonly Color _kDialogPressedColor = new Color(0x90FFFFFF);
|
|
|
|
public static readonly Color _kButtonDividerColor = new Color(0x40FFFFFF); |
|
|
|
|
|
|
|
public static readonly Color _kDialogColor = CupertinoDynamicColor.withBrightness( |
|
|
|
|
|
|
color: new Color(0xFFE1E1E1), |
|
|
|
darkColor: new Color(0xFF2E2E2E) |
|
|
|
); |
|
|
|
public const float _kMaxRegularTextScaleFactor = 1.4f; |
|
|
|
|
|
|
|
public static bool _isInAccessibilityMode(BuildContext context) { |
|
|
|
MediaQueryData data = MediaQuery.of(context, nullOk: true); |
|
|
|
|
|
|
Widget content = null, |
|
|
|
List<Widget> actions = null, |
|
|
|
ScrollController scrollController = null, |
|
|
|
ScrollController actionScrollController = null |
|
|
|
ScrollController actionScrollController = null, |
|
|
|
TimeSpan? insetAnimationDuration = null, |
|
|
|
Curve insetAnimationCurve = null |
|
|
|
|
|
|
|
this.insetAnimationDuration = insetAnimationDuration ?? TimeSpan.FromMilliseconds(100); |
|
|
|
this.insetAnimationCurve = insetAnimationCurve ?? Curves.decelerate; |
|
|
|
} |
|
|
|
|
|
|
|
public readonly Widget title; |
|
|
|
|
|
|
public readonly ScrollController actionScrollController; |
|
|
|
readonly TimeSpan? m_InsetAnimationDuration; |
|
|
|
public readonly TimeSpan insetAnimationDuration; |
|
|
|
public readonly Curve insetAnimationCurve; |
|
|
|
Widget _buildContent() { |
|
|
|
Widget _buildContent(BuildContext context) { |
|
|
|
List<Widget> children = new List<Widget>(); |
|
|
|
if (title != null || content != null) { |
|
|
|
Widget titleSection = new _CupertinoDialogAlertContentSection( |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return new Container( |
|
|
|
color: CupertinoDialogUtils._kDialogColor, |
|
|
|
color: CupertinoDynamicColor.resolve(CupertinoDialogUtils._kDialogColor, context), |
|
|
|
child: new Column( |
|
|
|
mainAxisSize: MainAxisSize.min, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch, |
|
|
|
|
|
|
bool isInAccessibilityMode = CupertinoDialogUtils._isInAccessibilityMode(context); |
|
|
|
|
|
|
|
float textScaleFactor = MediaQuery.of(context).textScaleFactor; |
|
|
|
return new MediaQuery( |
|
|
|
data: MediaQuery.of(context).copyWith( |
|
|
|
textScaleFactor: Mathf.Max(textScaleFactor, 1.0f) |
|
|
|
), |
|
|
|
return new CupertinoUserInterfaceLevel( |
|
|
|
data: CupertinoUserInterfaceLevelData.elevatedlayer, |
|
|
|
child: new MediaQuery( |
|
|
|
data: MediaQuery.of(context).copyWith( |
|
|
|
textScaleFactor: Mathf.Max(textScaleFactor, 1.0f) |
|
|
|
), |
|
|
|
return new Center( |
|
|
|
child: new Container( |
|
|
|
margin: EdgeInsets.symmetric(vertical: CupertinoDialogUtils._kEdgePadding), |
|
|
|
width: isInAccessibilityMode |
|
|
|
? CupertinoDialogUtils._kAccessibilityCupertinoDialogWidth |
|
|
|
: CupertinoDialogUtils._kCupertinoDialogWidth, |
|
|
|
child: new CupertinoPopupSurface( |
|
|
|
isSurfacePainted: false, |
|
|
|
child: new _CupertinoDialogRenderWidget( |
|
|
|
contentSection: _buildContent(), |
|
|
|
actionsSection: _buildActions() |
|
|
|
return new AnimatedPadding( |
|
|
|
padding: MediaQuery.of(_context).viewInsets + EdgeInsets.symmetric(horizontal: 40.0f, vertical: 24.0f), |
|
|
|
duration: insetAnimationDuration, |
|
|
|
curve: insetAnimationCurve, |
|
|
|
child: MediaQuery.removeViewInsets( |
|
|
|
removeLeft: true, |
|
|
|
removeTop: true, |
|
|
|
removeRight: true, |
|
|
|
removeBottom: true, |
|
|
|
context: _context, |
|
|
|
child: new Center( |
|
|
|
child: new Container( |
|
|
|
margin: EdgeInsets.symmetric(vertical: CupertinoDialogUtils._kEdgePadding), |
|
|
|
width: isInAccessibilityMode |
|
|
|
? CupertinoDialogUtils._kAccessibilityCupertinoDialogWidth |
|
|
|
: CupertinoDialogUtils._kCupertinoDialogWidth, |
|
|
|
child: new CupertinoPopupSurface( |
|
|
|
isSurfacePainted: false, |
|
|
|
child: new _CupertinoDialogRenderWidget( |
|
|
|
contentSection: _buildContent(_context), |
|
|
|
actionsSection: _buildActions() |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
child: new Container( |
|
|
|
decoration: CupertinoDialogUtils._kCupertinoDialogBlurOverlayDecoration, |
|
|
|
child: new Container( |
|
|
|
color: isSurfacePainted ? CupertinoDialogUtils._kDialogColor : null, |
|
|
|
color: isSurfacePainted ? CupertinoDynamicColor.resolve(CupertinoDialogUtils._kDialogColor, context) : null, |
|
|
|
child: child |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
class _CupertinoDialogRenderWidget : RenderObjectWidget { |
|
|
|
public _CupertinoDialogRenderWidget( |
|
|
|
Widget contentSection, |
|
|
|
Widget actionsSection, |
|
|
|
Key key = null |
|
|
|
Key key = null, |
|
|
|
Widget contentSection = null, |
|
|
|
Widget actionsSection = null |
|
|
|
) : base(key: key) { |
|
|
|
this.contentSection = contentSection; |
|
|
|
this.actionsSection = actionsSection; |
|
|
|
|
|
|
public override RenderObject createRenderObject(BuildContext context) { |
|
|
|
return new _RenderCupertinoDialog( |
|
|
|
dividerThickness: CupertinoDialogUtils._kDividerThickness / MediaQuery.of(context).devicePixelRatio, |
|
|
|
isInAccessibilityMode: CupertinoDialogUtils._isInAccessibilityMode(context) |
|
|
|
isInAccessibilityMode: CupertinoDialogUtils._isInAccessibilityMode(context), |
|
|
|
dividerColor: CupertinoDynamicColor.resolve(CupertinoColors.separator, context) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
((_RenderCupertinoDialog) renderObject).dividerColor = |
|
|
|
CupertinoDynamicColor.resolve(CupertinoColors.separator, context); |
|
|
|
} |
|
|
|
|
|
|
|
public override Element createElement() { |
|
|
|
|
|
|
|
|
|
|
Element _contentElement; |
|
|
|
Element _actionsElement; |
|
|
|
|
|
|
|
|
|
|
|
public new _CupertinoDialogRenderWidget widget { |
|
|
|
get { return base.widget as _CupertinoDialogRenderWidget; } |
|
|
|
|
|
|
D.assert(_actionsElement == child); |
|
|
|
_actionsElement = null; |
|
|
|
} |
|
|
|
base.forgetChild(child); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void removeChildRenderObject(RenderObject child) { |
|
|
|
|
|
|
RenderBox contentSection = null, |
|
|
|
RenderBox actionsSection = null, |
|
|
|
float dividerThickness = 0.0f, |
|
|
|
bool isInAccessibilityMode = false |
|
|
|
bool isInAccessibilityMode = false, |
|
|
|
Color dividerColor = null |
|
|
|
_dividerPaint = new Paint() { |
|
|
|
color = dividerColor, |
|
|
|
style = PaintingStyle.fill |
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public RenderBox contentSection { |
|
|
|
|
|
|
|
|
|
|
readonly float _dividerThickness; |
|
|
|
|
|
|
|
readonly Paint _dividerPaint = new Paint() { |
|
|
|
color = CupertinoDialogUtils._kButtonDividerColor, |
|
|
|
style = PaintingStyle.fill |
|
|
|
}; |
|
|
|
|
|
|
|
public readonly Paint _dividerPaint; |
|
|
|
|
|
|
|
public Color dividerColor { |
|
|
|
get { |
|
|
|
return _dividerPaint.color; |
|
|
|
} |
|
|
|
set { |
|
|
|
if (dividerColor == value) { |
|
|
|
return; |
|
|
|
} |
|
|
|
_dividerPaint.color = value; |
|
|
|
markNeedsPaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
public override void attach(object owner) { |
|
|
|
base.attach(owner); |
|
|
|
if (null != contentSection) { |
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null |
|
|
|
) { |
|
|
|
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) { |
|
|
|
BoxParentData contentSectionParentData = contentSection.parentData as BoxParentData; |
|
|
|
BoxParentData actionsSectionParentData = actionsSection.parentData as BoxParentData; |
|
|
|
return result.addWithPaintOffset( |
|
|
|
|
|
|
public readonly ScrollController scrollController; |
|
|
|
|
|
|
|
public override Widget build(BuildContext context) { |
|
|
|
if (title == null && content == null) { |
|
|
|
return new SingleChildScrollView( |
|
|
|
controller: scrollController, |
|
|
|
child: new Container(width: 0.0f, height: 0.0f) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
float textScaleFactor = MediaQuery.of(context).textScaleFactor; |
|
|
|
List<Widget> titleContentGroup = new List<Widget>(); |
|
|
|
if (title != null) { |
|
|
|
|
|
|
top: CupertinoDialogUtils._kEdgePadding * textScaleFactor |
|
|
|
), |
|
|
|
child: new DefaultTextStyle( |
|
|
|
style: CupertinoDialogUtils._kCupertinoDialogTitleStyle, |
|
|
|
style: CupertinoDialogUtils._kCupertinoDialogTitleStyle.copyWith( |
|
|
|
color: CupertinoDynamicColor.resolve(CupertinoColors.label, context) |
|
|
|
), |
|
|
|
textAlign: TextAlign.center, |
|
|
|
child: title |
|
|
|
) |
|
|
|
|
|
|
top: title == null ? CupertinoDialogUtils._kEdgePadding : 1.0f |
|
|
|
), |
|
|
|
child: new DefaultTextStyle( |
|
|
|
style: CupertinoDialogUtils._kCupertinoDialogContentStyle, |
|
|
|
style: CupertinoDialogUtils._kCupertinoDialogContentStyle.copyWith( |
|
|
|
color: CupertinoDynamicColor.resolve(CupertinoColors.label, context) |
|
|
|
), |
|
|
|
textAlign: TextAlign.center, |
|
|
|
child: content |
|
|
|
) |
|
|
|
|
|
|
//ParentDataWidget<_DialogActionButtonParentData>
|
|
|
|
class _DialogActionButtonParentDataWidget : ParentDataWidget<_ActionButtonParentData> { |
|
|
|
public _DialogActionButtonParentDataWidget( |
|
|
|
Widget child, |
|
|
|
Key key = null, |
|
|
|
Key key = null |
|
|
|
Widget child = null |
|
|
|
) : base(key: key, child: child) { |
|
|
|
this.isPressed = isPressed; |
|
|
|
} |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public override Type debugTypicalAncestorWidgetClass { |
|
|
|
get { |
|
|
|
return typeof(_CupertinoDialogActionsRenderWidget); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class _DialogActionButtonParentData : MultiChildLayoutParentData { |
|
|
|
|
|
|
|
|
|
|
public class CupertinoDialogAction : StatelessWidget { |
|
|
|
public CupertinoDialogAction( |
|
|
|
Widget child, |
|
|
|
Key key = null, |
|
|
|
TextStyle textStyle = null |
|
|
|
) { |
|
|
|
TextStyle textStyle = null, |
|
|
|
Widget child = null |
|
|
|
):base(key:key) { |
|
|
|
D.assert(child != null); |
|
|
|
this.onPressed = onPressed; |
|
|
|
this.isDefaultAction = isDefaultAction; |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override Widget build(BuildContext context) { |
|
|
|
TextStyle style = CupertinoDialogUtils._kCupertinoDialogActionStyle; |
|
|
|
TextStyle style = CupertinoDialogUtils._kCupertinoDialogActionStyle.copyWith( |
|
|
|
color: CupertinoDynamicColor.resolve( |
|
|
|
isDestructiveAction ? CupertinoColors.systemRed : CupertinoColors.systemBlue, |
|
|
|
context |
|
|
|
) |
|
|
|
); |
|
|
|
if (isDestructiveAction) { |
|
|
|
style = style.copyWith(color: CupertinoColors.destructiveRed); |
|
|
|
|
|
|
|
if (isDefaultAction) { |
|
|
|
style = style.copyWith(fontWeight: FontWeight.w600); |
|
|
|
|
|
|
|
|
|
|
|
if (!enabled) { |
|
|
|
style = style.copyWith(color: style.color.withOpacity(0.5f)); |
|
|
|
|
|
|
dialogWidth: CupertinoDialogUtils._isInAccessibilityMode(context) |
|
|
|
? CupertinoDialogUtils._kAccessibilityCupertinoDialogWidth |
|
|
|
: CupertinoDialogUtils._kCupertinoDialogWidth, |
|
|
|
dividerThickness: _dividerThickness |
|
|
|
dividerThickness: _dividerThickness, |
|
|
|
dialogColor: CupertinoDynamicColor.resolve(CupertinoDialogUtils._kDialogColor, context), |
|
|
|
dialogPressedColor: CupertinoDynamicColor.resolve(CupertinoDialogUtils._kDialogPressedColor, context), |
|
|
|
dividerColor: CupertinoDynamicColor.resolve(CupertinoColors.separator, context) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
? CupertinoDialogUtils._kAccessibilityCupertinoDialogWidth |
|
|
|
: CupertinoDialogUtils._kCupertinoDialogWidth; |
|
|
|
(renderObject as _RenderCupertinoDialogActions).dividerThickness = _dividerThickness; |
|
|
|
(renderObject as _RenderCupertinoDialogActions).dialogColor = |
|
|
|
CupertinoDynamicColor.resolve( CupertinoDialogUtils._kDialogColor, context); |
|
|
|
(renderObject as _RenderCupertinoDialogActions).dialogPressedColor = |
|
|
|
CupertinoDynamicColor.resolve( CupertinoDialogUtils._kDialogPressedColor, context); |
|
|
|
(renderObject as _RenderCupertinoDialogActions).dividerColor = |
|
|
|
CupertinoDynamicColor.resolve(CupertinoColors.separator, context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
float dialogWidth, |
|
|
|
float dividerThickness = 0.0f |
|
|
|
float? dialogWidth = null, |
|
|
|
float dividerThickness = 0.0f, |
|
|
|
Color dialogColor = null, |
|
|
|
Color dialogPressedColor = null, |
|
|
|
Color dividerColor = null |
|
|
|
_buttonBackgroundPaint = new Paint() { |
|
|
|
color = dialogColor, |
|
|
|
style = PaintingStyle.fill |
|
|
|
}; |
|
|
|
_pressedButtonBackgroundPaint = new Paint(){ |
|
|
|
color = dialogPressedColor, |
|
|
|
style = PaintingStyle.fill |
|
|
|
}; |
|
|
|
_dividerPaint = new Paint(){ |
|
|
|
color = dividerColor, |
|
|
|
style = PaintingStyle.fill |
|
|
|
}; |
|
|
|
public float dialogWidth { |
|
|
|
public float? dialogWidth { |
|
|
|
get { return _dialogWidth; } |
|
|
|
set { |
|
|
|
if (value != _dialogWidth) { |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
float _dialogWidth; |
|
|
|
float? _dialogWidth; |
|
|
|
|
|
|
|
|
|
|
|
public float dividerThickness { |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
float _dividerThickness; |
|
|
|
|
|
|
|
public readonly Paint _buttonBackgroundPaint; |
|
|
|
|
|
|
|
public Color dialogColor { |
|
|
|
set{ |
|
|
|
if (value == _buttonBackgroundPaint.color) |
|
|
|
return; |
|
|
|
|
|
|
|
_buttonBackgroundPaint.color = value; |
|
|
|
markNeedsPaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
float _dividerThickness; |
|
|
|
public readonly Paint _pressedButtonBackgroundPaint; |
|
|
|
readonly Paint _buttonBackgroundPaint = new Paint() { |
|
|
|
color = CupertinoDialogUtils._kDialogColor, |
|
|
|
style = PaintingStyle.fill |
|
|
|
}; |
|
|
|
public Color dialogPressedColor { |
|
|
|
set{ |
|
|
|
if (value == _pressedButtonBackgroundPaint.color) |
|
|
|
return; |
|
|
|
readonly Paint _pressedButtonBackgroundPaint = new Paint() { |
|
|
|
color = CupertinoDialogUtils._kDialogPressedColor, |
|
|
|
style = PaintingStyle.fill |
|
|
|
}; |
|
|
|
_pressedButtonBackgroundPaint.color = value; |
|
|
|
markNeedsPaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
public readonly Paint _dividerPaint; |
|
|
|
readonly Paint _dividerPaint = new Paint() { |
|
|
|
color = CupertinoDialogUtils._kButtonDividerColor, |
|
|
|
style = PaintingStyle.fill |
|
|
|
}; |
|
|
|
public Color dividerColor{ |
|
|
|
set { |
|
|
|
if (value == _dividerPaint.color) |
|
|
|
return; |
|
|
|
|
|
|
|
_dividerPaint.color = value; |
|
|
|
markNeedsPaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<RenderBox> _pressedButtons { |
|
|
|
get { |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected internal override float computeMinIntrinsicWidth(float height) { |
|
|
|
return dialogWidth; |
|
|
|
return dialogWidth ?? 0.0f; |
|
|
|
return dialogWidth; |
|
|
|
return dialogWidth ?? 0.0f; |
|
|
|
} |
|
|
|
|
|
|
|
protected internal override float computeMinIntrinsicHeight(float width) { |
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
float perButtonWidth = (width - dividerThickness) / 2.0f; |
|
|
|
minHeight = Mathf.Max(firstChild.getMinIntrinsicHeight(perButtonWidth), |
|
|
|
minHeight = Mathf.Max( |
|
|
|
firstChild.getMinIntrinsicHeight(perButtonWidth), |
|
|
|
lastChild.getMinIntrinsicHeight(perButtonWidth) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
else if (childCount == 2) { |
|
|
|
if (_isSingleButtonRow(width)) { |
|
|
|
float perButtonWidth = (width - dividerThickness) / 2.0f; |
|
|
|
maxHeight = Mathf.Max(firstChild.getMaxIntrinsicHeight(perButtonWidth), |
|
|
|
maxHeight = Mathf.Max( |
|
|
|
firstChild.getMaxIntrinsicHeight(perButtonWidth), |
|
|
|
lastChild.getMaxIntrinsicHeight(perButtonWidth) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
heightAccumulation += button.getMaxIntrinsicHeight(width); |
|
|
|
button = childAfter(button); |
|
|
|
} |
|
|
|
|
|
|
|
return heightAccumulation; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected override void performLayout() { |
|
|
|
if (_isSingleButtonRow(dialogWidth)) { |
|
|
|
BoxConstraints constraints = this.constraints; |
|
|
|
if (_isSingleButtonRow(dialogWidth ?? 0.0f)) { |
|
|
|
if (childCount == 1) { |
|
|
|
firstChild.layout( |
|
|
|
constraints, |
|
|
|
|
|
|
new Size(dialogWidth, firstChild.size.height) |
|
|
|
new Size(dialogWidth ?? 0.0f, firstChild.size.height) |
|
|
|
); |
|
|
|
} |
|
|
|
else { |
|
|
|
|
|
|
secondButtonParentData.offset = |
|
|
|
new Offset(firstChild.size.width + dividerThickness, 0.0f); |
|
|
|
size = constraints.constrain( |
|
|
|
new Size(dialogWidth, |
|
|
|
Mathf.Max(firstChild.size.height, lastChild.size.height |
|
|
|
new Size( |
|
|
|
dialogWidth ?? 0.0f, |
|
|
|
Mathf.Max( |
|
|
|
firstChild.size.height, |
|
|
|
lastChild.size.height |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
size = constraints.constrain( |
|
|
|
new Size(dialogWidth, verticalOffset) |
|
|
|
new Size(dialogWidth ?? 0.0f, verticalOffset) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Path backgroundFillPath = new Path(); |
|
|
|
|
|
|
|
// backgroundFillPath.fillType = PathFillType.evenOdd;
|
|
|
|
backgroundFillPath.fillType = PathFillType.evenOdd; |
|
|
|
backgroundFillPath.addRect(Rect.fromLTWH(0.0f, 0.0f, size.width, size.height)); |
|
|
|
backgroundFillPath.addRect(verticalDivider); |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
canvas.drawPath( |
|
|
|
pressedBackgroundFillPath, _pressedButtonBackgroundPaint |
|
|
|
pressedBackgroundFillPath, |
|
|
|
_pressedButtonBackgroundPaint |
|
|
|
); |
|
|
|
Path dividersPath = new Path(); |
|
|
|
dividersPath.addRect(verticalDivider); |
|
|
|
|
|
|
void _drawButtonBackgroundsAndDividersStacked(Canvas canvas, Offset offset) { |
|
|
|
Offset dividerOffset = new Offset(0.0f, dividerThickness); |
|
|
|
Path backgroundFillPath = new Path(); |
|
|
|
// ..fillType = PathFillType.evenOdd
|
|
|
|
backgroundFillPath.fillType = PathFillType.evenOdd; |
|
|
|
backgroundFillPath.addRect(Rect.fromLTWH(0.0f, 0.0f, size.width, size.height)); |
|
|
|
Path pressedBackgroundFillPath = new Path(); |
|
|
|
Path dividersPath = new Path(); |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected override bool hitTestChildren(BoxHitTestResult result, |
|
|
|
protected override bool hitTestChildren( |
|
|
|
BoxHitTestResult result, |
|
|
|
Offset position = null |
|
|
|
) { |
|
|
|
return defaultHitTestChildren(result, position: position); |
|
|
|