fix barcode scanning
This commit is contained in:
@@ -9,9 +9,9 @@ void main() {
|
|||||||
Config(
|
Config(
|
||||||
flavor: Flavor.DEV,
|
flavor: Flavor.DEV,
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
reportURL: "http://192.168.43.88:8080",
|
reportURL: "http://192.168.100.11:8080",
|
||||||
reportProjectID: "fcs-dev",
|
reportProjectID: "fcs-dev",
|
||||||
apiURL: "http://192.168.43.88:7777",
|
apiURL: "http://192.168.100.11:7777",
|
||||||
level: Level.ALL);
|
level: Level.ALL);
|
||||||
runApp(App());
|
runApp(App());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -286,7 +286,6 @@ class _HomePageState extends State<HomePage> {
|
|||||||
Navigator.of(context).push(BottomUpPageRoute(DeliverList())));
|
Navigator.of(context).push(BottomUpPageRoute(DeliverList())));
|
||||||
|
|
||||||
List<Widget> widgets = [];
|
List<Widget> widgets = [];
|
||||||
widgets.add(faqBtn);
|
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
// true ? widgets.add(pickUpBtn) : "";
|
// true ? widgets.add(pickUpBtn) : "";
|
||||||
!customer ? widgets.add(fcsShipmentBtn) : "";
|
!customer ? widgets.add(fcsShipmentBtn) : "";
|
||||||
@@ -302,6 +301,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
// true ? widgets.add(invoicesBtn) : "";
|
// true ? widgets.add(invoicesBtn) : "";
|
||||||
// true ? widgets.add(discountBtn) : "";
|
// true ? widgets.add(discountBtn) : "";
|
||||||
}
|
}
|
||||||
|
widgets.add(faqBtn);
|
||||||
return OfflineRedirect(
|
return OfflineRedirect(
|
||||||
child: FlavorBanner(
|
child: FlavorBanner(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
@@ -383,17 +383,14 @@ class _HomePageState extends State<HomePage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: ListView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Column(children: [
|
||||||
child: ListView(children: [
|
|
||||||
Wrap(
|
Wrap(
|
||||||
alignment: WrapAlignment.center,
|
alignment: WrapAlignment.center,
|
||||||
children: widgets,
|
children: widgets,
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
),
|
|
||||||
BottomWidgets(),
|
BottomWidgets(),
|
||||||
],
|
],
|
||||||
))),
|
))),
|
||||||
@@ -411,8 +408,4 @@ class _HomePageState extends State<HomePage> {
|
|||||||
isSelected[index] = !isSelected[index];
|
isSelected[index] = !isSelected[index];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Widget _buildBtn(String title, {IconData icon, BtnCallback btnCallback}) {
|
|
||||||
// return TaskButton(titleKey: title, icon: icon, btnCallback: btnCallback);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,6 +165,11 @@ class _TrackingIDPageState extends State<TrackingIDPage> {
|
|||||||
try {
|
try {
|
||||||
String barcode = await BarcodeScanner.scan();
|
String barcode = await BarcodeScanner.scan();
|
||||||
if (barcode != null) {
|
if (barcode != null) {
|
||||||
|
String gs = String.fromCharCode(29);
|
||||||
|
if (barcode.contains(gs)) {
|
||||||
|
var codes = barcode.split(gs);
|
||||||
|
barcode = codes.length >= 2 ? codes[1] : barcode;
|
||||||
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
_transcationIDCtl.text = barcode;
|
_transcationIDCtl.text = barcode;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import 'package:barcode_scan/barcode_scan.dart';
|
import 'package:barcode_scan/barcode_scan.dart';
|
||||||
import 'package:fcs/domain/entities/package.dart';
|
import 'package:fcs/domain/entities/package.dart';
|
||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
|
import 'package:fcs/pages/main/util.dart';
|
||||||
import 'package:fcs/pages/package/model/package_model.dart';
|
import 'package:fcs/pages/package/model/package_model.dart';
|
||||||
import 'package:fcs/pages/package/package_list_row.dart';
|
import 'package:fcs/pages/package/package_list_row.dart';
|
||||||
import 'package:fcs/pages/main/util.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_icons/flutter_icons.dart';
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
@@ -136,8 +136,24 @@ class PackageSearchDelegate extends SearchDelegate<Package> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// PickedFile pickedFile =
|
||||||
|
// await ImagePicker().getImage(source: ImageSource.camera);
|
||||||
|
// FirebaseVisionImage visionImage =
|
||||||
|
// FirebaseVisionImage.fromFile(File(pickedFile.path));
|
||||||
|
// final BarcodeDetector barcodeDetector =
|
||||||
|
// FirebaseVision.instance.barcodeDetector();
|
||||||
|
// final List<Barcode> barcodes =
|
||||||
|
// await barcodeDetector.detectInImage(visionImage);
|
||||||
|
// Barcode bc = barcodes.firstWhere((element) => true);
|
||||||
|
// String barcode;
|
||||||
|
// if (bc != null) barcode = bc.rawValue;
|
||||||
String barcode = await BarcodeScanner.scan();
|
String barcode = await BarcodeScanner.scan();
|
||||||
if (barcode != null) {
|
if (barcode != null) {
|
||||||
|
String gs = String.fromCharCode(29);
|
||||||
|
if (barcode.contains(gs)) {
|
||||||
|
var codes = barcode.split(gs);
|
||||||
|
barcode = codes.length >= 2 ? codes[1] : barcode;
|
||||||
|
}
|
||||||
query = barcode;
|
query = barcode;
|
||||||
showResults(context);
|
showResults(context);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,12 @@ class _ReceivingNewState extends State<ReceivingNew> {
|
|||||||
try {
|
try {
|
||||||
String barcode = await BarcodeScanner.scan();
|
String barcode = await BarcodeScanner.scan();
|
||||||
if (barcode != null) {
|
if (barcode != null) {
|
||||||
|
String gs = String.fromCharCode(29);
|
||||||
|
if (barcode.contains(gs)) {
|
||||||
|
var codes = barcode.split(gs);
|
||||||
|
barcode = codes.length >= 2 ? codes[1] : barcode;
|
||||||
|
}
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_transcationIDCtl.text = barcode;
|
_transcationIDCtl.text = barcode;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ class TaskButton extends StatelessWidget {
|
|||||||
onTap: btnCallback != null ? btnCallback : () => {},
|
onTap: btnCallback != null ? btnCallback : () => {},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 120,
|
width: 120,
|
||||||
height: 140,
|
height: 170,
|
||||||
padding: EdgeInsets.only(top: 10.0, left: 5, right: 5),
|
padding: EdgeInsets.only(top: 0.0, left: 5, right: 5),
|
||||||
decoration: new BoxDecoration(
|
decoration: new BoxDecoration(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
borderRadius: new BorderRadius.only(
|
borderRadius: new BorderRadius.only(
|
||||||
@@ -36,9 +36,9 @@ class TaskButton extends StatelessWidget {
|
|||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.black54, // button color
|
color: Colors.black54, // button color
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 60,
|
width: 100,
|
||||||
height: 60,
|
height: 100,
|
||||||
child: Icon(icon, color: Colors.white, size: 30)),
|
child: Icon(icon, color: Colors.white, size: 50)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
Reference in New Issue
Block a user