Skip to content

Commit

Permalink
v6.0
Browse files Browse the repository at this point in the history
* 使用google-GFSegmentTab,将导航分为:体系,常用网站,公众号三个Tab部分
* 使用google-Stick-header,构建体系页面
* 导航-体系/常用网站/公众号完成
  • Loading branch information
PGzxc committed Jun 4, 2022
1 parent 2d7ce81 commit 8486ccd
Show file tree
Hide file tree
Showing 43 changed files with 1,491 additions and 533 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
* 首页文章显示
* 使用三方库webview_flutter,显示网页视图
* 使用三方库badges。显示bottombar带消息的数量,并通过num控制badges的显示与否
### v6.0
* 使用google-GFSegmentTab,将导航分为:体系,常用网站,公众号三个Tab部分
* 使用google-Stick-header,构建体系页面
* 导航-体系/常用网站/公众号完成


## 五 使用的指令
Expand Down
12 changes: 6 additions & 6 deletions lib/models/home_article_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class HomeArticleData extends Object {
int? curPage;

@JsonKey(name: 'datas')
List<HomeArticle>? datas;
List<Article>? datas;

@JsonKey(name: 'offset')
int? offset;
Expand Down Expand Up @@ -67,7 +67,7 @@ class HomeArticleData extends Object {
}

@JsonSerializable()
class HomeArticle extends Object {
class Article extends Object {
@JsonKey(name: 'apkLink')
String? apkLink;

Expand Down Expand Up @@ -167,12 +167,12 @@ class HomeArticle extends Object {
@JsonKey(name: 'zan')
int? zan;

HomeArticle();
Article();

factory HomeArticle.fromJson(Map<String, dynamic> srcJson) =>
_$HomeArticleFromJson(srcJson);
factory Article.fromJson(Map<String, dynamic> srcJson) =>
_$ArticleFromJson(srcJson);

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

}

Expand Down
7 changes: 3 additions & 4 deletions lib/models/home_article_response.g.dart

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

286 changes: 162 additions & 124 deletions lib/models/navigation_response.dart
Original file line number Diff line number Diff line change
@@ -1,155 +1,193 @@
import 'package:json_annotation/json_annotation.dart';

part 'navigation_response.g.dart';
import 'home_article_response.dart';

part 'navigation_response.g.dart';

///3.1 导航数据
@JsonSerializable()
class NavigationResponse extends Object {

@JsonKey(name: 'data')
List<Data> data;
List<NavigatorData> data;

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

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

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

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

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

}


@JsonSerializable()
class Data extends Object {

class NavigatorData extends Object {
@JsonKey(name: 'articles')
List<Articles> articles;
List<Article>? articles;

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

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

Data(this.articles,this.cid,this.name,);

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

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

NavigatorData(
{
this.articles,
this.cid,
this.name,
}
);

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

@JsonSerializable()
class Articles extends Object {

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

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

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

@JsonKey(name: 'canEdit')
bool canEdit;

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

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

@JsonKey(name: 'collect')
bool collect;

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

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

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

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

@JsonKey(name: 'fresh')
bool fresh;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@JsonKey(name: 'tags')
List<dynamic> tags;

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

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

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

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

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

Articles(this.apkLink,this.audit,this.author,this.canEdit,this.chapterId,this.chapterName,this.collect,this.courseId,this.desc,this.descMd,this.envelopePic,this.fresh,this.host,this.id,this.link,this.niceDate,this.niceShareDate,this.origin,this.prefix,this.projectLink,this.publishTime,this.realSuperChapterId,this.selfVisible,this.shareUser,this.superChapterId,this.superChapterName,this.tags,this.title,this.type,this.userId,this.visible,this.zan,);

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

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

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


// @JsonSerializable()
// class Article extends Object {
// @JsonKey(name: 'apkLink')
// String? apkLink;
//
// @JsonKey(name: 'audit')
// int? audit;
//
// @JsonKey(name: 'author')
// String? author;
//
// @JsonKey(name: 'canEdit')
// bool? canEdit;
//
// @JsonKey(name: 'chapterId')
// int? chapterId;
//
// @JsonKey(name: 'chapterName')
// String? chapterName;
//
// @JsonKey(name: 'collect')
// bool? collect;
//
// @JsonKey(name: 'courseId')
// int? courseId;
//
// @JsonKey(name: 'desc')
// String? desc;
//
// @JsonKey(name: 'descMd')
// String? descMd;
//
// @JsonKey(name: 'envelopePic')
// String? envelopePic;
//
// @JsonKey(name: 'fresh')
// bool? fresh;
//
// @JsonKey(name: 'host')
// String? host;
//
// @JsonKey(name: 'id')
// int? id;
//
// @JsonKey(name: 'link')
// String? link;
//
// @JsonKey(name: 'niceDate')
// String? niceDate;
//
// @JsonKey(name: 'niceShareDate')
// String? niceShareDate;
//
// @JsonKey(name: 'origin')
// String? origin;
//
// @JsonKey(name: 'prefix')
// String? prefix;
//
// @JsonKey(name: 'projectLink')
// String? projectLink;
//
// @JsonKey(name: 'publishTime')
// int? publishTime;
//
// @JsonKey(name: 'realSuperChapterId')
// int? realSuperChapterId;
//
// @JsonKey(name: 'selfVisible')
// int? selfVisible;
//
// @JsonKey(name: 'shareUser')
// String? shareUser;
//
// @JsonKey(name: 'superChapterId')
// int? superChapterId;
//
// @JsonKey(name: 'superChapterName')
// String? superChapterName;
//
// @JsonKey(name: 'tags')
// List<dynamic>? tags;
//
// @JsonKey(name: 'title')
// String? title;
//
// @JsonKey(name: 'type')
// int? type;
//
// @JsonKey(name: 'userId')
// int? userId;
//
// @JsonKey(name: 'visible')
// int? visible;
//
// @JsonKey(name: 'zan')
// int? zan;
//
// Article({
// this.apkLink,
// this.audit,
// this.author,
// this.canEdit,
// this.chapterId,
// this.chapterName,
// this.collect,
// this.courseId,
// this.desc,
// this.descMd,
// this.envelopePic,
// this.fresh,
// this.host,
// this.id,
// this.link,
// this.niceDate,
// this.niceShareDate,
// this.origin,
// this.prefix,
// this.projectLink,
// this.publishTime,
// this.realSuperChapterId,
// this.selfVisible,
// this.shareUser,
// this.superChapterId,
// this.superChapterName,
// this.tags,
// this.title,
// this.type,
// this.userId,
// this.visible,
// this.zan,
// });
//
// factory Article.fromJson(Map<String, dynamic> srcJson) =>
// _$ArticleFromJson(srcJson);
//
// Map<String, dynamic> toJson() => _$ArticleToJson(this);
// }
Loading

0 comments on commit 8486ccd

Please sign in to comment.