adaptesPageWidth function
根据宽度约束布局最大宽度
Implementation
double adaptesPageWidth(BoxConstraints constraints) {
double maxWidth = constraints.maxWidth;
if (constraints.maxWidth > kExtraLargeWidthBreakpoint) {
maxWidth = kExtraLargeWidthBreakpoint;
} else if (constraints.maxWidth > kLargeWidthBreakpoint) {
maxWidth = kLargeWidthBreakpoint;
} else if (constraints.maxWidth > kMediumWidthBreakpoint) {
maxWidth = kMediumWidthBreakpoint;
} else if (constraints.maxWidth > kSmallWidthBreakpoint) {
maxWidth = kSmallWidthBreakpoint;
} else {
maxWidth = constraints.maxWidth;
}
return maxWidth;
}