|
@@ -2,42 +2,32 @@
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
-PropertyIoanState propertyIoanStateFromJson(String str) => PropertyIoanState.fromJson(json.decode(str));
|
|
|
-
|
|
|
-String propertyIoanStateToJson(PropertyIoanState data) => json.encode(data.toJson());
|
|
|
+import 'package:widgets/load_state_layout.dart';
|
|
|
|
|
|
class PropertyIoanState {
|
|
|
- PropertyIoanState({
|
|
|
- required this.offerTextInfoList,
|
|
|
- required this.lowestFloatingRate,
|
|
|
- required this.othersOfferingPic,
|
|
|
- required this.lowestFixedRate,
|
|
|
- required this.othersOfferingInfoList,
|
|
|
- });
|
|
|
-
|
|
|
- List<dynamic> offerTextInfoList;
|
|
|
- String lowestFloatingRate;
|
|
|
- String othersOfferingPic;
|
|
|
- String lowestFixedRate;
|
|
|
- List<dynamic> othersOfferingInfoList;
|
|
|
-
|
|
|
- factory PropertyIoanState.fromJson(Map<dynamic, dynamic> json) => PropertyIoanState(
|
|
|
- offerTextInfoList: List<dynamic>.from(json["offerTextInfoList"].map((x) => x)),
|
|
|
- lowestFloatingRate: json["lowestFloatingRate"],
|
|
|
- othersOfferingPic: json["othersOfferingPic"],
|
|
|
- lowestFixedRate: json["lowestFixedRate"],
|
|
|
- othersOfferingInfoList: List<dynamic>.from(json["othersOfferingInfoList"].map((x) => x)),
|
|
|
- );
|
|
|
+ //页面 LoadView 状态的展示
|
|
|
+ LoadState loadingState;
|
|
|
+ String? errorMessage;
|
|
|
|
|
|
- Map<dynamic, dynamic> toJson() => {
|
|
|
- "offerTextInfoList": List<dynamic>.from(offerTextInfoList.map((x) => x)),
|
|
|
- "lowestFloatingRate": lowestFloatingRate,
|
|
|
- "othersOfferingPic": othersOfferingPic,
|
|
|
- "lowestFixedRate": lowestFixedRate,
|
|
|
- "othersOfferingInfoList": List<dynamic>.from(othersOfferingInfoList.map((x) => x)),
|
|
|
- };
|
|
|
+ List<dynamic> offerTextInfoList;
|
|
|
+ String lowestFloatingRate;
|
|
|
+ String othersOfferingPic;
|
|
|
+ String lowestFixedRate;
|
|
|
+ List<dynamic> othersOfferingInfoList;
|
|
|
|
|
|
- PropertyIoanState copyWith({
|
|
|
+ PropertyIoanState({
|
|
|
+ this.loadingState = LoadState.State_Loading,
|
|
|
+ String? errorMessage,
|
|
|
+ required this.offerTextInfoList,
|
|
|
+ required this.lowestFloatingRate,
|
|
|
+ required this.othersOfferingPic,
|
|
|
+ required this.lowestFixedRate,
|
|
|
+ required this.othersOfferingInfoList,
|
|
|
+ });
|
|
|
+
|
|
|
+ PropertyIoanState copyWith({
|
|
|
+ LoadState? loadingState,
|
|
|
+ String? errorMessage,
|
|
|
List<dynamic>? offerTextInfoList,
|
|
|
String? lowestFloatingRate,
|
|
|
String? othersOfferingPic,
|
|
@@ -45,12 +35,37 @@ class PropertyIoanState {
|
|
|
List<dynamic>? othersOfferingInfoList,
|
|
|
}) {
|
|
|
return PropertyIoanState(
|
|
|
+ loadingState: loadingState ?? this.loadingState,
|
|
|
+ errorMessage: errorMessage ?? this.errorMessage,
|
|
|
offerTextInfoList: offerTextInfoList ?? this.offerTextInfoList,
|
|
|
lowestFloatingRate: lowestFloatingRate ?? this.lowestFloatingRate,
|
|
|
othersOfferingPic: othersOfferingPic ?? this.othersOfferingPic,
|
|
|
lowestFixedRate: lowestFixedRate ?? this.lowestFixedRate,
|
|
|
- othersOfferingInfoList:
|
|
|
- othersOfferingInfoList ?? this.othersOfferingInfoList,
|
|
|
+ othersOfferingInfoList: othersOfferingInfoList ?? this.othersOfferingInfoList,
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toMap() {
|
|
|
+ return {
|
|
|
+ 'loadingState': this.loadingState,
|
|
|
+ 'errorMessage': this.errorMessage,
|
|
|
+ 'offerTextInfoList': this.offerTextInfoList,
|
|
|
+ 'lowestFloatingRate': this.lowestFloatingRate,
|
|
|
+ 'othersOfferingPic': this.othersOfferingPic,
|
|
|
+ 'lowestFixedRate': this.lowestFixedRate,
|
|
|
+ 'othersOfferingInfoList': this.othersOfferingInfoList,
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ factory PropertyIoanState.fromMap(Map<String, dynamic> map) {
|
|
|
+ return PropertyIoanState(
|
|
|
+ loadingState: map['loadingState'] as LoadState,
|
|
|
+ errorMessage: map['errorMessage'] as String,
|
|
|
+ offerTextInfoList: map['offerTextInfoList'] as List<dynamic>,
|
|
|
+ lowestFloatingRate: map['lowestFloatingRate'] as String,
|
|
|
+ othersOfferingPic: map['othersOfferingPic'] as String,
|
|
|
+ lowestFixedRate: map['lowestFixedRate'] as String,
|
|
|
+ othersOfferingInfoList: map['othersOfferingInfoList'] as List<dynamic>,
|
|
|
);
|
|
|
}
|
|
|
}
|