mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-10 22:38:55 +03:30
105 lines
3.6 KiB
Dart
Executable File
105 lines
3.6 KiB
Dart
Executable File
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import '../../config/routes.dart';
|
|
import '../../providers/connectivity.dart';
|
|
import '../../widgets/Global/internet_error.dart';
|
|
import '../../widgets/LabelScreens/Scan/input_box.dart';
|
|
import '../../widgets/LabelScreens/Scan/save_button.dart';
|
|
import '../../widgets/LabelScreens/Scan/scan_box.dart';
|
|
|
|
// import 'package:flutter/services.dart';
|
|
// import 'package:barcode_scan2/barcode_scan2.dart';
|
|
|
|
class LabelScanScreen extends StatefulWidget {
|
|
// static const route = '/LabelScanScreen';
|
|
@override
|
|
State<StatefulWidget> createState() {
|
|
return _LabelScanScreenState();
|
|
}
|
|
}
|
|
|
|
class _LabelScanScreenState extends State<LabelScanScreen> {
|
|
String testCode = "";
|
|
TextEditingController idCTRL = new TextEditingController();
|
|
final _form = GlobalKey<FormState>();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final _media = MediaQuery.of(context);
|
|
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
|
final double _devicewidth = _media.size.width;
|
|
final double _deviceBlockSize = _devicewidth / 100;
|
|
return SafeArea(
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
FocusManager.instance.primaryFocus?.unfocus();
|
|
},
|
|
child: Scaffold(
|
|
appBar: AppBar(
|
|
titleSpacing: -10,
|
|
title: Text(
|
|
'Labels',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
backgroundColor: Colors.black,
|
|
leading: IconButton(
|
|
icon: Icon(
|
|
Icons.keyboard_arrow_left,
|
|
color: Colors.white,
|
|
size: 35,
|
|
),
|
|
onPressed: () => Navigator.of(context).pop(),
|
|
),
|
|
),
|
|
body: Consumer<ConnectivityProvider>(
|
|
builder: (ct, connection, _) {
|
|
return connection.conStatus != 'offline'
|
|
? ListView(
|
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
|
children: <Widget>[
|
|
Container(
|
|
padding: EdgeInsets.only(top: 30),
|
|
child: Text(
|
|
'Looking for a Label?',
|
|
textAlign: TextAlign.left,
|
|
style: TextStyle(
|
|
color: Colors.black,
|
|
fontSize: 5.5 * _deviceBlockSize,
|
|
fontWeight: FontWeight.w700,
|
|
letterSpacing: 3,
|
|
),
|
|
),
|
|
),
|
|
LabelScanBox(),
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
Form(
|
|
key: _form,
|
|
child: LabelScanInputBox(
|
|
idCTRL: idCTRL,
|
|
deviceBlockSize: _deviceBlockSize,
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 70,
|
|
),
|
|
FilterScanSaveButton(
|
|
form: _form,
|
|
idCTRL: idCTRL,
|
|
deviceBlockSize: _deviceBlockSize,
|
|
),
|
|
],
|
|
)
|
|
: ConnectionErrorBox();
|
|
},
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|