Skip to content

Commit

Permalink
修复一些ui问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wgh136 committed May 6, 2023
1 parent 8cf1414 commit ac64197
Show file tree
Hide file tree
Showing 10 changed files with 231 additions and 365 deletions.
6 changes: 3 additions & 3 deletions lib/views/jm_views/jm_comments_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:get/get.dart';
import 'package:pica_comic/jm_network/jm_models.dart';
import 'package:pica_comic/base.dart';
import 'package:pica_comic/views/jm_views/show_error.dart';
import 'package:pica_comic/views/test/comment.dart';
import 'package:pica_comic/views/widgets/comment.dart';
import 'package:pica_comic/views/widgets/list_loading.dart';
import 'package:pica_comic/views/widgets/side_bar.dart';
import '../widgets/widgets.dart' show showMessage;
Expand Down Expand Up @@ -184,7 +184,7 @@ void showReply(BuildContext context, List<Comment> comments, Comment replyTo) {
],
),
),
"回复",
title: "回复",
showBarrier: false);
}

Expand All @@ -195,5 +195,5 @@ void showComments(BuildContext context, String id) {
id,
popUp: true,
),
"评论");
title: "评论");
}
2 changes: 1 addition & 1 deletion lib/views/jm_views/jm_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class JmComicTile extends StatelessWidget {
Widget build(BuildContext context) {
var categories = "";
for(final category in comic.categories){
categories += category.name += " ";
categories += "${category.name} ";
}

return InkWell(
Expand Down
31 changes: 27 additions & 4 deletions lib/views/pic_views/comment_reply_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ class ReplyPage extends StatelessWidget {
Expanded(child: CustomScrollView(
slivers: [
SliverToBoxAdapter(
child: CommentTile(comment: replyTo, isReply: true, isToReply: true,),
child: CommentTile(
avatarUrl: replyTo.avatarUrl,
name: replyTo.name,
content: replyTo.text,
time: "${replyTo.time.substring(0,10)} ${replyTo.time.substring(11,19)}",
slogan: replyTo.slogan,
level: replyTo.level,
),
),
const SliverPadding(padding: EdgeInsets.all(2)),
const SliverToBoxAdapter(child: Padding(padding: EdgeInsets.symmetric(horizontal: 15),child: Divider(),),),
Expand All @@ -54,8 +61,24 @@ class ReplyPage extends StatelessWidget {
if(index==commentsPageLogic.comments.comments.length-1&&commentsPageLogic.comments.total!=commentsPageLogic.comments.loaded){
network.getMoreReply(commentsPageLogic.comments).then((t){commentsPageLogic.update();});
}
return CommentTile(comment: commentsPageLogic.comments.comments[index], isReply: true);

var comment = commentsPageLogic.comments.comments[index];
var subInfo = "${comment.time.substring(0,10)} ${comment.time.substring(11,19)}";
return CommentTile(
avatarUrl: comment.avatarUrl,
name: comment.name,
content: comment.text,
slogan: comment.slogan,
level: comment.level,
time: subInfo,
like: (){
network.likeOrUnlikeComment(comment.id);
comment.isLiked = ! comment.isLiked;
comment.isLiked?comment.likes++:comment.likes--;
commentsPageLogic.update();
},
likes: comment.likes,
liked: comment.isLiked,
);
}
)),
if(commentsPageLogic.comments.loaded!=commentsPageLogic.comments.total&&commentsPageLogic.comments.total!=1)
Expand Down Expand Up @@ -149,5 +172,5 @@ class ReplyPage extends StatelessWidget {
}

void showReply(BuildContext context, String id, Comment replyTo){
showSideBar(context, ReplyPage(id, replyTo, popUp: true,), "回复", showBarrier: false);
showSideBar(context, ReplyPage(id, replyTo, popUp: true,), title: "回复", showBarrier: false);
}
4 changes: 2 additions & 2 deletions lib/views/pic_views/comments_page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:pica_comic/base.dart';
import 'package:pica_comic/views/test/comment.dart';
import 'package:pica_comic/views/widgets/comment.dart';
import 'package:pica_comic/views/widgets/show_network_error.dart';
import 'package:pica_comic/views/widgets/widgets.dart';
import '../../network/models.dart';
Expand Down Expand Up @@ -165,5 +165,5 @@ class CommentsPage extends StatelessWidget {
}

void showComments(BuildContext context, String id){
showSideBar(context, CommentsPage(id, popUp: true,), "评论",);
showSideBar(context, CommentsPage(id, popUp: true,), title: "评论",);
}
2 changes: 1 addition & 1 deletion lib/views/reader/comic_reading_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class ComicReadingPage extends StatelessWidget {
//底部工具栏
buildBottomToolBar(logic, context, type != ReadingType.ehentai, () {
if (MediaQuery.of(context).size.width > 600) {
showSideBar(context, buildEpsView(), null, useSurfaceTintColor: true, width: 400);
showSideBar(context, buildEpsView(), title: null, useSurfaceTintColor: true, width: 400);
} else {
showModalBottomSheet(
context: context,
Expand Down
7 changes: 6 additions & 1 deletion lib/views/reader/eps_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ class _EpsViewState extends State<EpsView> {
IconButton(
icon: Icon(Icons.my_location_outlined, color: Theme.of(context).colorScheme.secondary,size: 23,),
onPressed: (){
controller.jumpTo(index: logic.order-1);
var length = type==ReadingType.picacg?eps.length-1:eps.length;
if(!value) {
controller.jumpTo(index: length - logic.order-1);
} else {
controller.jumpTo(index: length - logic.order);
}
},
),
const Text(" 倒序"),
Expand Down
146 changes: 0 additions & 146 deletions lib/views/test/comment.dart

This file was deleted.

Loading

0 comments on commit ac64197

Please sign in to comment.