Your question isn't clear as of what you want to exactly achieve, but to access list inside list , you can refer this ,
class PointOfService {
final String name;
final List<Order> orders;
PointOfService({this.name, this.orders});
}
class Order {
final String name;
Order({this.name});
}
void main() {
List<PointOfService> pointofServices = [
PointOfService(
name: "PointOfService 1",
orders: [
Order(name: "Order 1"),
Order(name: "Order 2"),
]),
PointOfService(
name: "PointOfService 2",
orders: [
Order(name: "Order 3"),
Order(name: "Order 4"),
])
];
for (var pointOfService in pointofServices) {
print("PointOfService name: ${pointOfService.name}");
for (var order in pointOfService.orders) {
print("Order name: ${order.name}");
}
}
}
This will output
PointOfService name: PointOfService 1
Order name: Order 1
Order name: Order 2
PointOfService name: PointOfService 2
Order name: Order 3
Order name: Order 4
Edit
For GridView you can do something like:
FutureBuilder<List<PointOfService>>(
future: < Your future here >
builder: (context, snapshot) {
if (snapshot.hasData) {
return GridView.builder(
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 200,
childAspectRatio: 3 / 2,
crossAxisSpacing: 20,
mainAxisSpacing: 20),
itemCount: snapshot.data.pointOfServices.length,
itemBuilder: (context, index) {
Order order = snapshot.data!.pointOfServices[index];
return Column(
children:[
Text(order['name']),// You can access this way
);
);
}),
} else {
return Text("No data");
}
},
)