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

Skip to content

DataTable's border not clipping the content #113025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BananaMasterz opened this issue Oct 6, 2022 · 2 comments · Fixed by #113205
Closed

DataTable's border not clipping the content #113025

BananaMasterz opened this issue Oct 6, 2022 · 2 comments · Fixed by #113205
Assignees
Labels
f: material design flutter/packages/flutter/material repository. found in release: 3.3 Found to occur in 3.3 found in release: 3.4 Found to occur in 3.4 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list r: fixed Issue is closed as already fixed in a newer version

Comments

@BananaMasterz
Copy link

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!

@exaby73 exaby73 added the in triage Presently being triaged by the triage team label Oct 7, 2022
@exaby73
Copy link
Member

exaby73 commented Oct 7, 2022

Triage report

I can reproduce this issue on Master (3.5.0-3.0.pre.7). Seems like the dataRowColor is ignoring the borderRadius defined in the border property.

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: SafeArea(
        child: Padding(
          padding: const EdgeInsets.all(16),
          child: DataTable(
            border: TableBorder.all(
              borderRadius: const BorderRadius.all(Radius.circular(30)),
            ),
            dataRowColor: MaterialStateProperty.all(
              Theme.of(context).primaryColor.withOpacity(.5),
            ),
            columns: const [
              DataColumn(label: Text('Column 1')),
            ],
            rows: [
              for (var i = 0; i < 10; ++i)
                DataRow(
                  cells: [
                    DataCell(
                      SelectableText('col_1 row_$i'),
                    ),
                  ],
                ),
            ],
          ),
        ),
      ),
    );
  }
}
Screenshot

@exaby73 exaby73 added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.3 Found to occur in 3.3 found in release: 3.4 Found to occur in 3.4 and removed in triage Presently being triaged by the triage team labels Oct 7, 2022
@TahaTesser TahaTesser self-assigned this Oct 10, 2022
@TahaTesser TahaTesser moved this to To do in Nevercode Oct 10, 2022
@TahaTesser TahaTesser moved this from To do to PR submitted in Nevercode Oct 11, 2022
@Piinks Piinks added P1 High-priority issues at the top of the work list waiting for PR to land (fixed) A fix is in flight P2 Important issues not at the top of the work list and removed P1 High-priority issues at the top of the work list labels Oct 20, 2022
Repository owner moved this from PR submitted to Done (PR merged) in Nevercode Oct 25, 2022
@TahaTesser TahaTesser added r: fixed Issue is closed as already fixed in a newer version and removed waiting for PR to land (fixed) A fix is in flight labels Oct 26, 2022
@github-actions
Copy link

github-actions bot commented Nov 9, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: material design flutter/packages/flutter/material repository. found in release: 3.3 Found to occur in 3.3 found in release: 3.4 Found to occur in 3.4 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list r: fixed Issue is closed as already fixed in a newer version
Projects
Status: Done (PR merged)
Development

Successfully merging a pull request may close this issue.

4 participants