Skip to content

dividerThickness: 0 in DataTable stills renders a visible divider #132214

@ManuelRauber

Description

@ManuelRauber

Is there an existing issue for this?

Steps to reproduce

  1. Use the code sample in dartpad
  2. Observe, that there are dividers rendered

Expected results

Using dividerThickness: 0 should not render a visible border.
Actually, using dividerThickness: 0.1 renders a smaller visible border, so it looks like using 0 falls back to some default.

Actual results

A border of thickness 1 seems to be rendered.

Code sample

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

const Color darkBlue = Color.fromARGB(255, 18, 32, 47);

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.dark().copyWith(
        scaffoldBackgroundColor: darkBlue,
      ),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: MyWidget(),
        ),
      ),
    );
  }
}

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        DataTable(
          dividerThickness: 0,
          columns: const [
            DataColumn(label: Text('h1')),
            DataColumn(label: Text('h2')),
          ],
          rows: const [
            DataRow(cells: [DataCell(Text('1')), DataCell(Text('2'))]),
            DataRow(cells: [DataCell(Text('3')), DataCell(Text('4'))]),
          ],
        ),
        DataTableTheme(
          data: Theme.of(context).dataTableTheme.copyWith(dividerThickness:0),
          child: DataTable(
            dividerThickness: 0,
            columns: const [
              DataColumn(label: Text('h1')),
              DataColumn(label: Text('h2')),
            ],
            rows: const [
              DataRow(cells: [DataCell(Text('1')), DataCell(Text('2'))]),
              DataRow(cells: [DataCell(Text('3')), DataCell(Text('4'))]),
            ],
          ),
        ),
      ],
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

image

Logs

Logs

Not needed.

Flutter Doctor output

Doctor output

Not needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectf: material designflutter/packages/flutter/material repository.found in release: 3.10Found to occur in 3.10found in release: 3.13Found to occur in 3.13frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions