Repository: flutter
Issue: [two_dimensional_scrollables] Unable to add trailing padding to last column
Labels: package,has reproducible steps,P2,team-framework,triaged-framework,p: two_dimensional_scrollables,found in release: 3.22

### Steps to reproduce

1. Copy the code sample below
2. Modify the padding and observe how no trailing padding to the last column gets applied
3. If you want to give trailing padding to the last column, you have to give the first column leading padding.

### Expected results

The last column's trailing padding should be respected.

### Actual results

The last column's trailing padding isn't considered at all.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:two_dimensional_scrollables/two_dimensional_scrollables.dart';

const double _kHeaderHeight = 32;
const double _kRowHeight = 48;

const Color _kHeaderColor = Colors.blueGrey;
const Color _kLabelColor = Colors.white;
const Color _kEvenRowColor = Colors.black38;
const Color _kOddRowColor = Colors.black54;

const TextStyle _kLabelStyle = TextStyle(
  fontWeight: FontWeight.w500,
  color: _kLabelColor,
  fontSize: 12,
);

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: true,
        scaffoldBackgroundColor: Colors.grey.shade900,
      ),
      home: const Scaffold(
        body: DefaultTextStyle(
          style: TextStyle(color: Colors.white),
          child: BugTable(),
        ),
      ),
    );
  }
}

class BugTable extends StatelessWidget {
  const BugTable({super.key});

  @override
  Widget build(BuildContext context) {
    return TableView.builder(
      rowCount: 4,
      columnCount: 5,
      cellBuilder: (context, vicinity) {
        final TableVicinity(:row, :column) = vicinity;
        final isHeader = row == 0;

        Widget child;
        if (isHeader) {
          final alignment = column == 0 ? TextAlign.left : TextAlign.right;

          child = Align(
            alignment:
                column == 0 ? Alignment.centerLeft : Alignment.centerRight,
            child: Text(
              "Normal Col.",
              textAlign: alignment,
              style: _kLabelStyle,
            ),
          );
        } else {
          child = column == 0
              ? const Align(
                  alignment: Alignment.centerLeft,
                  child: Text("First Col. Data"),
                )
              : const Align(
                  alignment: Alignment.centerRight,
                  child: Text("Col. Data"),
                );
        }

        return TableViewCell(child: child);
      },
      columnBuilder: (index) {
        print('col idx: $index');

        return TableSpan(
          padding: index == 4 ? const TableSpanPadding.all(100) : null,
          // Uncomment below to see the last column get trailing padding
          // padding: index == 0 ? const TableSpanPadding(leading: 100) : null,
          extent: index == 0
              ? const FixedTableSpanExtent(104)
              : const FixedTableSpanExtent(72),
        );
      },
      rowBuilder: (idx) {
        final isHeader = idx == 0;
        final rowColor = isHeader
            ? _kHeaderColor
            : idx.isEven
                ? _kEvenRowColor
                : _kOddRowColor;

        return TableSpan(
          extent: isHeader
              ? const FixedTableSpanExtent(_kHeaderHeight)
              : const FixedTableSpanExtent(_kRowHeight),
          backgroundDecoration: TableSpanDecoration(color: rowColor),
        );
      },
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

![image](https://github.com/flutter/flutter/assets/25782944/b14e4563-e626-4e6c-9f95-bd2b67c8b50e)

</details>


### Logs

N/A

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.22631.3527], locale en-US)
    • Flutter version 3.22.0 on channel stable at C:\Users\bscho\.puro\envs\stable\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (6 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\bscho\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • CHROME_EXECUTABLE = C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.8.34330.188
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.89.1)
    • VS Code at C:\Users\bscho\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.88.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.3527]
    • Chrome (web)      • chrome  • web-javascript • unknown
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 124.0.2478.97

[√] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>