Skip to content

Commit

Permalink
v7.0
Browse files Browse the repository at this point in the history
* 使用google-GFSegmentTab,将导航分为:未读消息和已读消息两个部分
* 填充:未读消息和已读消息列表
* 在BaseController中根据用户是否已经登陆请求数据接口,展示消息数据
* 将MessageControlLer中读取未读消息的数据,移动到未读消息控制器中,在数据请求到同时调用此接口
  • Loading branch information
PGzxc committed Jun 5, 2022
1 parent 8486ccd commit 5fbf102
Show file tree
Hide file tree
Showing 24 changed files with 1,033 additions and 226 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
* 使用google-GFSegmentTab,将导航分为:体系,常用网站,公众号三个Tab部分
* 使用google-Stick-header,构建体系页面
* 导航-体系/常用网站/公众号完成
### v7.0
* 使用google-GFSegmentTab,将导航分为:未读消息和已读消息两个部分
* 填充:未读消息和已读消息列表
* 在BaseController中根据用户是否已经登陆请求数据接口,展示消息数据
* 将MessageControlLer中读取未读消息的数据,移动到未读消息控制器中,在数据请求到同时调用此接口



## 五 使用的指令
Expand All @@ -78,6 +84,11 @@ flutter build apk --split-per-abi
* pull_to_refresh:https://pub.flutter-io.cn/packages/pull_to_refresh
* lottie:https://pub.flutter-io.cn/packages/lottie
* sprintf:https://pub.flutter-io.cn/packages/sprintf
* shimmer:https://pub.flutter-io.cn/packages/shimmer
* cached_network_image:https://pub.flutter-io.cn/packages/cached_network_image
* flutter_html:https://pub.flutter-io.cn/packages/webview_flutter
* webview_flutter:https://pub.flutter-io.cn/packages/webview_flutter
* badges:https://pub.flutter-io.cn/packages/badges



Expand Down
85 changes: 52 additions & 33 deletions lib/models/message_read_list_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,68 @@ part 'message_read_list_response.g.dart';
@JsonSerializable()
class MessageReadListResponse extends Object {

@JsonKey(name: 'data')
Data data;
MessageData data;

@JsonKey(name: 'errorCode')
int errorCode;

@JsonKey(name: 'errorMsg')
String errorMsg;

MessageReadListResponse(this.data,this.errorCode,this.errorMsg,);
MessageReadListResponse(
this.data,
this.errorCode,
this.errorMsg,
);

factory MessageReadListResponse.fromJson(Map<String, dynamic> srcJson) => _$MessageReadListResponseFromJson(srcJson);
factory MessageReadListResponse.fromJson(Map<String, dynamic> srcJson) =>
_$MessageReadListResponseFromJson(srcJson);

Map<String, dynamic> toJson() => _$MessageReadListResponseToJson(this);

}


