mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-10 19:28:56 +03:30
Fix label ui in label result
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user