mirror of
https://github.com/salvadordeveloper/flutter-crypto-app.git
synced 2025-08-06 16:20:07 +08:00
18 lines
651 B
Dart
18 lines
651 B
Dart
import 'package:cryptocurrency_app/models/allowance/allowance.dart';
|
|
import 'package:cryptocurrency_app/models/graph/graph/graph.dart';
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'graph_response.freezed.dart';
|
|
|
|
@freezed
|
|
abstract class GraphResponse with _$GraphResponse {
|
|
const factory GraphResponse(
|
|
{required Graph result, required Allowance allowance}) = _GraphResponse;
|
|
|
|
factory GraphResponse.fromJson(Map<String, dynamic> json) {
|
|
final result = Graph.fromJson(json['result']);
|
|
final allowance = Allowance.fromJson(json['allowance']);
|
|
return GraphResponse(result: result, allowance: allowance);
|
|
}
|
|
}
|