thenButton method
Implementation
Widget thenButton({
required VoidCallback onPressed,
required Widget child,
}) {
return then(
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Builder(builder: (context) {
final defaultTextStyle = DefaultTextStyle.of(context);
return Button(
style: const ButtonStyle.link(
density: ButtonDensity.compact,
),
onPressed: onPressed,
child: Builder(
builder: (context) {
final buttonTextStyle = DefaultTextStyle.of(context);
return DefaultTextStyle(
style: defaultTextStyle.style.copyWith(
decoration: buttonTextStyle.style.decoration,
),
overflow: defaultTextStyle.overflow,
maxLines: defaultTextStyle.maxLines,
softWrap: defaultTextStyle.softWrap,
textAlign: defaultTextStyle.textAlign,
textHeightBehavior: defaultTextStyle.textHeightBehavior,
textWidthBasis: defaultTextStyle.textWidthBasis,
child: child,
);
},
),
);
}),
),
);
}