fix(responsable): show horizontal table scrollbars
This commit is contained in:
@@ -2238,6 +2238,57 @@ class _PanelEmptyState extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _TableauAvecDefilementHorizontal extends StatefulWidget {
|
||||
const _TableauAvecDefilementHorizontal({
|
||||
required this.largeurMinimale,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
final double largeurMinimale;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
State<_TableauAvecDefilementHorizontal> createState() =>
|
||||
_TableauAvecDefilementHorizontalState();
|
||||
}
|
||||
|
||||
class _TableauAvecDefilementHorizontalState
|
||||
extends State<_TableauAvecDefilementHorizontal> {
|
||||
final ScrollController _controleur = ScrollController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controleur.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Scrollbar(
|
||||
controller: _controleur,
|
||||
thumbVisibility: true,
|
||||
trackVisibility: true,
|
||||
interactive: true,
|
||||
thickness: 8,
|
||||
radius: const Radius.circular(4),
|
||||
scrollbarOrientation: ScrollbarOrientation.bottom,
|
||||
notificationPredicate: (notification) =>
|
||||
notification.metrics.axis == Axis.horizontal,
|
||||
child: SingleChildScrollView(
|
||||
controller: _controleur,
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: const EdgeInsets.only(bottom: 14),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: widget.largeurMinimale),
|
||||
child: widget.child,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _VueEmpruntsTableau extends StatelessWidget {
|
||||
const _VueEmpruntsTableau({
|
||||
required this.items,
|
||||
@@ -2556,56 +2607,51 @@ class _VueEmpruntsTableau extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
border: Border.all(color: EnsupColors.line),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: largeurDisponible),
|
||||
child: DataTable(
|
||||
sortColumnIndex: _sortColumnIndex,
|
||||
sortAscending: ordre == "asc",
|
||||
headingRowColor: WidgetStatePropertyAll(
|
||||
EnsupColors.soft.withValues(alpha: 0.8),
|
||||
),
|
||||
headingTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: EnsupColors.text2,
|
||||
),
|
||||
dataTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
color: EnsupColors.text,
|
||||
),
|
||||
columns: [
|
||||
const DataColumn(label: Text("N°")),
|
||||
DataColumn(
|
||||
label: const Text("Matériel"),
|
||||
onSort: (_, _) => onTri("materiel"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Étudiant"),
|
||||
onSort: (_, _) => onTri("etudiant"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Date d’emprunt"),
|
||||
onSort: (_, _) => onTri("dateEmprunt"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Retour prévu"),
|
||||
onSort: (_, _) => onTri("dateRetourPrevue"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Retour réel"),
|
||||
onSort: (_, _) => onTri("dateRetourReelle"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Statut"),
|
||||
onSort: (_, _) => onTri("statut"),
|
||||
),
|
||||
],
|
||||
rows: items.map(_ligneTableau).toList(),
|
||||
),
|
||||
child: _TableauAvecDefilementHorizontal(
|
||||
largeurMinimale: largeurDisponible,
|
||||
child: DataTable(
|
||||
sortColumnIndex: _sortColumnIndex,
|
||||
sortAscending: ordre == "asc",
|
||||
headingRowColor: WidgetStatePropertyAll(
|
||||
EnsupColors.soft.withValues(alpha: 0.8),
|
||||
),
|
||||
headingTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: EnsupColors.text2,
|
||||
),
|
||||
dataTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
color: EnsupColors.text,
|
||||
),
|
||||
columns: [
|
||||
const DataColumn(label: Text("N°")),
|
||||
DataColumn(
|
||||
label: const Text("Matériel"),
|
||||
onSort: (_, _) => onTri("materiel"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Étudiant"),
|
||||
onSort: (_, _) => onTri("etudiant"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Date d’emprunt"),
|
||||
onSort: (_, _) => onTri("dateEmprunt"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Retour prévu"),
|
||||
onSort: (_, _) => onTri("dateRetourPrevue"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Retour réel"),
|
||||
onSort: (_, _) => onTri("dateRetourReelle"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Statut"),
|
||||
onSort: (_, _) => onTri("statut"),
|
||||
),
|
||||
],
|
||||
rows: items.map(_ligneTableau).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -3098,55 +3144,50 @@ class _VueMaterielsTableau extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
border: Border.all(color: EnsupColors.line),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: largeurDisponible),
|
||||
child: DataTable(
|
||||
sortColumnIndex: _sortColumnIndex,
|
||||
sortAscending: ordre == "asc",
|
||||
headingRowColor: WidgetStatePropertyAll(
|
||||
EnsupColors.soft.withValues(alpha: 0.8),
|
||||
),
|
||||
headingTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: EnsupColors.text2,
|
||||
),
|
||||
dataTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
color: EnsupColors.text,
|
||||
),
|
||||
columns: [
|
||||
DataColumn(
|
||||
label: const Text("Référence"),
|
||||
onSort: (_, _) => onTri("reference"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Matériel"),
|
||||
onSort: (_, _) => onTri("nom"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Catégorie"),
|
||||
onSort: (_, _) => onTri("categorie"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Marque / modèle"),
|
||||
onSort: (_, _) => onTri("marque"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("État"),
|
||||
onSort: (_, _) => onTri("etatGeneral"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Statut"),
|
||||
onSort: (_, _) => onTri("statut"),
|
||||
),
|
||||
],
|
||||
rows: items.map(_ligneTableau).toList(),
|
||||
),
|
||||
child: _TableauAvecDefilementHorizontal(
|
||||
largeurMinimale: largeurDisponible,
|
||||
child: DataTable(
|
||||
sortColumnIndex: _sortColumnIndex,
|
||||
sortAscending: ordre == "asc",
|
||||
headingRowColor: WidgetStatePropertyAll(
|
||||
EnsupColors.soft.withValues(alpha: 0.8),
|
||||
),
|
||||
headingTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: EnsupColors.text2,
|
||||
),
|
||||
dataTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
color: EnsupColors.text,
|
||||
),
|
||||
columns: [
|
||||
DataColumn(
|
||||
label: const Text("Référence"),
|
||||
onSort: (_, _) => onTri("reference"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Matériel"),
|
||||
onSort: (_, _) => onTri("nom"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Catégorie"),
|
||||
onSort: (_, _) => onTri("categorie"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Marque / modèle"),
|
||||
onSort: (_, _) => onTri("marque"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("État"),
|
||||
onSort: (_, _) => onTri("etatGeneral"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Statut"),
|
||||
onSort: (_, _) => onTri("statut"),
|
||||
),
|
||||
],
|
||||
rows: items.map(_ligneTableau).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -3626,52 +3667,47 @@ class _VueAnomaliesTableau extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
border: Border.all(color: EnsupColors.line),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: largeurDisponible),
|
||||
child: DataTable(
|
||||
sortColumnIndex: _sortColumnIndex,
|
||||
sortAscending: ordre == "asc",
|
||||
headingRowColor: WidgetStatePropertyAll(
|
||||
EnsupColors.soft.withValues(alpha: 0.8),
|
||||
),
|
||||
headingTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: EnsupColors.text2,
|
||||
),
|
||||
dataTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
color: EnsupColors.text,
|
||||
),
|
||||
columns: [
|
||||
DataColumn(
|
||||
label: const Text("Détection"),
|
||||
onSort: (_, _) => onTri("dateDetection"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Anomalie"),
|
||||
onSort: (_, _) => onTri("type"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Matériel"),
|
||||
onSort: (_, _) => onTri("materiel"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Étudiant"),
|
||||
onSort: (_, _) => onTri("etudiant"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Statut"),
|
||||
onSort: (_, _) => onTri("statut"),
|
||||
),
|
||||
const DataColumn(label: Text("Action")),
|
||||
],
|
||||
rows: items.map(_ligneTableau).toList(),
|
||||
),
|
||||
child: _TableauAvecDefilementHorizontal(
|
||||
largeurMinimale: largeurDisponible,
|
||||
child: DataTable(
|
||||
sortColumnIndex: _sortColumnIndex,
|
||||
sortAscending: ordre == "asc",
|
||||
headingRowColor: WidgetStatePropertyAll(
|
||||
EnsupColors.soft.withValues(alpha: 0.8),
|
||||
),
|
||||
headingTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: EnsupColors.text2,
|
||||
),
|
||||
dataTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
color: EnsupColors.text,
|
||||
),
|
||||
columns: [
|
||||
DataColumn(
|
||||
label: const Text("Détection"),
|
||||
onSort: (_, _) => onTri("dateDetection"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Anomalie"),
|
||||
onSort: (_, _) => onTri("type"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Matériel"),
|
||||
onSort: (_, _) => onTri("materiel"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Étudiant"),
|
||||
onSort: (_, _) => onTri("etudiant"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Statut"),
|
||||
onSort: (_, _) => onTri("statut"),
|
||||
),
|
||||
const DataColumn(label: Text("Action")),
|
||||
],
|
||||
rows: items.map(_ligneTableau).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -4250,52 +4286,47 @@ class _VueHistoriqueTableau extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
border: Border.all(color: EnsupColors.line),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minWidth: largeurDisponible),
|
||||
child: DataTable(
|
||||
sortColumnIndex: _sortColumnIndex,
|
||||
sortAscending: ordre == "asc",
|
||||
headingRowColor: WidgetStatePropertyAll(
|
||||
EnsupColors.soft.withValues(alpha: 0.8),
|
||||
),
|
||||
headingTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: EnsupColors.text2,
|
||||
),
|
||||
dataTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
color: EnsupColors.text,
|
||||
),
|
||||
columns: [
|
||||
DataColumn(
|
||||
label: const Text("Date"),
|
||||
onSort: (_, _) => onTri("dateAction"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Action"),
|
||||
onSort: (_, _) => onTri("action"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Utilisateur"),
|
||||
onSort: (_, _) => onTri("utilisateur"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Matériel"),
|
||||
onSort: (_, _) => onTri("materiel"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Emprunt"),
|
||||
onSort: (_, _) => onTri("emprunt"),
|
||||
),
|
||||
const DataColumn(label: Text("Point d’opération")),
|
||||
],
|
||||
rows: items.map(_ligneTableau).toList(),
|
||||
),
|
||||
child: _TableauAvecDefilementHorizontal(
|
||||
largeurMinimale: largeurDisponible,
|
||||
child: DataTable(
|
||||
sortColumnIndex: _sortColumnIndex,
|
||||
sortAscending: ordre == "asc",
|
||||
headingRowColor: WidgetStatePropertyAll(
|
||||
EnsupColors.soft.withValues(alpha: 0.8),
|
||||
),
|
||||
headingTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: EnsupColors.text2,
|
||||
),
|
||||
dataTextStyle: GoogleFonts.titilliumWeb(
|
||||
fontSize: 12,
|
||||
color: EnsupColors.text,
|
||||
),
|
||||
columns: [
|
||||
DataColumn(
|
||||
label: const Text("Date"),
|
||||
onSort: (_, _) => onTri("dateAction"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Action"),
|
||||
onSort: (_, _) => onTri("action"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Utilisateur"),
|
||||
onSort: (_, _) => onTri("utilisateur"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Matériel"),
|
||||
onSort: (_, _) => onTri("materiel"),
|
||||
),
|
||||
DataColumn(
|
||||
label: const Text("Emprunt"),
|
||||
onSort: (_, _) => onTri("emprunt"),
|
||||
),
|
||||
const DataColumn(label: Text("Point d’opération")),
|
||||
],
|
||||
rows: items.map(_ligneTableau).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user