|
|
|
|
|
|
using Unity.UIWidgets.rendering; |
|
|
|
using Unity.UIWidgets.ui; |
|
|
|
using Unity.UIWidgets.widgets; |
|
|
|
using TextStyle = Unity.UIWidgets.painting.TextStyle; |
|
|
|
Widget child = null, |
|
|
|
Color backgroundColor = null, |
|
|
|
float? elevation = null, |
|
|
|
ShapeBorder shape = null |
|
|
|
ShapeBorder shape = null, |
|
|
|
Widget child = null |
|
|
|
this.backgroundColor = backgroundColor; |
|
|
|
this.elevation = elevation; |
|
|
|
this.insetAnimationCurve = Curves.decelerate; |
|
|
|
this.insetAnimationCurve = insetAnimationCurve ?? Curves.decelerate; |
|
|
|
public readonly Widget child; |
|
|
|
public readonly Color backgroundColor; |
|
|
|
|
|
|
|
public readonly float? elevation; |
|
|
|
|
|
|
|
public readonly TimeSpan insetAnimationDuration; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Color _getColor(BuildContext context) { |
|
|
|
return Theme.of(context).dialogBackgroundColor; |
|
|
|
} |
|
|
|
public readonly Widget child; |
|
|
|
const float _defaultElevation = 24.0f; |
|
|
|
|
|
|
|
public override Widget build(BuildContext context) { |
|
|
|
DialogTheme dialogTheme = DialogTheme.of(context); |
|
|
|
|
|
|
|
|
|
|
child: new ConstrainedBox( |
|
|
|
constraints: new BoxConstraints(minWidth: 280.0f), |
|
|
|
child: new Material( |
|
|
|
elevation: 24.0f, |
|
|
|
color: this._getColor(context), |
|
|
|
color: this.backgroundColor ?? dialogTheme.backgroundColor ?? |
|
|
|
Theme.of(context).dialogBackgroundColor, |
|
|
|
elevation: this.elevation ?? dialogTheme.elevation ?? _defaultElevation, |
|
|
|
shape: this.shape ?? dialogTheme.shape ?? _defaultDialogShape, |
|
|
|
child: this.child, |
|
|
|
shape: this.shape ?? dialogTheme.shape ?? _defaultDialogShape |
|
|
|
child: this.child |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
Key key = null, |
|
|
|
Widget title = null, |
|
|
|
EdgeInsets titlePadding = null, |
|
|
|
TextStyle titleTextStyle = null, |
|
|
|
TextStyle contentTextStyle = null, |
|
|
|
Color backgroundColor = null, |
|
|
|
float? elevation = null, |
|
|
|
this.titleTextStyle = titleTextStyle; |
|
|
|
this.contentTextStyle = contentTextStyle; |
|
|
|
this.backgroundColor = backgroundColor; |
|
|
|
this.elevation = elevation; |
|
|
|
public readonly TextStyle titleTextStyle; |
|
|
|
public readonly TextStyle contentTextStyle; |
|
|
|
public readonly Color backgroundColor; |
|
|
|
public readonly float? elevation; |
|
|
|
ThemeData theme = Theme.of(context); |
|
|
|
DialogTheme dialogTheme = DialogTheme.of(context); |
|
|
|
|
|
|
|
List<Widget> children = new List<Widget>(); |
|
|
|
|
|
|
|
if (this.title != null) { |
|
|
|
|
|
|
child: new DefaultTextStyle( |
|
|
|
style: Theme.of(context).textTheme.title, |
|
|
|
style: this.titleTextStyle ?? dialogTheme.titleTextStyle ?? theme.textTheme.title, |
|
|
|
child: this.title |
|
|
|
) |
|
|
|
)); |
|
|
|
|
|
|
child: new Padding( |
|
|
|
padding: this.contentPadding, |
|
|
|
child: new DefaultTextStyle( |
|
|
|
style: Theme.of(context).textTheme.subhead, |
|
|
|
style: this.contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subhead, |
|
|
|
child: this.content |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
) |
|
|
|
); |
|
|
|
|
|
|
|
return new Dialog(child: dialogChild, shape: this.shape); |
|
|
|
return new Dialog( |
|
|
|
backgroundColor: this.backgroundColor, |
|
|
|
elevation: this.elevation, |
|
|
|
shape: this.shape, |
|
|
|
child: dialogChild |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
EdgeInsets titlePadding = null, |
|
|
|
List<Widget> children = null, |
|
|
|
EdgeInsets contentPadding = null, |
|
|
|
Color backgroundColor = null, |
|
|
|
float? elevation = null, |
|
|
|
ShapeBorder shape = null |
|
|
|
) : base(key: key) { |
|
|
|
this.title = title; |
|
|
|
|
|
|
this.backgroundColor = backgroundColor; |
|
|
|
this.elevation = elevation; |
|
|
|
this.shape = shape; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public readonly List<Widget> children; |
|
|
|
|
|
|
|
public readonly EdgeInsets contentPadding; |
|
|
|
|
|
|
|
public readonly Color backgroundColor; |
|
|
|
|
|
|
|
public readonly float? elevation; |
|
|
|
|
|
|
|
public readonly ShapeBorder shape; |
|
|
|
|
|
|
|
|
|
|
) |
|
|
|
); |
|
|
|
|
|
|
|
return new Dialog(child: dialogChild, shape: this.shape); |
|
|
|
return new Dialog( |
|
|
|
backgroundColor: this.backgroundColor, |
|
|
|
elevation: this.elevation, |
|
|
|
shape: this.shape, |
|
|
|
child: dialogChild |
|
|
|
); |
|
|
|
|
|
|
|
static Widget _buildMaterialDialogTransitions(BuildContext context, Animation<float> animation, |
|
|
|
Animation<float> secondaryAnimation, Widget child) { |
|
|
|
return new FadeTransition( |
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |