From 58190083208067e8828184abaf1e0025e2cde55f Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 30 Jul 2018 10:45:24 -0700 Subject: [PATCH] increase checkbox size and fix header area (#19966) --- .../flutter/lib/src/material/data_table.dart | 17 ++++--- .../src/material/paginated_data_table.dart | 48 ++++++++++--------- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/packages/flutter/lib/src/material/data_table.dart b/packages/flutter/lib/src/material/data_table.dart index 03d4a92c8d..8f22971a2a 100644 --- a/packages/flutter/lib/src/material/data_table.dart +++ b/packages/flutter/lib/src/material/data_table.dart @@ -364,13 +364,16 @@ class DataTable extends StatelessWidget { VoidCallback onRowTap, ValueChanged onCheckboxChanged }) { - Widget contents = new Padding( - padding: const EdgeInsetsDirectional.only(start: _tablePadding, end: _tablePadding / 2.0), - child: new Center( - child: new Checkbox( - activeColor: color, - value: checked, - onChanged: onCheckboxChanged, + Widget contents = new Semantics( + container: true, + child: new Padding( + padding: const EdgeInsetsDirectional.only(start: _tablePadding, end: _tablePadding / 2.0), + child: new Center( + child: new Checkbox( + activeColor: color, + value: checked, + onChanged: onCheckboxChanged, + ), ), ), ); diff --git a/packages/flutter/lib/src/material/paginated_data_table.dart b/packages/flutter/lib/src/material/paginated_data_table.dart index 4ce12ccca0..bf7b22e7f7 100644 --- a/packages/flutter/lib/src/material/paginated_data_table.dart +++ b/packages/flutter/lib/src/material/paginated_data_table.dart @@ -380,34 +380,38 @@ class PaginatedDataTableState extends State { // CARD return new Card( + semanticContainer: false, child: new Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - new DefaultTextStyle( - // These typographic styles aren't quite the regular ones. We pick the closest ones from the regular - // list and then tweak them appropriately. - // See https://material.google.com/components/data-tables.html#data-tables-tables-within-cards - style: _selectedRowCount > 0 ? themeData.textTheme.subhead.copyWith(color: themeData.accentColor) - : themeData.textTheme.title.copyWith(fontWeight: FontWeight.w400), - child: IconTheme.merge( - data: const IconThemeData( - opacity: 0.54 - ), - child: new ButtonTheme.bar( - child: new Container( - height: 64.0, - padding: new EdgeInsetsDirectional.only(start: startPadding, end: 14.0), - // TODO(ianh): This decoration will prevent ink splashes from being visible. - // Instead, we should have a widget that prints the decoration on the material. - // See https://github.com/flutter/flutter/issues/3782 - color: _selectedRowCount > 0 ? themeData.secondaryHeaderColor : null, - child: new Row( - mainAxisAlignment: MainAxisAlignment.end, - children: headerWidgets + new Semantics( + container: true, + child: new DefaultTextStyle( + // These typographic styles aren't quite the regular ones. We pick the closest ones from the regular + // list and then tweak them appropriately. + // See https://material.google.com/components/data-tables.html#data-tables-tables-within-cards + style: _selectedRowCount > 0 ? themeData.textTheme.subhead.copyWith(color: themeData.accentColor) + : themeData.textTheme.title.copyWith(fontWeight: FontWeight.w400), + child: IconTheme.merge( + data: const IconThemeData( + opacity: 0.54 + ), + child: new ButtonTheme.bar( + child: new Container( + height: 64.0, + padding: new EdgeInsetsDirectional.only(start: startPadding, end: 14.0), + // TODO(ianh): This decoration will prevent ink splashes from being visible. + // Instead, we should have a widget that prints the decoration on the material. + // See https://github.com/flutter/flutter/issues/3782 + color: _selectedRowCount > 0 ? themeData.secondaryHeaderColor : null, + child: new Row( + mainAxisAlignment: MainAxisAlignment.end, + children: headerWidgets + ) ) ) ) - ) + ), ), new SingleChildScrollView( scrollDirection: Axis.horizontal,