mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 13:08:56 +03:30
2.2.0
This commit is contained in:
Regular → Executable
+35
-1
@@ -1,3 +1,4 @@
|
||||
import 'package:cssd/models/item_model.dart';
|
||||
import 'package:cssd/providers/packages.dart';
|
||||
import 'package:cssd/utils/scan.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -13,20 +14,29 @@ class AddItemBox extends StatelessWidget {
|
||||
required this.initialItemValue,
|
||||
required this.index,
|
||||
required this.text,
|
||||
// required this.scanUdi,
|
||||
this.iconColor,
|
||||
required this.filteredItems,
|
||||
required this.hasRemoveButton,
|
||||
}) : _deviceBlockSize = deviceBlockSize,
|
||||
super(key: key);
|
||||
|
||||
final double _deviceBlockSize;
|
||||
final TextEditingController values;
|
||||
// final List<Map<String, dynamic>> vals;
|
||||
final List<String> vals;
|
||||
|
||||
final String initialItemValue;
|
||||
final int index;
|
||||
final String text;
|
||||
final Color? iconColor;
|
||||
final bool hasRemoveButton;
|
||||
final List<ItemResultObject> filteredItems;
|
||||
// final String scanUdi;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool isEnabled = true;
|
||||
return Container(
|
||||
height: 150,
|
||||
child: Stack(
|
||||
@@ -125,6 +135,7 @@ class AddItemBox extends StatelessWidget {
|
||||
isDense: true,
|
||||
items: vals.map((val) {
|
||||
return new DropdownMenuItem<String>(
|
||||
enabled: isEnabled,
|
||||
value: val,
|
||||
child: Container(
|
||||
child: Text(
|
||||
@@ -158,7 +169,8 @@ class AddItemBox extends StatelessWidget {
|
||||
print(result);
|
||||
Provider.of<PackageProvider>(context,
|
||||
listen: false)
|
||||
.changeItemVal(result, index);
|
||||
.changeItemValByScan(result, index);
|
||||
isEnabled = false;
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -206,6 +218,28 @@ class AddItemBox extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (hasRemoveButton)
|
||||
Positioned(
|
||||
bottom: 15,
|
||||
right: 50,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Provider.of<PackageProvider>(context, listen: false)
|
||||
.removeItemVal();
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(3),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: iconColor,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.remove,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
+13
-18
@@ -1,5 +1,6 @@
|
||||
import 'package:cssd/config/colors.dart';
|
||||
import 'package:cssd/models/package_model.dart';
|
||||
import 'package:cssd/widgets/MyItemsScreens/Detail/transfer_destroy_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
@@ -9,11 +10,13 @@ class PackageDetailsDataBox extends StatelessWidget {
|
||||
Key? key,
|
||||
required this.datas,
|
||||
required double deviceBlockSize,
|
||||
required this.goToAddLabelPage,
|
||||
}) : _deviceBlockSize = deviceBlockSize,
|
||||
super(key: key);
|
||||
|
||||
final PackageDetailObject datas;
|
||||
final double _deviceBlockSize;
|
||||
final VoidCallback goToAddLabelPage;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -255,24 +258,16 @@ class PackageDetailsDataBox extends StatelessWidget {
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
// TransferDestroyButton(
|
||||
// deviceBlockSize: _deviceBlockSize,
|
||||
// firstColor: kPurple,
|
||||
// secondColor: kPurpleSub,
|
||||
// onTap: () {
|
||||
// Navigator.pushNamed(
|
||||
// context,
|
||||
// Routes.labelAddScreen,
|
||||
// arguments: {
|
||||
// 'id': datas.id,
|
||||
// },
|
||||
// );
|
||||
// },
|
||||
// text: 'Make a Label For Package',
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 5.0,
|
||||
// ),
|
||||
TransferDestroyButton(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
firstColor: kPurple,
|
||||
secondColor: kPurpleSub,
|
||||
onTap: goToAddLabelPage,
|
||||
text: 'Make a Label For Package',
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Reference in New Issue
Block a user