added tag model assignment ui

This commit is contained in:
hannathkadher
2025-01-05 19:56:39 +04:00
parent e44c3ae796
commit 5bd257ee56
3 changed files with 181 additions and 61 deletions

View File

@ -1,29 +1,20 @@
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/product_model.dart';
class TagModel {
final String uuid;
final DateTime createdAt;
final DateTime updatedAt;
final String tag;
final bool disabled;
String? uuid;
String tag;
final ProductModel? product;
TagModel({
required this.uuid,
required this.createdAt,
required this.updatedAt,
this.uuid,
required this.tag,
required this.disabled,
this.product,
});
factory TagModel.fromJson(Map<String, dynamic> json) {
return TagModel(
uuid: json['uuid'] ?? '',
createdAt: DateTime.parse(json['createdAt']),
updatedAt: DateTime.parse(json['updatedAt']),
tag: json['tag'] ?? '',
disabled: json['disabled'] ?? false,
product: json['product'] != null
? ProductModel.fromMap(json['product'])
: null,
@ -33,10 +24,7 @@ class TagModel {
Map<String, dynamic> toJson() {
return {
'uuid': uuid,
'createdAt': createdAt.toIso8601String(),
'updatedAt': updatedAt.toIso8601String(),
'tag': tag,
'disabled': disabled,
'product': product?.toMap(),
};
}