Skip to content

TableBorder.lerp and TableBorder.scale drop borderRadius #195397

Description

@ChandraChaan

Steps to reproduce

final a = TableBorder.all(borderRadius: const BorderRadius.all(Radius.circular(4)));
final b = TableBorder.all(borderRadius: const BorderRadius.all(Radius.circular(12)));

print(TableBorder.lerp(a, b, 0.5)!.borderRadius); // BorderRadius.zero
print(b.scale(0.5).borderRadius);                 // BorderRadius.zero

Expected results

lerp interpolates the radius (8 here), and scale scales it (6 here), the same way BoxDecoration handles borderRadius.

Actual results

Both return BorderRadius.zero. TableBorder.lerp and TableBorder.scale build a new TableBorder from the six sides only, so a table with rounded corners loses them for the whole of an animation, for example when the table's border animates through a theme change. TableBorder.lerp(null, b, t) goes through scale, so animating a rounded border in from nothing is affected too.

Flutter version

master and stable 3.47.8.

Activity

  1. suryaKommana2662 commented on Oct 27, 2026

    @suryaKommana2662
    Contributor

    @ChandraChaan Thanks for the report. I was able to reproduce the issue locally. Both TableBorder.lerp(a, b, 0.5) and b.scale(0.5) return BorderRadius.zero instead of preserving the expected border radius. Routing to the team-framework for further investigation.

    Sample Code

    import 'package:material_ui/material_ui.dart';
    
    void main() {
      final a = TableBorder.all(
        borderRadius: const BorderRadius.all(Radius.circular(4)),
      );
    
      final b = TableBorder.all(
        borderRadius: const BorderRadius.all(Radius.circular(12)),
      );
    
      final lerped = TableBorder.lerp(a, b, 0.5)!;
      final scaled = b.scale(0.5);
      debugPrint('lerp: ${lerped.borderRadius}');
      debugPrint('scale: ${scaled.borderRadius}');
      debugPrint('lerp from null: ${TableBorder.lerp(null, b, 0.5)!.borderRadius}');
      runApp(
        MaterialApp(
          home: Scaffold(
            appBar: AppBar(title: const Text('TableBorder Reproduction')),
            body: Padding(
              padding: const EdgeInsets.all(16),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text('lerp radius: ${lerped.borderRadius}'),
                  Text('Expected: BorderRadius.circular(8)'),
                  const SizedBox(height: 16),
                  Text('scale radius: ${scaled.borderRadius}'),
                  Text('Expected: BorderRadius.circular(6)'),
                  const SizedBox(height: 16),
                  Text(
                    'lerp from null: '
                    '${TableBorder.lerp(null, b, 0.5)!.borderRadius}',
                  ),
                  const Text('Expected: BorderRadius.circular(6)'),
                ],
              ),
            ),
          ),
        ),
      );
    }
    
    Image

    Flutter Doctor Output

    [✓] Flutter (Channel master, 3.50.0-1.0.pre-209, on macOS 27.0 26A428 darwin-arm64, locale en-IN) [2.0s]
        • Flutter version 3.50.0-1.0.pre-209 on channel master at /Users/suryakommana/develop/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 7b0a985e54 (4 days ago), 2026-10-23 00:20:16 +0000
        • Engine revision 7b0a985e54
        • Dart version 3.15.0 (build 3.15.0-67.0.dev)
        • DevTools version 2.61.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets,
          enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration, enable-riscv64, enable-hcpp
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [1,436ms]
        • Android SDK at /Users/suryakommana/Library/Android/sdk
        • Emulator version 37.1.11.0 (build_id 15917651) (CL:N/A)
        • Platform android-37.0, build-tools 36.0.0
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
          This is the JDK bundled with the latest Android Studio installation on this machine.
          To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build 25.0.2+-15348964-b329.117)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 27.1) [611ms]
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 27A9275
        • CocoaPods version 1.17.0
    
    [✓] Chrome - develop for the web [3ms]
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Connected device (3 available) [8.6s]
        • iPhone 18 Pro (mobile) • D80F2104-E911-4251-BEDD-E67D9B7EBF58 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-27-0 (simulator)
        • macOS (desktop)        • macos                                • darwin-arm64   • macOS 27.0 26A428 darwin-arm64
        • Chrome (web)           • chrome                               • web-javascript • Google Chrome 156.0.8078.48
    
    [✓] Network resources [459ms]
        • All expected network resources are available.
    
    • No issues found!
  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Oct 27, 2026
  3. ChandraChaan commented on Oct 27, 2026

    @ChandraChaan
    Author

    Thanks for confirming! The fix is in #195398, which is already approved. Its tests cover all three cases from your sample: lerp(a, b), scale, and lerp from/to null.

  4. added
    P2Important issues not at the top of the work list
    on Oct 27, 2026
  5. justinmc commented on Oct 27, 2026

    @justinmc
    Contributor

    @ChandraChaan Heads up that TableBorder is about to be deprecated in favor of TableBorderPainter, see #177102.

  6. ChandraChaan commented on Oct 27, 2026

    @ChandraChaan
    Author

    Thanks for the heads-up, @justinmc. I checked #177102: TableBorderPainter.lerp and TableBorderPainter.scale also rebuild the border from the six sides only, so they drop borderRadius the same way.

    #195398 fixes TableBorder itself (it's approved), and since TableBorder stays usable through the deprecation period, I think it's still worth landing. Once #177102 is in, I'll send a follow-up that applies the same fix and tests to TableBorderPainter, unless @hm21 would rather include it in #177102.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listframeworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions