fix ui
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:barcode_scan/model/scan_result.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/product_model.dart';
|
||||
@@ -26,49 +27,6 @@ class _BarcodeScreenPageState extends State<BarcodeScreenPage> {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
Widget showProducts(BuildContext context, ProductModel productModel) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
FontAwesomeIcons.tag,
|
||||
color: primaryColor,
|
||||
size: 20,
|
||||
),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
new Flexible(
|
||||
child: Container(
|
||||
width: 170.0,
|
||||
child: DropdownButton<String>(
|
||||
// value: currentProductID,
|
||||
isExpanded: true,
|
||||
hint: Text(
|
||||
'Select Product',
|
||||
style: labelStyle,
|
||||
),
|
||||
onChanged: changedProduct,
|
||||
items: productModel.products
|
||||
.map<DropdownMenuItem<String>>((Product product) {
|
||||
return new DropdownMenuItem<String>(
|
||||
value: product.id,
|
||||
child: new Text(product.name, style: textStyle),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
void changedProduct(selected) {
|
||||
setState(() {
|
||||
// currentProductID = selected;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LocalProgress(
|
||||
@@ -82,9 +40,24 @@ class _BarcodeScreenPageState extends State<BarcodeScreenPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
RaisedButton(
|
||||
child: Icon(Icons.scanner),
|
||||
onPressed: () async {
|
||||
InkWell(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"Scan : ",
|
||||
style: TextStyle(
|
||||
color: primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
Icon(
|
||||
Ionicons.ios_qr_scanner,
|
||||
size: 50,
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () async {
|
||||
await scan();
|
||||
},
|
||||
)
|
||||
@@ -98,15 +71,4 @@ class _BarcodeScreenPageState extends State<BarcodeScreenPage> {
|
||||
print("ScanResult => $result");
|
||||
setState(() => scanResult = result);
|
||||
}
|
||||
|
||||
// _save() {
|
||||
// if (currentProductID == null) return;
|
||||
// this.buyerProduct.productID = currentProductID;
|
||||
// var productName =
|
||||
// Provider.of<ProductModel>(context).getProductName(currentProductID);
|
||||
// this.buyerProduct.productName = productName;
|
||||
// this.buyerProduct.storageCapacityQty = int.parse(_storage.text);
|
||||
// this.buyerProduct.dailySaleQty = int.parse(_sales.text);
|
||||
// Navigator.pop<BuyerProduct>(context, this.buyerProduct);
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user