Skip to content

Commit

Permalink
fixes review/2
Browse files Browse the repository at this point in the history
  • Loading branch information
D3bi7 committed Jul 5, 2024
1 parent 73e328c commit 1c440cb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 30 deletions.
4 changes: 3 additions & 1 deletion lib/barcode_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ class BarcodeDetailPage extends StatelessWidget {
),
);
}
}
}


1 change: 1 addition & 0 deletions lib/barcode_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ class BarcodeItem {
type: Barcode.ean13()),
];
}

3 changes: 2 additions & 1 deletion lib/barcode_item_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ class BarcodeItemWidget extends StatelessWidget {
],
);
}
}
}

45 changes: 18 additions & 27 deletions lib/barcodes_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,26 @@ class BarcodesListView extends StatelessWidget {
Widget _buildBarcodeRow(BuildContext context, BarcodeItem leftBarcode, BarcodeItem? rightBarcode) {
return Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BarcodeDetailPage(barcode: leftBarcode),
),
);
},
child: BarcodeItemWidget(barcode: leftBarcode),
),
),
_buildBarcodeItem(context, leftBarcode),
const SizedBox(width: 10),
if (rightBarcode != null)
Expanded(
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BarcodeDetailPage(barcode: rightBarcode),
),
);
},
child: BarcodeItemWidget(barcode: rightBarcode),
),
),
if (rightBarcode != null) _buildBarcodeItem(context, rightBarcode),
],
);
}

Widget _buildBarcodeItem(BuildContext context, BarcodeItem barcode) {
return Expanded(
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BarcodeDetailPage(barcode: barcode),
),
);
},
child: BarcodeItemWidget(barcode: barcode),
),
);
}
}
3 changes: 2 additions & 1 deletion lib/barcodes_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ class BarcodesPanelState extends State<BarcodesPanel> {
),
);
}
}
}

0 comments on commit 1c440cb

Please sign in to comment.