🐛 [firebase_ui_firestore] FirestoreDataTable need polishing to only query the right amount of data
Maintainer thường phản hồi trong vòng 2 ngày
@rrousselGit đang làm issue này rồi.
Từ ngày 3/10/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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...
- Ngôn ngữ chính
- Dart
- Star
- 152
- Fork
- 141
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/FirebaseUI-Flutter
-
auth blocked: customer response enhancement Keep Open
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
firebase/FirebaseUI-Flutter#418 · 7 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
auth Keep Open Needs Attention
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
firebase/FirebaseUI-Flutter#351 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement Keep Open storage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
firebase/FirebaseUI-Flutter#290 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
auth bug Keep Open Needs Attention
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
firebase/FirebaseUI-Flutter#261 · 6 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
auth blocked: customer response bug Keep Open
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
firebase/FirebaseUI-Flutter#253 · 21 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của firebase/FirebaseUI-Flutter
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
immich-app/immich#31955 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
fluttercommunity/plus_plugins#3994 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Smart charging: USB charger re-assert is starved during BLE scans, so the tablet never dischargesĐang mởbug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
decentespresso/decaid#931 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
flame-engine/flame#4067 ·
Maintainer thường phản hồi trong vòng 1 ngày