-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: added internal preview class
- Loading branch information
1 parent
771fb6c
commit cd43854
Showing
13 changed files
with
155 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ib/catalog/widgets/screen/fab_widget.dart → ...alog/widgets/utils/bottom/fab_widget.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:catalog/src/base/serial.dart'; | ||
|
||
class InternalPreview implements Serial<InternalPreview> { | ||
final String id; | ||
final String path; | ||
final String description; | ||
final List<String> parameters; | ||
|
||
const InternalPreview({ | ||
this.id = '', | ||
this.path = '', | ||
this.description = '', | ||
this.parameters = const [], | ||
}); | ||
|
||
@override | ||
InternalPreview fromJson(Map<String, dynamic> json) => InternalPreview( | ||
id: json['id'] ?? '', | ||
path: json['path'] ?? '', | ||
description: json['description'] ?? '', | ||
parameters: Serial.listObjectFromBasicType<String>( | ||
json['parameters'] ?? [], | ||
), | ||
); | ||
|
||
@override | ||
String getId() => id; | ||
|
||
@override | ||
InternalPreview instance() => const InternalPreview(id: '', path: ''); | ||
|
||
@override | ||
Map<String, dynamic> toJson() => { | ||
'id': id, | ||
'path': path, | ||
'description': description, | ||
'parameters': parameters, | ||
}; | ||
|
||
@override | ||
InternalPreview fromString(String value) { | ||
Map<String, dynamic> map = jsonDecode(value); | ||
return fromJson(map); | ||
} | ||
|
||
@override | ||
String stringValue() { | ||
var map = toJson(); | ||
return jsonEncode(map); | ||
} | ||
|
||
InternalPreview copyWith({ | ||
String? id, | ||
String? path, | ||
String? description, | ||
List<String>? parameters, | ||
}) => | ||
InternalPreview( | ||
id: id ?? this.id, | ||
path: path ?? this.path, | ||
description: description ?? this.description, | ||
parameters: parameters ?? this.parameters, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters