layout method
layout API.
Implementation
@override
PwBox layout(Context context, BoxConstraints constraints) {
final Widget? number = pageNumber ??
(showPageNumber
? const PageNumber(
style: TextStyle(fontSize: 8, color: '78909C'),
)
: null);
Widget row = Row(
children: <Widget>[
leading ?? const SizedBox.shrink(),
const Spacer(),
title ?? const SizedBox.shrink(),
const Spacer(),
trailing ?? number ?? const SizedBox.shrink(),
],
);
if (divider) {
row = Column(
children: <Widget>[
row,
Divider(height: 8, thickness: 0.6, color: dividerColor),
],
);
}
return Padding(padding: padding, child: row).layout(context, constraints);
}