|
@@ -1,12 +1,19 @@
|
|
|
|
|
|
import 'package:cs_resources/generated/assets.dart';
|
|
import 'package:cs_resources/generated/assets.dart';
|
|
|
|
+import 'package:cs_resources/theme/app_colors_theme.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
+import 'package:flutter/material.dart';
|
|
|
|
+import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
|
|
import 'package:plugin_platform/engine/toast/toast_engine.dart';
|
|
import 'package:plugin_platform/engine/toast/toast_engine.dart';
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
|
|
+import 'package:shared/utils/color_utils.dart';
|
|
import 'package:shared/utils/log_utils.dart';
|
|
import 'package:shared/utils/log_utils.dart';
|
|
import 'package:widgets/load_state_layout.dart';
|
|
import 'package:widgets/load_state_layout.dart';
|
|
|
|
+import 'package:widgets/my_text_view.dart';
|
|
import 'package:widgets/widget_export.dart';
|
|
import 'package:widgets/widget_export.dart';
|
|
|
|
+import '../../../components/comments_dialog.dart';
|
|
|
|
|
|
|
|
+import 'comments_input.dart';
|
|
import 'newsfeed_detail_state.dart';
|
|
import 'newsfeed_detail_state.dart';
|
|
import 'newsfeed_detail_page.dart';
|
|
import 'newsfeed_detail_page.dart';
|
|
|
|
|
|
@@ -14,6 +21,17 @@ part 'newsfeed_detail_vm.g.dart';
|
|
|
|
|
|
@riverpod
|
|
@riverpod
|
|
class NewsfeedDetailVm extends _$NewsfeedDetailVm {
|
|
class NewsfeedDetailVm extends _$NewsfeedDetailVm {
|
|
|
|
+
|
|
|
|
+ // 评论框信息
|
|
|
|
+ final Map<String, dynamic> _textFieldInfo= {
|
|
|
|
+ 'value': '',
|
|
|
|
+ 'controller': TextEditingController(),
|
|
|
|
+ 'hintText': 'What\'s on your mind?',
|
|
|
|
+ 'focusNode': FocusNode(),
|
|
|
|
+ 'obsecure': false,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
bool _needShowPlaceholder = true; //是否展示LoadingView
|
|
bool _needShowPlaceholder = true; //是否展示LoadingView
|
|
|
|
|
|
// Refresh 控制器
|
|
// Refresh 控制器
|
|
@@ -26,7 +44,7 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
|
|
return NewsfeedDetailState(
|
|
return NewsfeedDetailState(
|
|
detailInfo: {
|
|
detailInfo: {
|
|
'id':1,
|
|
'id':1,
|
|
- 'avator': Assets.communityCamera,
|
|
|
|
|
|
+ 'avator': 'https://p4.itc.cn/q_70/images03/20231121/ab826c4a7efe4c9aa93ca6e00f9e0986.jpeg',
|
|
'title': 'William Jefferson',
|
|
'title': 'William Jefferson',
|
|
'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
|
|
'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
|
|
'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
|
|
'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
|
|
@@ -40,7 +58,7 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
|
|
{
|
|
{
|
|
'userId': 1,
|
|
'userId': 1,
|
|
'userName': 'William Jefferson',
|
|
'userName': 'William Jefferson',
|
|
- 'avator': Assets.communityCamera,
|
|
|
|
|
|
+ 'avator': 'https://iknow-pic.cdn.bcebos.com/d439b6003af33a87f27f0584d45c10385343b519',
|
|
'time': 'June 17,2016 at 7:23 p.m.',
|
|
'time': 'June 17,2016 at 7:23 p.m.',
|
|
'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]'
|
|
'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]'
|
|
},
|
|
},
|
|
@@ -51,11 +69,18 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
|
|
{
|
|
{
|
|
'userId': 1,
|
|
'userId': 1,
|
|
'userName': 'William Jefferson',
|
|
'userName': 'William Jefferson',
|
|
- 'avator': Assets.communityCamera,
|
|
|
|
|
|
+ 'avator': 'https://iknow-pic.cdn.bcebos.com/d439b6003af33a87f27f0584d45c10385343b519',
|
|
'time': 'June 17,2016 at 7:23 p.m.',
|
|
'time': 'June 17,2016 at 7:23 p.m.',
|
|
'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]'
|
|
'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]'
|
|
},
|
|
},
|
|
],
|
|
],
|
|
|
|
+ commentFieldInfo: {
|
|
|
|
+ 'value': '',
|
|
|
|
+ 'controller': TextEditingController(),
|
|
|
|
+ 'hintText': 'What\'s on your mind?',
|
|
|
|
+ 'focusNode': FocusNode(),
|
|
|
|
+ 'obsecure': false,
|
|
|
|
+ }
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -157,12 +182,20 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
|
|
{
|
|
{
|
|
'userId': 1,
|
|
'userId': 1,
|
|
'userName': 'William Jefferson',
|
|
'userName': 'William Jefferson',
|
|
- 'avator': Assets.communityCamera,
|
|
|
|
|
|
+ 'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
|
|
|
|
+ 'time': 'June 17,2016 at 7:23 p.m.',
|
|
|
|
+ 'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ 'userId': 2,
|
|
|
|
+ 'userName': 'Ander Jackson',
|
|
|
|
+ 'avator': 'https://iknow-pic.cdn.bcebos.com/d439b6003af33a87f27f0584d45c10385343b519',
|
|
'time': 'June 17,2016 at 7:23 p.m.',
|
|
'time': 'June 17,2016 at 7:23 p.m.',
|
|
'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]'
|
|
'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]'
|
|
},
|
|
},
|
|
];
|
|
];
|
|
|
|
|
|
|
|
+
|
|
if (state.curPage == 1) {
|
|
if (state.curPage == 1) {
|
|
//刷新的方式
|
|
//刷新的方式
|
|
state = state.copyWith(list: listData);
|
|
state = state.copyWith(list: listData);
|
|
@@ -181,5 +214,43 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
|
|
_needShowPlaceholder = false;
|
|
_needShowPlaceholder = false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ // 点击了 comment 按钮
|
|
|
|
+ handlerCommentClick(BuildContext context) async{
|
|
|
|
+ BuildContext contextPage = context;
|
|
|
|
+ Log.d("点击了评论按钮");
|
|
|
|
+ await DialogEngine.show(
|
|
|
|
+ tag: "newsfeedcomments",
|
|
|
|
+ position: DialogPosition.bottom,
|
|
|
|
+ widget: CommentsDialog(
|
|
|
|
+ isShowConfirmBtn: false,
|
|
|
|
+ isShowCancelBtn: false,
|
|
|
|
+ height: 300.0,
|
|
|
|
+ confirmAction: (){},
|
|
|
|
+ cancelAction: null,
|
|
|
|
+ messageBuilder: (context) {
|
|
|
|
+ return Row(
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
+ children: [
|
|
|
|
+ // Container(
|
|
|
|
+ // color: Colors.red,
|
|
|
|
+ // padding: const EdgeInsets.only(left: 15,right: 15),
|
|
|
|
+ // child: Text("fdjsjfdks", textAlign: TextAlign.left,),
|
|
|
|
+ // ),
|
|
|
|
+ Expanded(
|
|
|
|
+ child: CommentsTextareaInput( showCounter:false,),
|
|
|
|
+ ),
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 点击了 Like 按钮
|
|
|
|
+ bool handlerLikeClick(){
|
|
|
|
+ Log.d("点击了点赞按钮");
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|