mirror of
https://github.com/Uuttssaavv/flutter-clean-architecture-riverpod.git
synced 2025-08-06 16:19:42 +08:00
20 lines
517 B
Dart
20 lines
517 B
Dart
import 'package:dartz/dartz.dart';
|
|
import 'package:flutter_project/shared/exceptions/http_exception.dart';
|
|
|
|
class Response {
|
|
final int statusCode;
|
|
final String? statusMessage;
|
|
final dynamic data;
|
|
|
|
Response(
|
|
{required this.statusCode, this.statusMessage, this.data = const {}});
|
|
@override
|
|
String toString() {
|
|
return 'statusCode=$statusCode\nstatusMessage=$statusMessage\n data=$data';
|
|
}
|
|
}
|
|
|
|
extension ResponseExtension on Response {
|
|
Right<AppException, Response> get toRight => Right(this);
|
|
}
|