Skip to content

Commit

Permalink
feat: Improved club stock management layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomtir committed Oct 6, 2024
1 parent 2c0e7ff commit 19fcad2
Showing 1 changed file with 52 additions and 37 deletions.
89 changes: 52 additions & 37 deletions lib/pages/StockManagementPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,45 +131,60 @@ class StockManagementPageState extends State<StockManagementPage> {
leading: Icon(Icons.refresh),
),
Divider(),
DataTable(
columns: [
DataColumn(label: Text("${AppLocalizations.of(context)!.stockItem}\n${AppLocalizations.of(context)!.stockStorage}")),
DataColumn(label: Text(AppLocalizations.of(context)!.stockOwned)),
DataColumn(label: Text(AppLocalizations.of(context)!.stockLoaned)),
],
rows: List<DataRow>.generate(_stocks.length, (index) {
return DataRow(
cells: <DataCell>[
DataCell(
ListTile(
title: Text(_stocks[index].item.name),
subtitle: Text(_stocks[index].storage),
leading: IconButton(
icon: Icon(Icons.edit),
onPressed: () => _handleEdit(_stocks[index]),
),
dense: true,
),
),
DataCell(Text("${_stocks[index].owned}")),
DataCell(
Row(
children: [
IconButton(
icon: Icon(Icons.list_alt_outlined),
onPressed: () => _viewLoans(_stocks[index]),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: SizedBox(
width: 550,
child: DataTable(
columnSpacing: 0,
columns: [
DataColumn(
label: Text(
"${AppLocalizations.of(context)!.stockItem}\n${AppLocalizations.of(context)!.stockStorage}")),
DataColumn(label: Text(AppLocalizations.of(context)!.stockOwned)),
DataColumn(label: Text(AppLocalizations.of(context)!.stockLoaned)),
],
rows: List<DataRow>.generate(_stocks.length, (index) {
return DataRow(
cells: <DataCell>[
DataCell(
Row(
children: [
IconButton(
icon: Icon(Icons.edit),
onPressed: () => _handleEdit(_stocks[index]),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_stocks[index].item.name, style: TextStyle(fontWeight: FontWeight.bold)),
Text(_stocks[index].storage, style: Theme.of(context).textTheme.labelSmall),
],
),
],
),
Text("${_stocks[index].loaned}"),
IconButton(
icon: Icon(Icons.arrow_forward),
onPressed: () => _handleLoan(_stocks[index]),
),
DataCell(Text("${_stocks[index].owned}")),
DataCell(
Row(
children: [
IconButton(
icon: Icon(Icons.list_alt_outlined),
onPressed: () => _viewLoans(_stocks[index]),
),
Text("${_stocks[index].loaned}"),
IconButton(
icon: Icon(Icons.arrow_forward),
onPressed: () => _handleLoan(_stocks[index]),
),
],
),
],
),
)
],
);
}),
)
],
);
}),
),
),
),
Divider(),
AppButton(
Expand Down

0 comments on commit 19fcad2

Please sign in to comment.