mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 16:58:56 +03:30
2.1.0
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:cssd/config/colors.dart';
|
||||
import 'package:cssd/models/package_model.dart';
|
||||
import 'package:cssd/providers/packages.dart';
|
||||
import 'package:cssd/widgets/PackageScreens/Add/add_item_box.dart';
|
||||
import 'package:cssd/widgets/PackageScreens/Add/package_save_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -9,7 +10,6 @@ import 'package:provider/provider.dart';
|
||||
|
||||
import '../../config/routes.dart';
|
||||
import '../../providers/connectivity.dart';
|
||||
import '../../widgets/CycleScreens/Add/add_label_box.dart';
|
||||
import '../../widgets/Global/internet_error.dart';
|
||||
|
||||
class PackageAddScreen extends StatefulWidget {
|
||||
@@ -21,7 +21,7 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
|
||||
final _packageUdiFocusNode = FocusNode();
|
||||
final _descriptionFocusNode = FocusNode();
|
||||
TextEditingController descriptionCTRL = new TextEditingController();
|
||||
TextEditingController udiCTRL = new TextEditingController();
|
||||
// TextEditingController udiCTRL = new TextEditingController();
|
||||
TextEditingController nameCTRL = new TextEditingController();
|
||||
TextEditingController dateCTRL = new TextEditingController();
|
||||
final _form = GlobalKey<FormState>();
|
||||
@@ -32,7 +32,7 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
descriptionCTRL.text = '';
|
||||
udiCTRL.text = '';
|
||||
// udiCTRL.text = '';
|
||||
nameCTRL.text = '';
|
||||
dateCTRL.text = DateFormat('y-M-d').format(DateTime.now());
|
||||
super.initState();
|
||||
@@ -152,43 +152,43 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (val) {
|
||||
if (val!.isEmpty) {
|
||||
return 'UDI required!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: udiCTRL,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.alignLeft,
|
||||
size: 7 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
isDense: true,
|
||||
labelText: 'UDI',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
focusNode: _packageUdiFocusNode,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(_descriptionFocusNode);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
// TextFormField(
|
||||
// validator: (val) {
|
||||
// if (val!.isEmpty) {
|
||||
// return 'UDI required!';
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// controller: udiCTRL,
|
||||
// decoration: InputDecoration(
|
||||
// icon: Icon(
|
||||
// FontAwesomeIcons.alignLeft,
|
||||
// size: 7 * _deviceBlockSize,
|
||||
// ),
|
||||
// labelStyle: TextStyle(
|
||||
// fontWeight: FontWeight.w100,
|
||||
// fontSize: 4 * _deviceBlockSize,
|
||||
// ),
|
||||
// isDense: true,
|
||||
// labelText: 'UDI',
|
||||
// contentPadding: EdgeInsets.symmetric(
|
||||
// vertical: 2, horizontal: 3),
|
||||
// ),
|
||||
// style: TextStyle(
|
||||
// fontWeight: FontWeight.w700,
|
||||
// fontSize: 5 * _deviceBlockSize,
|
||||
// ),
|
||||
// focusNode: _packageUdiFocusNode,
|
||||
// keyboardType: TextInputType.visiblePassword,
|
||||
// textInputAction: TextInputAction.next,
|
||||
// onFieldSubmitted: (_) {
|
||||
// FocusScope.of(context)
|
||||
// .requestFocus(_descriptionFocusNode);
|
||||
// },
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 20,
|
||||
// ),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 5),
|
||||
child: Text(
|
||||
@@ -205,14 +205,14 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
|
||||
ListView.builder(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (ctx, index) => AddLabelBox(
|
||||
itemBuilder: (ctx, index) => AddItemBox(
|
||||
text: 'Select Items Included',
|
||||
iconColor: kPurpleSub,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
values:
|
||||
packageProvider.itemValues[index],
|
||||
vals: packageProvider.itemVals,
|
||||
initialLabelValue:
|
||||
initialItemValue:
|
||||
packageProvider.initialItemValue,
|
||||
index: index,
|
||||
),
|
||||
@@ -258,7 +258,7 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
|
||||
listen: false,
|
||||
).itemValues,
|
||||
nameCTRL: nameCTRL,
|
||||
udiCTRL: udiCTRL,
|
||||
// udiCTRL: udiCTRL,
|
||||
dateValue: dateCTRL.text,
|
||||
descriptionCTRL: descriptionCTRL,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
|
||||
Reference in New Issue
Block a user