buildM3ESimpleHeader function

Widget buildM3ESimpleHeader(
  1. BuildContext context,
  2. M3EExpandableData data,
  3. double progress
)

buildM3ESimpleHeader.

Implementation

Widget buildM3ESimpleHeader(
  BuildContext context,
  M3EExpandableData data,
  double progress,
) {
  final theme = M3ETheme.of(context);
  final clampedProgress = progress.clamp(0.0, 1.0);
  final resolvedStyle = _resolveTitleStyle(theme, data, clampedProgress);

  return Row(
    children: [
      if (data.leading != null) ...[data.leading!, const SizedBox(width: 16)],
      Expanded(child: Text(data.title, style: resolvedStyle)),
      if (data.trailing != null) ...[const SizedBox(width: 16), data.trailing!],
    ],
  );
}