buildStaticGridView method
Implementation
@protected
Widget buildStaticGridView(BuildParameters params) {
final spec = params.spec;
final props = spec.props;
final children = <Widget>[];
if (params.widgets["children"] != null) {
for (Map childSpec in params.widgets["children"] as List<Map>) {
children.add(builder.buildWidget(
params.context, childSpec, params.state, params.parentContext));
}
}
return GridView.count(
key: Lowder.properties.getKey(params.id),
crossAxisCount: spec.buildProp("crossAxisCount") ?? 1,
mainAxisSpacing: parseDouble(props["mainAxisSpacing"]),
crossAxisSpacing: parseDouble(props["crossAxisSpacing"]),
childAspectRatio:
parseDouble(props["childAspectRatio"], defaultValue: 1.0),
scrollDirection: spec.buildProp("scrollDirection") ?? Axis.vertical,
reverse: parseBool(props["reverse"]),
shrinkWrap: parseBool(props["shrinkWrap"]),
padding: spec.buildProp("padding"),
primary: tryParseBool(props["primary"]),
keyboardDismissBehavior: params.buildProp("keyboardDismissBehavior") ??
ScrollViewKeyboardDismissBehavior.manual,
semanticChildCount: children.length,
children: children,
);
}