Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DataTable's border not clipping the content #113025

Closed
@BananaMasterz

Description

@BananaMasterz

Steps to Reproduce

  1. Execute flutter run on the code sample
  2. Notice how the content on the bottom corners overflows even though a border is set

Expected results:
image

Actual results:
image

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: SingleChildScrollView(
          child: DataTable(
            border: TableBorder.all(
              color: Colors.black,
              width: 2,
              borderRadius: const BorderRadius.all(Radius.circular(30)),
            ),
            dataRowColor: MaterialStateProperty.resolveWith<Color?>(
              (Set<MaterialState> states) {
                return Theme.of(context).primaryColor.withOpacity(.5);
              },
            ),
            columns: const [
              DataColumn(label: Text('Column 1')),
              DataColumn(label: Text('Column 2'), numeric: true),
            ],
            rows: [
              for (var i = 0; i < 10; ++i)
                DataRow(
                  cells: [
                    DataCell(
                      SelectableText('col_1 row_$i'),
                    ),
                    DataCell(
                      SelectableText('col_2 row_$i'),
                    ),
                  ],
                )
            ],
          ),
        ),
      ),
    );
  }
}
flutter doctor -v
[√] Flutter (Channel stable, 3.3.3, on Microsoft Windows [Version 10.0.22000.1042], locale el-GR)
    • Flutter version 3.3.3 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18a827f393 (8 days ago), 2022-09-28 10:03:14 -0700
    • Engine revision 5c984c26eb
    • Dart version 2.18.2
    • DevTools version 2.15.0

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\Kyria\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.5)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32616.157
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.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
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.1042]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 106.0.5249.91
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 103.0.1264.49

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.found in release: 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions