mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 20:18: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 {
|
class LabelResultObject extends Equatable {
|
||||||
final String id;
|
final String id;
|
||||||
final String package;
|
final String packageName;
|
||||||
final String packageId;
|
final String packageId;
|
||||||
final String expireDate;
|
final String expireDate;
|
||||||
|
|
||||||
LabelResultObject({
|
LabelResultObject({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.package,
|
required this.packageName,
|
||||||
required this.packageId,
|
required this.packageId,
|
||||||
required this.expireDate,
|
required this.expireDate,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [id, package, packageId, expireDate];
|
List<Object> get props => [id, packageName, packageId, expireDate];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool get stringify => true;
|
bool get stringify => true;
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ class LabelsProvider extends ChangeNotifier {
|
|||||||
items = [];
|
items = [];
|
||||||
searchBoxValue = value;
|
searchBoxValue = value;
|
||||||
originalItems!.forEach((result) {
|
originalItems!.forEach((result) {
|
||||||
if (result.id.toString().contains(searchBoxValue)) {
|
if (result.packageName.toString().contains(searchBoxValue)) {
|
||||||
items!.add(result);
|
items!.add(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -272,7 +272,7 @@ class LabelsProvider extends ChangeNotifier {
|
|||||||
LabelResultObject(
|
LabelResultObject(
|
||||||
expireDate: item['expire_date'],
|
expireDate: item['expire_date'],
|
||||||
id: item['id'].toString(),
|
id: item['id'].toString(),
|
||||||
package: item['package'] != null
|
packageName: item['package'] != null
|
||||||
? item['package']['name'].toString()
|
? item['package']['name'].toString()
|
||||||
: ' ',
|
: ' ',
|
||||||
packageId:
|
packageId:
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:cssd/providers/auth.dart';
|
import 'package:cssd/providers/auth.dart';
|
||||||
import 'package:cssd/providers/labels.dart';
|
import 'package:cssd/providers/labels.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../../../config/colors.dart';
|
import '../../../config/colors.dart';
|
||||||
@@ -55,30 +54,41 @@ class LabelItemBox extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: 30 * _deviceBlockSize,
|
width: 30 * _deviceBlockSize,
|
||||||
child: Text(
|
child: Text(
|
||||||
item!.id,
|
item!.packageName,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontSize: 4 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 50 * _deviceBlockSize,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"ID: ",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 3 * _deviceBlockSize,
|
fontSize: 3 * _deviceBlockSize,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Container(
|
|
||||||
width: 40 * _deviceBlockSize,
|
|
||||||
child: Text(
|
|
||||||
item!.package,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
fontSize: 3 * _deviceBlockSize,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
width: 30 * _deviceBlockSize,
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
Text(
|
||||||
'Exp:',
|
item!.id,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 3 * _deviceBlockSize,
|
||||||
|
color: Colors.black87,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
" | ",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 3 * _deviceBlockSize,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Expire: ',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
fontSize: 3 * _deviceBlockSize,
|
fontSize: 3 * _deviceBlockSize,
|
||||||
@@ -89,6 +99,27 @@ class LabelItemBox extends StatelessWidget {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 3 * _deviceBlockSize,
|
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,
|
fontWeight: FontWeight.w100,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
fontSize: 4 * _deviceBlockSize,
|
||||||
),
|
),
|
||||||
labelText: 'Search by label ID',
|
labelText: 'Search by package name',
|
||||||
isDense: true,
|
isDense: true,
|
||||||
contentPadding: EdgeInsets.symmetric(vertical: 2, horizontal: 3),
|
contentPadding: EdgeInsets.symmetric(vertical: 2, horizontal: 3),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user