Skip to content

Commit 0c3aeea

Browse files
committed
Add firebase queries support for grid view.
1 parent 06c7ede commit 0c3aeea

File tree

2 files changed

+49
-15
lines changed

2 files changed

+49
-15
lines changed

lib/src/api/nodes/grid_view_node.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ part 'grid_view_node.g.dart';
1212
/// in Flutter for more details.
1313
@JsonSerializable()
1414
class GridViewNode extends SinglePlaceholderNode
15-
with ScrollableMixin, CustomPropertiesMixin, ClipMixin {
15+
with ScrollableMixin, CustomPropertiesMixin, ClipMixin, QueryableMixin {
1616
@override
1717
final String type = 'gridView';
1818

@@ -51,6 +51,14 @@ class GridViewNode extends SinglePlaceholderNode
5151
super.variables,
5252
super.multipleVariables,
5353
bool clipsContent = true,
54+
55+
// [CloudDatabaseMixin] properties.
56+
bool useCloudDatabase = false,
57+
String? collectionPath,
58+
int? limit = 20,
59+
List<WhereQueryFilter>? whereOperations,
60+
List<OrderByQueryFilter>? orderByFilters,
61+
5462
// [ScrollableMixin] properties.
5563
AxisC scrollDirection = AxisC.vertical,
5664
bool reverse = false,
@@ -80,6 +88,14 @@ class GridViewNode extends SinglePlaceholderNode
8088
useFlutterListView: false,
8189
shouldAlwaysScroll: shouldAlwaysScroll,
8290
);
91+
92+
setQueryableMixin(
93+
useCloudDatabase: useCloudDatabase,
94+
collectionPath: collectionPath,
95+
limit: limit,
96+
whereFilters: whereOperations ?? [],
97+
orderByFilters: orderByFilters ?? [],
98+
);
8399
}
84100

85101
/// Calculates the fixed main axis extent of any child in the grid.

lib/src/api/nodes/grid_view_node.g.dart

Lines changed: 32 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)