Frontend first draft

This commit is contained in:
Arseni
2025-11-13 15:06:15 +03:00
parent e47f343afb
commit ddb54ddfdc
504 changed files with 25498 additions and 1 deletions

View File

@@ -0,0 +1,43 @@
import 'package:json_annotation/json_annotation.dart';
part 'server.g.dart';
@JsonSerializable()
class ErrorResponse implements Exception {
final int code;
final String details;
final String source;
final String error;
const ErrorResponse({
required this.code,
required this.details,
required this.error,
required this.source,
});
@override
String toString() {
final buffer = StringBuffer('Error response (code: $code');
if (details.isNotEmpty) {
buffer.write(', details: $details');
}
if (error.isNotEmpty) {
buffer.write(', error: $error');
}
if (source.isNotEmpty) {
buffer.write(', source: $source');
}
buffer.write(')');
return buffer.toString();
}
factory ErrorResponse.fromJson(Map<String, dynamic> json) => _$ErrorResponseFromJson(json);
Map<String, dynamic> toJson() => _$ErrorResponseToJson(this);
}