Skip to content

PaginatedDataTable: arrowHeadColor breaks differentiation between states (enabled/disabled) #160458

Closed

Description

@chrisDK1977

Steps to reproduce

Put code below in dartpad.

In paginated_data_table.dart Line 530 and following -> Shouldn't the colour be set to the IconButton instead of the Icon?

Expected results

If it is not possible to turn back to the first page, the symbol should be lighter than if it is possible to turn back.

Actual results

The icons for paging have no disabled "state"

Code sample

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

void main() {
  runApp(MaterialApp(home: MyPaginatedTable()));
}

class MyPaginatedTable extends StatelessWidget {
  final List<Map<String, dynamic>> _data = List.generate(
    50,
    (index) => {"id": index + 1, "name": "Item ${index + 1}"},
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Pagination Test")),
      body: PaginatedDataTable(
        header: Text('Test Table'),
        rowsPerPage: 10,
        // arrowHeadColor: Colors.black, // Setzt die aktive Pfeilfarbe
        columns: [
          DataColumn(label: Text('ID')),
          DataColumn(label: Text('Name')),
        ],
        source: _MyDataSource(_data),
      ),
    );
  }
}

class _MyDataSource extends DataTableSource {
  final List<Map<String, dynamic>> _data;

  _MyDataSource(this._data);

  @override
  DataRow getRow(int index) {
    final item = _data[index];
    return DataRow.byIndex(
      index: index,
      cells: [
        DataCell(Text(item['id'].toString())),
        DataCell(Text(item['name'])),
      ],
    );
  }

  @override
  int get rowCount => _data.length;

  @override
  bool get isRowCountApproximate => false;

  @override
  int get selectedRowCount => 0;
}

Activity

  1. changed the title [-]arrowHeadColor breaks differentiation between states (enabled/disabled)[/-] [+]PaginatedDataTable: arrowHeadColor breaks differentiation between states (enabled/disabled)[/+] on Dec 18, 2024
  2. danagbemava-nc commented on Dec 18, 2024

    @danagbemava-nc
    Member

    Reproducible on the latest stable & master

    arrowHeadColor not set arrowHeadColor set
    Screen.Recording.2024-12-18.at.10.09.00.AM.mov
    Screen.Recording.2024-12-18.at.10.09.17.AM.mov
    flutter doctor -v
    [✓] Flutter (Channel stable, 3.27.1, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
        • Flutter version 3.27.1 on channel stable at /Users/deanli/dev/stable
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 17025dd882 (2 days ago), 2024-12-17 03:23:09 +0900
        • Engine revision cb4b5fff73
        • Dart version 3.6.0
        • DevTools version 2.40.2
    
    
    [!] Flutter (Channel master, 3.28.0-1.0.pre.38698, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
        • Flutter version 3.28.0-1.0.pre.38698 on channel master at /Users/deanli/dev/master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 1398dc7eec (12 hours ago), 2024-12-17 14:30:30 -0800
        • Engine revision 6a75cb6a6a
        • Dart version 3.7.0 (build 3.7.0-259.0.dev)
        • DevTools version 2.41.0
    
    
  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Dec 18, 2024
  4. added
    P2Important issues not at the top of the work list
    triaged-designTriaged by Design Languages team
    on Dec 18, 2024
  5. self-assigned this
    on Mar 7, 2025
  6. moved this from To do to In progress in Nevercodeon Mar 7, 2025
  7. huycozy commented on Mar 14, 2025

    @huycozy
    Member

    @chrisDK1977 Thanks for filing the issue and also pointing out the LOC causing this. You are correct about setting the color for IconButton.
    The button is only enabled when onPressed is not null, and the color logic happens in IconButton widget, not in Color widget, see more at:

    data: IconThemeData(size: effectiveIconSize, color: currentColor),

  8. moved this from In progress to PR submitted in Nevercodeon Mar 14, 2025
  9. moved this from PR submitted to Done (PR merged) in Nevercodeon Mar 17, 2025
  10. added
    r: fixedIssue is closed as already fixed in a newer version
    on Mar 18, 2025
  11. github-actions commented on Apr 1, 2025

    @github-actions

    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.

  12. locked as resolved and limited conversation to collaborators on Apr 1, 2025
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 listfound in release: 3.27Found to occur in 3.27found in release: 3.28Found to occur in 3.28frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

  • Status
    Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions