Ajout inventaire

This commit is contained in:
Gabriel
2023-06-01 12:27:32 +02:00
parent bc9ffeda59
commit f9d37e6831

View File

@@ -113,23 +113,50 @@ class ShipPage extends StatelessWidget {
),
),
Card(
color: Colors.white,
child: Align(
alignment: Alignment.topLeft,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Cargo: ${ship.cargo?.units ?? 'N/A'} / ${ship.cargo?.capacity ?? 'N/A'}',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
],
),
),
color: Colors.white,
child: Align(
alignment: Alignment.topLeft,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Cargo: ${ship.cargo?.units ?? 'N/A'} / ${ship.cargo?.capacity ?? 'N/A'}',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
ElevatedButton(
onPressed: () {
},
child: Text('Markets'),
),
],
),
SizedBox(height: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: ship.cargo?.inventory?.map((item) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'${item.name ?? 'N/A'} - ${item.units ?? 'N/A'}',
style: TextStyle(
fontSize: 16,
),
),
Divider(), // Add a line separator between each item
],
);
}).toList() ?? [],
),
],
),
),
),
],
),