Gray section after flutter build web application

45 views Asked by At

Im trying to host my flutter web application in github, and it works but there is a section in the app that in the builded version appear gray. The original section is a DataTable widget and in the debug mode I see it right. What could be the problem?

Theese are the screenshots

The code for that part:

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../constants/theme.dart';
import '../providers/general.dart';

class DashboardTable extends StatefulWidget {
  const DashboardTable({super.key});

  @override
  State<DashboardTable> createState() => _DashboardTableState();
}

class _DashboardTableState extends State<DashboardTable> {
  List<bool> selected = List<bool>.generate(100, (int index) => false);
  bool ascending = false;

  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: context.watch<General>().dati,
      builder: (context, snapshot) {
        // if (snapshot.hasData) {
        if (snapshot.hasData &&
            !context.watch<General>().isLoading &&
            !context.watch<General>().isEmpty) {
          return ConstrainedBox(
              constraints: BoxConstraints(
                minWidth: double.infinity,
                maxHeight: MediaQuery.of(context).size.height - 170,
              ),
              child: Expanded(
                child: Container(
                  decoration: BoxDecoration(
                      color: mainColor50,
                      borderRadius: BorderRadius.circular(8),
                      border: Border.all(color: mainColor700, width: 1)),
                  child: ClipRRect(
                    borderRadius: BorderRadius.circular(8),
                    child: SingleChildScrollView(
                      child: DataTable(
                          dataRowMinHeight: 40,
                          dataRowMaxHeight: 40,
                          columnSpacing: 20,
                          showCheckboxColumn: false,
                          sortColumnIndex: 0,
                          sortAscending: ascending,
                          headingRowHeight: 32,
                          border: TableBorder.symmetric(
                              inside: const BorderSide(
                                  width: 1, color: mainColor700)),
                          headingRowColor: MaterialStateColor.resolveWith(
                              (states) => bgGrey),
                          columns: const <DataColumn>[
                            DataColumn(
                                label: Text("Ora",
                                    style: TextStyle(
                                        fontSize: 12, color: textColor))),
                            DataColumn(
                                label: Text("Classe",
                                    style: TextStyle(
                                        fontSize: 12, color: textColor))),
                            DataColumn(
                                label: Text("Docente assente",
                                    style: TextStyle(
                                        fontSize: 12, color: textColor))),
                            DataColumn(
                                label: Text("Sostituto 1",
                                    style: TextStyle(
                                        fontSize: 12, color: textColor))),
                            DataColumn(
                                label: Text("Sostituto 2",
                                    style: TextStyle(
                                        fontSize: 12, color: textColor))),
                            DataColumn(
                                tooltip: "Sostituzione a pagamento",
                                label: Text("Pag.",
                                    style: TextStyle(
                                        fontSize: 12, color: textColor))),
                            DataColumn(
                                label: SizedBox(
                                    width: 200,
                                    child: Text("Note",
                                        style: TextStyle(
                                            fontSize: 12, color: textColor)))),
                            DataColumn(
                                tooltip: "Firmata",
                                label: Text("Fir.",
                                    style: TextStyle(
                                        fontSize: 12, color: textColor))),
                          ],
                          rows: List<DataRow>.generate(snapshot.data!.length,
                              (int index) {
                            // index = index % 4;
                            return DataRow(
                                color:
                                    MaterialStateProperty.resolveWith<Color?>(
                                        (Set<MaterialState> states) {
                                  // All rows will have the same selected color.
                                  if (states.contains(MaterialState.selected)) {
                                    return mainColor;
                                  }
                                  return null; // Use default value for other states and odd rows.
                                }),
                                cells: <DataCell>[
                                  DataCell(Text(
                                      snapshot.data![index].ora.toString(),
                                      style: const TextStyle(
                                          fontSize: 12,
                                          fontWeight: FontWeight.w700))),
                                  DataCell(Text(snapshot.data![index].classe,
                                      style: const TextStyle(
                                          fontSize: 12,
                                          fontWeight: FontWeight.w700))),
                                  DataCell(Text(
                                      snapshot.data![index].docAssente,
                                      style: const TextStyle(
                                          fontSize: 12,
                                          fontWeight: FontWeight.w700))),
                                  DataCell(Text(
                                      snapshot.data![index].docSostituto1,
                                      style: const TextStyle(
                                          fontSize: 12,
                                          fontWeight: FontWeight.w700))),
                                  DataCell(Text(
                                      snapshot.data![index].docSostituto2,
                                      style: const TextStyle(
                                          fontSize: 12,
                                          fontWeight: FontWeight.w700))),
                                  DataCell(Text(snapshot.data![index].pagamento,
                                      style: const TextStyle(
                                          fontSize: 12,
                                          fontWeight: FontWeight.w700))),
                                  DataCell(Text(snapshot.data![index].note,
                                      style: const TextStyle(
                                          fontSize: 12,
                                          fontWeight: FontWeight.w700))),
                                  DataCell(Text(snapshot.data![index].firmata,
                                      style: const TextStyle(
                                          fontSize: 12,
                                          fontWeight: FontWeight.w700))),
                                ],
                                selected: selected[index],
                                onSelectChanged: (bool? value) {
                                  setState(() {
                                    selected[index] = value!;
                                  });
                                });
                          })),
                    ),
                  ),
                ),
              ));
        } else if (snapshot.hasError) {
          return const Text("Qualcosa รจ andato storto :(");
        } else if (context.watch<General>().isEmpty &&
            !context.watch<General>().isLoading) {
          return Text(
            "Nessuna sostituzione per ${context.watch<General>().dataFormattata}",
            style: const TextStyle(color: textColor),
          );
        }
        return const Center(child: CircularProgressIndicator());
        // return DashboardTableSl();
      },
    );
  }
}

The browser errors:

871main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
66main.dart.js:26211 Another exception was thrown: Instance of 'minified:fy<void>'
0

There are 0 answers