diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index d5ca3dbc..31d832ec 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -31,7 +31,6 @@ class _CommunityChildPage extends State { @override void initState() { super.initState(); - _onRefresh(); } @@ -69,6 +68,7 @@ class _CommunityChildPage extends State { comments.clear(); } comments.addAll(baseData.data.list); + // comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); print("comments: ${comments.length}"); if (int.tryParse(baseData.data.total) < (pageNum * 10)) { refreshController.loadNoData(); diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index c2c69020..fb99eef5 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -16,7 +16,6 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/comment_menu.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/tips_dialog.dart'; -import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:huixiang/web/web_view/input_comment.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -150,7 +149,7 @@ class _CommunityDetails extends State this.height = height + MediaQuery.of(context).padding.top + kToolbarHeight + - 68; + 24; setState(() {}); }, ), @@ -230,7 +229,7 @@ class _CommunityDetails extends State Container( width: double.infinity, alignment: Alignment.topCenter, - margin: EdgeInsets.only(top: 20), + margin: EdgeInsets.only(top:40), padding: EdgeInsets.all(22.h), child: Text( S.of(context).zanwupinglun, diff --git a/lib/community/community_page.dart b/lib/community/community_page.dart index b6c679e0..1d8a41f0 100644 --- a/lib/community/community_page.dart +++ b/lib/community/community_page.dart @@ -36,10 +36,14 @@ class _CommunityPage extends State } _toRelease() async { + int tmpIndex = tabcontroller.index; + setState(() { + tabcontroller.index = (tabcontroller.index == lables.length -1)?0:tabcontroller.index+1; + }); var result = await Navigator.of(context).pushNamed('/router/release_dynamic'); - if (result != null && result) { - setState(() {}); - } + setState(() { + tabcontroller.index = tmpIndex; + }); } @override diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index e320dd8c..0c7e9c06 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -257,7 +257,7 @@ class _CommunityDynamic extends State { subjectInfo.images[0], fit: BoxFit.cover, width: MediaQuery.of(context).size.width / 2, - height: MediaQuery.of(context).size.width / 2, + height: MediaQuery.of(context).size.width /1, errorSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png", ), @@ -279,7 +279,7 @@ class _CommunityDynamic extends State { itemBuilder: (context, position) { return Container( child: MImage( - subjectInfo.images[0], + subjectInfo.images[position], fit: BoxFit.cover, aspectRatio: 1, errorSrc: "assets/image/default_2_1.png", @@ -295,7 +295,7 @@ class _CommunityDynamic extends State { subjectInfo.video != "") { widget = Container( width: MediaQuery.of(context).size.width - 32, - height: MediaQuery.of(context).size.width / 2, + height: MediaQuery.of(context).size.width /2, color: Colors.blue.withAlpha(123), ); } diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 19146dc1..144a6ac6 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -155,6 +155,7 @@ class _ReleaseDynamic extends State { if (baseData.isSuccess) { SmartDialog.showToast("发布成功!"); Future.delayed(Duration(seconds: 1), () { + Navigator.of(context).pop(true); }); }