pantheracorp / PantheraIDS_Issues

A repository for any issues and bugs related to PantheraIDS
0 stars 0 forks source link

MAIN-1010 ⁃ Reports section - Fix column headers to the top of the table #1132

Open sync-by-unito[bot] opened 1 month ago

sync-by-unito[bot] commented 1 month ago

In the Observations > Reports section of the SSGR App, the column headers are not fixed to the top of the table.

Task:﹍ The header row should be frozen/fixed so that it can be viewed even when you scroll far down (see code below for implementation):

dependencies:
  data_table_2: ^1.1.0

  import 'package:data_table_2/data_table_2.dart';

Expanded(
  child: SingleChildScrollView(
    scrollDirection: Axis.vertical,
    child: SingleChildScrollView(
      scrollDirection: Axis.horizontal,
      child: Padding(
        padding: const EdgeInsets.only(bottom: 18.0),
        child: DataTable2(
          columns: [
            DataColumn(
              label: Text("Lodge"),
            ),
            DataColumn(
              label: Text("Guide"),
            ),
            DataColumn(
              label: Text("Date"),
            ),
            DataColumn(
              label: Text("Time"),
            ),
            DataColumn(
              label: Text("Location"),
            ),
            DataColumn(
              label: Text("Individual"),
            ),
            DataColumn(
              label: Text("Sex"),
            ),
            DataColumn(
              label: Text("Age"),
            ),
            DataColumn(
              label: Text("Cub"),
            ),
            DataColumn(
              label: Text("No. cubs"),
            ),
            DataColumn(
              label: Text("Kill"),
            ),
            DataColumn(
              label: Text("Prey Hoisted"),
            ),
            DataColumn(
              label: Text("Prey Species"),
            ),
            DataColumn(
              label: Text("Prey Sex"),
            ),
            DataColumn(
              label: Text("Prey Age"),
            ),
            DataColumn(
              label: Text("Prey Stolen"),
            ),
            DataColumn(
              label: Text("Scavenger Species"),
            ),
            DataColumn(
              label: Text("Scavenger Individual"),
            ),
            DataColumn(
              label: Text("Interaction"),
            ),
            DataColumn(
              label: Text("Interaction Name"),
            ),
            DataColumn(label: Text("Notes")),
            DataColumn(label: Text("Errors")),
            DataColumn(label: Text("Action")),
          ],
          rows: [
            // Add your DataRows here
          ],
          // Enabling fixed headers
          fixedHeader: true,
        ),
      ),
    ),
  ),
)

┆Issue is synchronized with this Jira Task by Unito

sync-by-unito[bot] commented 1 month ago

➤ Isaiah Lekay commented:

Irshaad Parker

Melvin Ollewagen - This task requires a new package to be used and implemented for us to fix the column headers to the top of the table. Could we hold on this for the next deploy perhaps?

sync-by-unito[bot] commented 2 weeks ago

➤ Melvin Ollewagen commented:

Managed to build a second table with the headings that stays at the top of the page, problem is it doesn't scroll sideways so we need to see if removing columns is a possibility otherwise this task cant really be completed as the methods dont exist to enable this