@JsonSerializable()
class Data extends Object {

class MessageData extends Object {
@JsonKey(name: 'curPage')
int curPage;
int? curPage;

@JsonKey(name: 'datas')
List<Datas> datas;
List<Message>? datas;

@JsonKey(name: 'offset')
int offset;
int? offset;

@JsonKey(name: 'over')
bool over;
bool? over;

@JsonKey(name: 'pageCount')
int pageCount;
int? pageCount;

@JsonKey(name: 'size')
int size;
int? size;

@JsonKey(name: 'total')
int total;

Data(this.curPage,this.datas,this.offset,this.over,this.pageCount,this.size,this.total,);

factory Data.fromJson(Map<String, dynamic> srcJson) => _$DataFromJson(srcJson);

Map<String, dynamic> toJson() => _$DataToJson(this);

int? total;

MessageData({
this.curPage,
this.datas,
this.offset,
this.over,
this.pageCount,
this.size,
this.total,
});

factory MessageData.fromJson(Map<String, dynamic> srcJson) =>
_$MessageDataFromJson(srcJson);

Map<String, dynamic> toJson() => _$MessageDataToJson(this);
}


@JsonSerializable()
class Datas extends Object {

class Message extends Object {
@JsonKey(name: 'category')
int category;

Expand Down Expand Up @@ -100,12 +107,24 @@ class Datas extends Object {
@JsonKey(name: 'userId')
int userId;

Datas(this.category,this.date,this.fromUser,this.fromUserId,this.fullLink,this.id,this.isRead,this.link,this.message,this.niceDate,this.tag,this.title,this.userId,);

factory Datas.fromJson(Map<String, dynamic> srcJson) => _$DatasFromJson(srcJson);

Map<String, dynamic> toJson() => _$DatasToJson(this);

Message(
this.category,
this.date,
this.fromUser,
this.fromUserId,
this.fullLink,
this.id,
this.isRead,
this.link,
this.message,
this.niceDate,
this.tag,
this.title,
this.userId,
);

factory Message.fromJson(Map<String, dynamic> srcJson) =>
_$MessageFromJson(srcJson);

Map<String, dynamic> toJson() => _$MessageToJson(this);
}


27 changes: 14 additions & 13 deletions lib/models/message_read_list_response.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 57 additions & 56 deletions lib/models/message_unread_list_response.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter_wanandroid/models/message_read_list_response.dart';
import 'package:json_annotation/json_annotation.dart';

part 'message_unread_list_response.g.dart';
Expand All @@ -8,7 +9,7 @@ part 'message_unread_list_response.g.dart';
class MessageUnReadListResponse extends Object {

@JsonKey(name: 'data')
Data data;
MessageUnreadData data;

@JsonKey(name: 'errorCode')
int errorCode;
Expand All @@ -26,13 +27,13 @@ class MessageUnReadListResponse extends Object {


@JsonSerializable()
class Data extends Object {
class MessageUnreadData extends Object {

@JsonKey(name: 'curPage')
int curPage;

@JsonKey(name: 'datas')
List<Datas> datas;
List<Message> datas;

@JsonKey(name: 'offset')
int offset;
Expand All @@ -49,63 +50,63 @@ class Data extends Object {
@JsonKey(name: 'total')
int total;

Data(this.curPage,this.datas,this.offset,this.over,this.pageCount,this.size,this.total,);
MessageUnreadData(this.curPage,this.datas,this.offset,this.over,this.pageCount,this.size,this.total,);

factory Data.fromJson(Map<String, dynamic> srcJson) => _$DataFromJson(srcJson);
factory MessageUnreadData.fromJson(Map<String, dynamic> srcJson) => _$MessageUnreadDataFromJson(srcJson);

Map<String, dynamic> toJson() => _$DataToJson(this);
Map<String, dynamic> toJson() => _$MessageUnreadDataToJson(this);

}


@JsonSerializable()
class Datas extends Object {

@JsonKey(name: 'category')
int category;

@JsonKey(name: 'date')
int date;

@JsonKey(name: 'fromUser')
String fromUser;

@JsonKey(name: 'fromUserId')
int fromUserId;

@JsonKey(name: 'fullLink')
String fullLink;

@JsonKey(name: 'id')
int id;

@JsonKey(name: 'isRead')
int isRead;

@JsonKey(name: 'link')
String link;

@JsonKey(name: 'message')
String message;

@JsonKey(name: 'niceDate')
String niceDate;

@JsonKey(name: 'tag')
String tag;

@JsonKey(name: 'title')
String title;

@JsonKey(name: 'userId')
int userId;

Datas(this.category,this.date,this.fromUser,this.fromUserId,this.fullLink,this.id,this.isRead,this.link,this.message,this.niceDate,this.tag,this.title,this.userId,);

factory Datas.fromJson(Map<String, dynamic> srcJson) => _$DatasFromJson(srcJson);

Map<String, dynamic> toJson() => _$DatasToJson(this);

}
//
// @JsonSerializable()
// class Datas extends Object {
//
// @JsonKey(name: 'category')
// int category;
//
// @JsonKey(name: 'date')
// int date;
//
// @JsonKey(name: 'fromUser')
// String fromUser;
//
// @JsonKey(name: 'fromUserId')
// int fromUserId;
//
// @JsonKey(name: 'fullLink')
// String fullLink;
//
// @JsonKey(name: 'id')
// int id;
//
// @JsonKey(name: 'isRead')
// int isRead;
//
// @JsonKey(name: 'link')
// String link;
//
// @JsonKey(name: 'message')
// String message;
//
// @JsonKey(name: 'niceDate')
// String niceDate;
//
// @JsonKey(name: 'tag')
// String tag;
//
// @JsonKey(name: 'title')
// String title;
//
// @JsonKey(name: 'userId')
// int userId;
//
// Datas(this.category,this.date,this.fromUser,this.fromUserId,this.fullLink,this.id,this.isRead,this.link,this.message,this.niceDate,this.tag,this.title,this.userId,);
//
// factory Datas.fromJson(Map<String, dynamic> srcJson) => _$DatasFromJson(srcJson);
//
// Map<String, dynamic> toJson() => _$DatasToJson(this);
//
// }


Loading

0 comments on commit 5fbf102

Please sign in to comment.