Added Streams to TourRepository
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import 'package:hl_lieferservice/dto/image_note_response.dart';
|
||||
|
||||
import 'article.dart';
|
||||
import 'contact_person.dart';
|
||||
import 'customer.dart';
|
||||
@ -73,7 +75,7 @@ class DeliveryDTO {
|
||||
DiscountDTO? discount;
|
||||
PaymentMethodDTO payment;
|
||||
List<NoteDTO> notes;
|
||||
List<ImageDTO> images;
|
||||
List<ImageNoteDTO> images;
|
||||
List<DeliveryOptionDTO> options;
|
||||
|
||||
factory DeliveryDTO.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@ -45,7 +45,7 @@ DeliveryDTO _$DeliveryDTOFromJson(Map<String, dynamic> json) => DeliveryDTO(
|
||||
totalGrossValue: json['total_gross_value'] as String,
|
||||
images:
|
||||
(json['images'] as List<dynamic>)
|
||||
.map((e) => ImageDTO.fromJson(e as Map<String, dynamic>))
|
||||
.map((e) => ImageNoteDTO.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
customer: CustomerDTO.fromJson(json['customer'] as Map<String, dynamic>),
|
||||
finishedTime: json['finished_time'] as String,
|
||||
|
||||
18
lib/dto/image_note_response.dart
Normal file
18
lib/dto/image_note_response.dart
Normal file
@ -0,0 +1,18 @@
|
||||
import 'note.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'image_note_response.g.dart';
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class ImageNoteDTO {
|
||||
final String url;
|
||||
final String oid;
|
||||
final String name;
|
||||
|
||||
ImageNoteDTO({required this.url, required this.oid, required this.name});
|
||||
|
||||
factory ImageNoteDTO.fromJson(Map<String, dynamic> json) =>
|
||||
_$ImageNoteDTOFromJson(json);
|
||||
|
||||
Map<dynamic, dynamic> toJson() => _$ImageNoteDTOToJson(this);
|
||||
}
|
||||
20
lib/dto/image_note_response.g.dart
Normal file
20
lib/dto/image_note_response.g.dart
Normal file
@ -0,0 +1,20 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'image_note_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ImageNoteDTO _$ImageNoteDTOFromJson(Map<String, dynamic> json) => ImageNoteDTO(
|
||||
url: json['url'] as String,
|
||||
oid: json['oid'] as String,
|
||||
name: json['name'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ImageNoteDTOToJson(ImageNoteDTO instance) =>
|
||||
<String, dynamic>{
|
||||
'url': instance.url,
|
||||
'oid': instance.oid,
|
||||
'name': instance.name,
|
||||
};
|
||||
@ -1,3 +1,5 @@
|
||||
import 'package:hl_lieferservice/dto/image_note_response.dart';
|
||||
|
||||
import 'note.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
@ -6,9 +8,10 @@ part 'note_get_response.g.dart';
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class NoteGetResponseDTO {
|
||||
NoteGetResponseDTO(
|
||||
{required this.notes, required this.succeeded, required this.message});
|
||||
{required this.notes, required this.succeeded, required this.message, required this.images});
|
||||
|
||||
final List<NoteDTO> notes;
|
||||
final List<ImageNoteDTO> images;
|
||||
final bool succeeded;
|
||||
final String message;
|
||||
|
||||
|
||||
@ -14,11 +14,16 @@ NoteGetResponseDTO _$NoteGetResponseDTOFromJson(Map<String, dynamic> json) =>
|
||||
.toList(),
|
||||
succeeded: json['succeeded'] as bool,
|
||||
message: json['message'] as String,
|
||||
images:
|
||||
(json['images'] as List<dynamic>)
|
||||
.map((e) => ImageNoteDTO.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$NoteGetResponseDTOToJson(NoteGetResponseDTO instance) =>
|
||||
<String, dynamic>{
|
||||
'notes': instance.notes,
|
||||
'images': instance.images,
|
||||
'succeeded': instance.succeeded,
|
||||
'message': instance.message,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user