mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 02:28:54 +03:30
commit
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class FilterScanSaveButton extends StatelessWidget {
|
||||
const FilterScanSaveButton({
|
||||
@@ -7,7 +7,9 @@ class FilterScanSaveButton extends StatelessWidget {
|
||||
@required GlobalKey<FormState> form,
|
||||
@required this.idCTRL,
|
||||
@required double deviceBlockSize,
|
||||
}) : _form = form, _deviceBlockSize = deviceBlockSize, super(key: key);
|
||||
}) : _form = form,
|
||||
_deviceBlockSize = deviceBlockSize,
|
||||
super(key: key);
|
||||
|
||||
final GlobalKey<FormState> _form;
|
||||
final TextEditingController idCTRL;
|
||||
@@ -17,20 +19,23 @@ class FilterScanSaveButton extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
if (! _form.currentState.validate()) {
|
||||
if (!_form.currentState.validate()) {
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).pushNamed(
|
||||
Routes.labelDetailScreen,
|
||||
arguments: idCTRL.text,
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/Label/${idCTRL.text}',
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// Routes.labelDetailScreen,
|
||||
// arguments: idCTRL.text,
|
||||
// );
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
margin: EdgeInsets.symmetric(horizontal: 20),
|
||||
margin: EdgeInsets.only(bottom: 50,left: 20,right: 20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:barcode_scan/barcode_scan.dart';
|
||||
import 'package:cssd/config/routes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class LabelScanBox extends StatelessWidget {
|
||||
const LabelScanBox({
|
||||
@@ -24,9 +24,8 @@ class LabelScanBox extends StatelessWidget {
|
||||
return 'null';
|
||||
}
|
||||
} on PlatformException catch (_) {
|
||||
return 'access';
|
||||
}
|
||||
catch (_){
|
||||
return 'access';
|
||||
} catch (_) {
|
||||
return 'error';
|
||||
}
|
||||
|
||||
@@ -70,15 +69,16 @@ class LabelScanBox extends StatelessWidget {
|
||||
print('cancel');
|
||||
} else if (result == 'error') {
|
||||
print('error');
|
||||
}
|
||||
else if(result == 'access'){
|
||||
} else if (result == 'access') {
|
||||
print('access');
|
||||
}
|
||||
else {
|
||||
Navigator.of(context).pushNamed(
|
||||
Routes.labelDetailScreen,
|
||||
arguments: result,
|
||||
} else {
|
||||
launch(
|
||||
'https://cssd-doc.com/Show/Label/$result',
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// Routes.labelDetailScreen,
|
||||
// arguments: result,
|
||||
// );
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user