🐛 [firebase_ui_firestore] FirestoreDataTable need polishing to only query the right amount of data
Maintainer antworten meist innerhalb von 6 Tagen
@rrousselGit arbeitet bereits daran.
Seit 03.10.2023.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Bug report
Describe the bug
After the code(bellow) the first item is more an discussion than a bub, but the point 2 and 3 seems to be bugs.
@override
Widget build(BuildContext context) {
return StreamBuilder(
stream: _query.snapshots(),
builder: (context, snapshot) {
return AggregateQueryBuilder(
query: _query.count(),
builder: (context, aggSsnapshot) {
return FirestoreQueryBuilder<Map<String, Object?>>(
query: _query,
builder: (context, snapshot, child) {
if (aggSsnapshot.hasData) {
source.setFromSnapshot(snapshot, aggSsnapshot.requireData);
} else {
source.setFromSnapshot(snapshot);
}
return AnimatedBuilder(
animation: source,
builder: (context, child) {
final actions = [
...?widget.actions,
if (widget.canDeleteItems &&
source._selectedRowIds.isNotEmpty)
IconButton(
icon: const Icon(Icons.delete),
onPressed: source.onDeleteSelectedItems,
),
];
return PaginatedDataTable(
source: source,
onSelectAll: selectionEnabled ? source.onSelectAll : null,
onPageChanged: widget.onPageChanged,
showCheckboxColumn: widget.showCheckboxColumn,
arrowHeadColor: widget.arrowHeadColor,
checkboxHorizontalMargin: widget.checkboxHorizontalMargin,
columnSpacing: widget.columnSpacing,
dataRowMaxHeight: widget.dataRowMaxHeight,
dataRowMinHeight: widget.dataRowMinHeight,
dragStartBehavior: widget.dragStartBehavior,
headingRowHeight: widget.headingRowHeight,
horizontalMargin: widget.horizontalMargin,
rowsPerPage: widget.rowsPerPage,
showFirstLastButtons: widget.showFirstLastButtons,
sortAscending: widget.sortAscending,
sortColumnIndex: widget.sortColumnIndex,
header: actions.isEmpty
? null
: (widget.header ?? const SizedBox()),
actions: actions.isEmpty ? null : actions,
columns: [
for (final head in widget.columnLabels.values)
DataColumn(label: head)
],
);
},
);
},
);
},
);
},
);
}
Couple os things:
-
Do we really want StreamBuilder at the first place?
Seems it only needed to make sure the AggregateQueryBuilder will return the right number of rows, if the data is changing on the query side....but this defeat the intent of limiting the data retrieved, we even make an extra query when we can use the docs.lenght to update the PaginatedDataTable bottom navigation information. -
I think the we need to pass to the FirestoreQueryBuilder to limit the snapshot to the number of rows we have in the page =>
pageSize: widget.rowsPerPage,otherwise if you allow the checkbox and select all items on the page (with let say 10 rows) you will get 20 item selected !!! -
With the addition of the _aggregateSnapshot I think the override of :
bool get isRowCountApproximate => _aggregateSnapshot?.count == null || (_previousSnapshot!.isFetching || _previousSnapshot!.hasMore);
maybe not right, because the intent of having AggregateQueryBuilder seems to have the exact number of rows, so the isRowCountApproximate can be always false. But we can argue the query can send more rows the next time tap on the next page...
- Vorherrschende Sprache
- Dart
- Sterne
- 152
- Forks
- 144
- Ø Merge
- 17 Std. 49 Min.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus firebase/FirebaseUI-Flutter
-
auth enhancement oauth
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
firebase/FirebaseUI-Flutter#734 ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Support material_ui packageEvtl. vergeben @Mastersam07 hat das vor 13 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
firebase/FirebaseUI-Flutter#729 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 6 Tagen
-
🐛 Support firebase_core 5.0.0Evtl. vergeben @Mastersam07 hat das vor 13 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
firebase/FirebaseUI-Flutter#727 · 4 Reaktionen · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 6 Tagen
-
auth blocked: customer response enhancement Keep Open
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
firebase/FirebaseUI-Flutter#418 · 7 Kommentare · 3 Reaktionen ·
Maintainer antworten meist innerhalb von 6 Tagen
-
auth Keep Open Needs Attention
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 20/100
firebase/FirebaseUI-Flutter#351 · 3 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 6 Tagen
Alle Issues in firebase/FirebaseUI-Flutter
Ähnliche Issues
-
bot-found bug priority: P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
madenvel/KalinkaPlayer#498 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
libnativeapi/nativeapi#21 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
chriskelly/wish-together#102 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
TomBursch/kitchenowl#1188 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
area/adaptivity kind/task priority/p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100