fix barcode scanning
This commit is contained in:
@@ -9,9 +9,9 @@ void main() {
|
||||
Config(
|
||||
flavor: Flavor.DEV,
|
||||
color: Colors.blue,
|
||||
reportURL: "http://192.168.43.88:8080",
|
||||
reportURL: "http://192.168.100.11:8080",
|
||||
reportProjectID: "fcs-dev",
|
||||
apiURL: "http://192.168.43.88:7777",
|
||||
apiURL: "http://192.168.100.11:7777",
|
||||
level: Level.ALL);
|
||||
runApp(App());
|
||||
}
|
||||
|
||||
@@ -286,7 +286,6 @@ class _HomePageState extends State<HomePage> {
|
||||
Navigator.of(context).push(BottomUpPageRoute(DeliverList())));
|
||||
|
||||
List<Widget> widgets = [];
|
||||
widgets.add(faqBtn);
|
||||
if (user != null) {
|
||||
// true ? widgets.add(pickUpBtn) : "";
|
||||
!customer ? widgets.add(fcsShipmentBtn) : "";
|
||||
@@ -302,6 +301,7 @@ class _HomePageState extends State<HomePage> {
|
||||
// true ? widgets.add(invoicesBtn) : "";
|
||||
// true ? widgets.add(discountBtn) : "";
|
||||
}
|
||||
widgets.add(faqBtn);
|
||||
return OfflineRedirect(
|
||||
child: FlavorBanner(
|
||||
child: Scaffold(
|
||||
@@ -383,17 +383,14 @@ class _HomePageState extends State<HomePage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ListView(children: [
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: widgets,
|
||||
),
|
||||
]),
|
||||
),
|
||||
Column(children: [
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: widgets,
|
||||
),
|
||||
]),
|
||||
BottomWidgets(),
|
||||
],
|
||||
))),
|
||||
@@ -411,8 +408,4 @@ class _HomePageState extends State<HomePage> {
|
||||
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 {
|
||||
String barcode = await BarcodeScanner.scan();
|
||||
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(() {
|
||||
_transcationIDCtl.text = barcode;
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:fcs/domain/entities/package.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/package_list_row.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
@@ -136,8 +136,24 @@ class PackageSearchDelegate extends SearchDelegate<Package> {
|
||||
}
|
||||
|
||||
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();
|
||||
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;
|
||||
showResults(context);
|
||||
}
|
||||
|
||||
@@ -163,6 +163,12 @@ class _ReceivingNewState extends State<ReceivingNew> {
|
||||
try {
|
||||
String barcode = await BarcodeScanner.scan();
|
||||
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(() {
|
||||
_transcationIDCtl.text = barcode;
|
||||
});
|
||||
|
||||
@@ -22,8 +22,8 @@ class TaskButton extends StatelessWidget {
|
||||
onTap: btnCallback != null ? btnCallback : () => {},
|
||||
child: Container(
|
||||
width: 120,
|
||||
height: 140,
|
||||
padding: EdgeInsets.only(top: 10.0, left: 5, right: 5),
|
||||
height: 170,
|
||||
padding: EdgeInsets.only(top: 0.0, left: 5, right: 5),
|
||||
decoration: new BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: new BorderRadius.only(
|
||||
@@ -36,9 +36,9 @@ class TaskButton extends StatelessWidget {
|
||||
child: Material(
|
||||
color: Colors.black54, // button color
|
||||
child: SizedBox(
|
||||
width: 60,
|
||||
height: 60,
|
||||
child: Icon(icon, color: Colors.white, size: 30)),
|
||||
width: 100,
|
||||
height: 100,
|
||||
child: Icon(icon, color: Colors.white, size: 50)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
||||
Reference in New Issue
Block a user