Fix label ui in label result

This commit is contained in:
hanie.khodkari
2025-04-28 21:19:04 +03:30
parent 8cc70f9934
commit bb1adc81ec
4 changed files with 54 additions and 23 deletions
+3 -3
View File
@@ -3,19 +3,19 @@ import 'package:equatable/equatable.dart';
class LabelResultObject extends Equatable {
final String id;
final String package;
final String packageName;
final String packageId;
final String expireDate;
LabelResultObject({
required this.id,
required this.package,
required this.packageName,
required this.packageId,
required this.expireDate,
});
@override
List<Object> get props => [id, package, packageId, expireDate];
List<Object> get props => [id, packageName, packageId, expireDate];
@override
bool get stringify => true;
+2 -2
View File
@@ -227,7 +227,7 @@ class LabelsProvider extends ChangeNotifier {
items = [];
searchBoxValue = value;
originalItems!.forEach((result) {
if (result.id.toString().contains(searchBoxValue)) {
if (result.packageName.toString().contains(searchBoxValue)) {
items!.add(result);
}
});
@@ -272,7 +272,7 @@ class LabelsProvider extends ChangeNotifier {
LabelResultObject(
expireDate: item['expire_date'],
id: item['id'].toString(),
package: item['package'] != null
packageName: item['package'] != null
? item['package']['name'].toString()
: ' ',
packageId:
+48 -17
View File
@@ -1,7 +1,6 @@
import 'package:cssd/providers/auth.dart';
import 'package:cssd/providers/labels.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import '../../../config/colors.dart';
@@ -55,30 +54,41 @@ class LabelItemBox extends StatelessWidget {
Container(
width: 30 * _deviceBlockSize,
child: Text(
item!.id,
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
color: Colors.grey,
),
),
),
Container(
width: 40 * _deviceBlockSize,
child: Text(
item!.package,
item!.packageName,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 3 * _deviceBlockSize,
fontWeight: FontWeight.w400,
fontSize: 4 * _deviceBlockSize,
),
),
),
Container(
width: 30 * _deviceBlockSize,
width: 50 * _deviceBlockSize,
child: Row(
children: <Widget>[
children: [
Text(
'Exp:',
"ID: ",
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
color: Colors.grey,
),
),
Text(
item!.id,
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
color: Colors.black87,
),
),
Text(
" | ",
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
color: Colors.grey,
),
),
Text(
'Expire: ',
style: TextStyle(
color: Colors.grey,
fontSize: 3 * _deviceBlockSize,
@@ -89,6 +99,27 @@ class LabelItemBox extends StatelessWidget {
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
),
)
],
),
),
Container(
width: 30 * _deviceBlockSize,
child: Row(
children: [
Text(
"package ID:: ",
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
color: Colors.grey,
),
),
Text(
item!.packageId,
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
color: Colors.black87,
),
),
],
),
@@ -34,7 +34,7 @@ class LabelSearchBox extends StatelessWidget {
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Search by label ID',
labelText: 'Search by package name',
isDense: true,
contentPadding: EdgeInsets.symmetric(vertical: 2, horizontal: 3),
),