Sfoglia il codice sorgente

update commmunity module

glglove 1 settimana fa
parent
commit
7240b5a580

+ 1 - 1
packages/cpt_community/lib/modules/community/community_vm.g.dart

@@ -6,7 +6,7 @@ part of 'community_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$communityVmHash() => r'15dfd5c8d9c3d01bab9fc789c21ebe61b292c6f3';
+String _$communityVmHash() => r'a967355f8abbdda59a2001d7766b42f8d7ebb6af';
 
 /// See also [CommunityVm].
 @ProviderFor(CommunityVm)

+ 1 - 1
packages/cpt_community/lib/modules/garagesale/garagesale_post/garagesale_post_page.dart

@@ -26,7 +26,7 @@ class GaragesalePostPage extends HookConsumerWidget {
     return Scaffold(
       appBar: MyAppBar.appBar(
         context,
-        "Garage Sale Post",
+        "Post New Item",
         backgroundColor: context.appColors.whiteBG,
       ),
       backgroundColor: context.appColors.backgroundDefault,

+ 216 - 59
packages/cpt_community/lib/modules/newsfeed/newsfeed_post/newsfeed_post_page.dart

@@ -1,9 +1,13 @@
 import 'package:cpt_community/router/page/community_page_router.dart';
+import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
+import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_platform/engine/image/image_nine_grid.dart';
 import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/color_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_appbar.dart';
 import 'package:widgets/my_text_field.dart';
@@ -27,8 +31,7 @@ class NewsfeedPostPage extends HookConsumerWidget {
 
   @override
   Widget build(BuildContext context, WidgetRef ref) {
-    // final viewModel = ref.watch(newsfeedPostVmProvider.notifier);
-    final state = ref.watch(newsfeedPostVmProvider);
+    final vm = ref.read(newsfeedPostVmProvider.notifier);
 
     return Scaffold(
       appBar: MyAppBar.appBar(
@@ -36,79 +39,233 @@ class NewsfeedPostPage extends HookConsumerWidget {
         "Create Post",
         backgroundColor: context.appColors.whiteBG,
       ),
-      backgroundColor: context.appColors.backgroundDefault,
+      backgroundColor: ColorUtils.string2Color("#F2F3F6"),
       body: Column(
-        children: [
-          Expanded(
-            child: SingleChildScrollView(
-              scrollDirection: Axis.vertical,
-              physics: const BouncingScrollPhysics(),
-              clipBehavior: Clip.none,
-              child: Column(
-                children: [
-                  Container(
-                    width: double.infinity,
-                    height: 200,
-                    decoration: BoxDecoration(
-                      border: Border.all(
-                        color: Colors.grey,
-                        width: 1
+          children: [
+            Expanded(
+                child: SingleChildScrollView(
+                    scrollDirection: Axis.vertical,
+                    physics: const BouncingScrollPhysics(),
+                    clipBehavior: Clip.none,
+                    child: Column(
+                        children: [
+                          // mind textearea
+                          Container(
+                            margin: const EdgeInsets.only(left:15, right:15,top: 20),
+                            child: _buildTextArea(context, ref),
+                          ),
+                          Container(
+                            width: double.infinity,
+                            height: 200,
+                            color: Colors.white,
+                            margin: const EdgeInsets.only(left:15, right:15, top: 20, bottom: 20),
+                            padding: const EdgeInsets.all(15),
+                            // 选择图片上传 控件
+                            child: _buildImageSelectCmp(context, ref,vm),
+                          ),
+                        ]
+                    )
+                )
+            ),
+            // 底部 按钮
+            Container(
+              child: Row(
+                  children: [
+                    Expanded(
+                      child: MyButton(
+                        text: "Add Card",
+                        radius: 0,
+                        minHeight: 50,
+                        backgroundColor: context.appColors.textPrimary,
+                        textColor: Colors.white,
+                        fontWeight: FontWeight.w500,
+                        fontSize: 16,
+                        onPressed: (){
+                          // Navigator.pop(context);
+                        },
                       ),
-                      borderRadius: BorderRadius.circular(10),
-                      boxShadow: [
-                        BoxShadow(
-                          color: Colors.grey.withOpacity(0.5),
-                          spreadRadius: 1,
-                          blurRadius: 1,
-                          offset: const Offset(0, 3), // changes position of shadow
-                        ),
-                      ]
-                    ),
-                    child: _buildInputLayout(
-                      context,
-                      state,
-                      'mind'
                     ),
-                  ).marginOnly(left:15, right:15, top: 20, bottom: 20),
-                  Container(
-                    width: double.infinity,
-                    height: 200,
-                    color: Colors.grey,
-                  ),
-                ]
-              )
+                  ]
+              ),
             )
+          ]
+      ),
+    );
+  }
+
+  /// textarea
+  Widget _buildTextArea(BuildContext context, WidgetRef ref){
+
+    final state = ref.watch(newsfeedPostVmProvider);
+    final vm = ref.read(newsfeedPostVmProvider.notifier);
+
+    return Container(
+      width: double.infinity,
+      height: 200,
+      padding: const EdgeInsets.all(15),
+      decoration: BoxDecoration(
+          color: Colors.white,
+          borderRadius: BorderRadius.circular(5),
+          // boxShadow: [
+          //   BoxShadow(
+          //     color: Colors.grey.withOpacity(0.5),
+          //     spreadRadius: 1,
+          //     blurRadius: 1,
+          //     offset: const Offset(0, 3), // changes position of shadow
+          //   ),
+          // ]
+      ),
+      child: _buildTextAreaLayout(
+          context,
+          ref,
+          'mind',
+      ),
+    );
+  }
+  /// 选择图片上传组件
+  Widget _buildImageSelectCmp(BuildContext context, WidgetRef ref,vm,){
+    final state = ref.watch(newsfeedPostVmProvider);
+    return ImageNineGrid(
+      isSelectEnable: true,
+      maxImages: 10,
+      spacing: 10,
+      aspectRatio: 108 / 80,
+      initialImages: state.imgList,
+      onImagesChanged: (list) {
+        vm.setImgList(list);
+      },
+    );
+  }
+
+  /// 多行输入框
+  Widget _buildTextAreaLayout(BuildContext context, ref, key){
+    final state = ref.watch(newsfeedPostVmProvider);
+    final vm = ref.read(newsfeedPostVmProvider.notifier);
+    final noteCount = useState(0);
+
+    // return IgnoreKeyboardDismiss(
+    //   child: Container(
+    //     height: 177,
+    //     margin: const EdgeInsets.only(top: 16),
+    //     padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
+    //     decoration: BoxDecoration(
+    //       color: context.appColors.authFiledBG,
+    //       borderRadius: const BorderRadius.all(Radius.circular(5)),
+    //     ),
+    //     child: Stack(
+    //       children: [
+    //         TextField(
+    //           cursorColor: context.appColors.authFiledText,
+    //           cursorWidth: 1.5,
+    //           autofocus: false,
+    //           enabled: true,
+    //           focusNode: state.formData["desc"]!['focusNode'],
+    //           controller: state.formData["desc"]!['controller'],
+    //           decoration: InputDecoration(
+    //             isDense: true,
+    //             isCollapsed: true,
+    //             border: InputBorder.none,
+    //             hintText: state.formData["desc"]!['hintText'],
+    //             hintStyle: TextStyle(
+    //               color: context.appColors.authFiledHint,
+    //               fontSize: 16.0,
+    //               fontWeight: FontWeight.w500,
+    //             ),
+    //           ),
+    //           style: TextStyle(
+    //             color: context.appColors.authFiledText,
+    //             fontSize: 16.0,
+    //             fontWeight: FontWeight.w500,
+    //           ),
+    //           textInputAction: TextInputAction.done,
+    //           onSubmitted: (value) {
+    //             FocusScope.of(context).unfocus();
+    //           },
+    //           maxLines: null,
+    //           expands: true,
+    //           onChanged: (text) {
+    //             // 当文本改变时,更新字符数量
+    //             noteCount.value = text.length;
+    //           },
+    //         ),
+    //         Positioned(
+    //           bottom: 0.0,
+    //           right: 0.0,
+    //           child: Text(
+    //             S.current.characters(noteCount.value),
+    //             style: TextStyle(
+    //               color: context.appColors.textBlack,
+    //               fontSize: 15.0,
+    //             ),
+    //           ),
+    //         ),
+    //       ],
+    //     ),
+    //   ),
+    // );
+
+    return Container(
+      child: Stack(
+        children: [
+          TextField(
+            cursorColor: context.appColors.authFiledText,
+            cursorWidth: 1.5,
+            autofocus: false,
+            enabled: true,
+            maxLines: null,
+            focusNode: state.formData[key]!['focusNode'],
+            controller: state.formData[key]!['controller'],
+            decoration: InputDecoration(
+              isDense: true,
+              isCollapsed: true,
+              border: InputBorder.none,
+              hintText: state.formData[key]!['hintText'],
+              hintStyle: TextStyle(
+                color: context.appColors.authFiledHint,
+                fontSize: 16.0,
+                fontWeight: FontWeight.w500,
+              ),
+            ),
+            style: TextStyle(
+              color: context.appColors.authFiledText,
+              fontSize: 16.0,
+              fontWeight: FontWeight.w500,
+            ),
+            textInputAction: TextInputAction.done,
+            onSubmitted: (value) {
+              FocusScope.of(context).unfocus();
+            },
+            expands: true,
+            onChanged: (text) {
+              // 当文本改变时,更新字符数量
+              noteCount.value = text.length;
+            },
           ),
-          Container(
-            child: Row(
-                children: [
-                  Expanded(
-                    child: MyButton(
-                      text: "Add Card",
-                      backgroundColor: context.appColors.textPrimary,
-                      textColor: Colors.white,
-                      fontWeight: FontWeight.w500,
-                      fontSize: 16,
-                      onPressed: (){
-                        // Navigator.pop(context);
-                      },
-                    ),
-                  ),
-                ]
+          Positioned(
+            bottom: 0.0,
+            right: 0.0,
+            child: Text(
+              S.current.characters(noteCount.value),
+              style: TextStyle(
+                color: context.appColors.textBlack,
+                fontSize: 15.0,
+              ),
             ),
-          )
+          ),
         ]
       ),
     );
   }
 
 
-  /// 输入框
+  /// 单行输入框
   Widget _buildInputLayout(
       BuildContext context,
       state,
       String key,
       {
+        double height = 48,
+        double maxLines = 1,
         double marginTop = 0,
         bool? showRightIcon = false, //是否展示右侧的布局
         Widget? rightWidget, //右侧的布局
@@ -134,7 +291,7 @@ class NewsfeedPostPage extends HookConsumerWidget {
         margin: EdgeInsets.only(top: marginTop),
         padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
         showDivider: false,
-        height: 44,
+        height: height,
         style: TextStyle(
           color: context.appColors.authFiledText,
           fontSize: 16.0,

+ 183 - 0
packages/cpt_community/lib/modules/newsfeed/newsfeed_post/newsfeed_post_page1.dart

@@ -0,0 +1,183 @@
+import 'package:cpt_community/router/page/community_page_router.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_platform/engine/image/image_nine_grid.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_appbar.dart';
+import 'package:widgets/my_text_field.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:widgets/my_button.dart';
+
+import 'newsfeed_post_vm.dart';
+
+@RoutePage()
+class NewsfeedPostPage extends HookConsumerWidget {
+  const NewsfeedPostPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const NewsfeedPostPageRoute());
+    } else {
+      appRouter.push(const NewsfeedPostPageRoute());
+    }
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final vm = ref.read(newsfeedPostVmProvider.notifier);
+    final state = ref.watch(newsfeedPostVmProvider);
+
+    return Scaffold(
+      appBar: MyAppBar.appBar(
+        context,
+        "Create Post",
+        backgroundColor: context.appColors.whiteBG,
+      ),
+      backgroundColor: context.appColors.backgroundDefault,
+      body: Column(
+          children: [
+            Expanded(
+                child: SingleChildScrollView(
+                    scrollDirection: Axis.vertical,
+                    physics: const BouncingScrollPhysics(),
+                    clipBehavior: Clip.none,
+                    child: Column(
+                        children: [
+                          // mind textearea
+                          Container(
+                            margin: const EdgeInsets.only(left:15, right:15, top: 20, bottom: 20),
+                            // child: _buildTextArea(context, ref, vm, state),
+                            child: Text("fds"),
+                          ),
+                          Container(
+                            width: double.infinity,
+                            height: 200,
+                            color: Colors.grey,
+                            child: Text("fds"),
+                            // 选择图片上传 控件
+                            // child: _buildImageSelectCmp(context, ref,vm,state),
+                          ),
+                        ]
+                    )
+                )
+            ),
+            // 底部 按钮
+            Container(
+              child: Row(
+                  children: [
+                    Expanded(
+                      child: MyButton(
+                        text: "Add Card",
+                        backgroundColor: context.appColors.textPrimary,
+                        textColor: Colors.white,
+                        fontWeight: FontWeight.w500,
+                        fontSize: 16,
+                        onPressed: (){
+                          // Navigator.pop(context);
+                        },
+                      ),
+                    ),
+                  ]
+              ),
+            )
+          ]
+      ),
+    );
+  }
+
+  /// textarea
+  Widget _buildTextArea(context, ref, vm, state){
+    return Container(
+      width: double.infinity,
+      height: 200,
+      decoration: BoxDecoration(
+          border: Border.all(
+              color: Colors.grey,
+              width: 1
+          ),
+          borderRadius: BorderRadius.circular(10),
+          boxShadow: [
+            BoxShadow(
+              color: Colors.grey.withOpacity(0.5),
+              spreadRadius: 1,
+              blurRadius: 1,
+              offset: const Offset(0, 3), // changes position of shadow
+            ),
+          ]
+      ),
+      child: _buildInputLayout(
+          context,
+          state,
+          'mind'
+      ),
+    );
+  }
+  /// 选择图片上传组件
+  Widget _buildImageSelectCmp(context, ref,vm, state,){
+    return ImageNineGrid(
+      isSelectEnable: true,
+      maxImages: 10,
+      spacing: 10,
+      aspectRatio: 108 / 80,
+      initialImages: state.imgList,
+      onImagesChanged: (list) {
+        vm.setImgList(list);
+      },
+    );
+  }
+
+
+  /// 输入框
+  Widget _buildInputLayout(
+      BuildContext context,
+      state,
+      String key,
+      {
+        double marginTop = 0,
+        bool? showRightIcon = false, //是否展示右侧的布局
+        Widget? rightWidget, //右侧的布局
+        TextInputType textInputType = TextInputType.text,
+        String? errorText,
+        bool obscureText = false,
+        TextInputAction textInputAction = TextInputAction.done,
+        Function? onSubmit,
+      }) {
+    return IgnoreKeyboardDismiss(
+      child: MyTextField(
+        key,
+        fillBackgroundColor: context.appColors.authFiledBG,
+        state.formData[key]!['value'],
+        hintText: state.formData[key]!['hintText'],
+        hintStyle: TextStyle(
+          color: context.appColors.authFiledHint,
+          fontSize: 16.0,
+          fontWeight: FontWeight.w500,
+        ),
+        controller: state.formData[key]!['controller'],
+        focusNode: state.formData[key]!['focusNode'],
+        margin: EdgeInsets.only(top: marginTop),
+        padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
+        showDivider: false,
+        height: 44,
+        style: TextStyle(
+          color: context.appColors.authFiledText,
+          fontSize: 16.0,
+          fontWeight: FontWeight.w500,
+        ),
+        inputType: textInputType,
+        textInputAction: textInputAction,
+        onSubmit: onSubmit,
+        cursorColor: context.appColors.authFiledText,
+        obscureText: obscureText,
+        errorText: errorText,
+        showLeftIcon: true,
+        showRightIcon: showRightIcon,
+        rightWidget: rightWidget,
+      ),
+    );
+  }
+}

+ 33 - 3
packages/cpt_community/lib/modules/newsfeed/newsfeed_post/newsfeed_post_page_state.dart

@@ -1,8 +1,38 @@
+import 'package:flutter/cupertino.dart';
+
 class NewsfeedPostPageState {
   //表单的校验与数据
   final Map<String, Map<String, dynamic>> formData;
+  // 选择的图片
+  final List<String> imgList;
+
+  //表单的错误信息展示
+  String? mindFieldErrorText;
+
+  NewsfeedPostPageState({
+    formData,
+    required this.imgList,
+    this.mindFieldErrorText,
+  }): formData = formData ?? {
+    'mind': {
+      'value': '',
+      'controller': TextEditingController(),
+      'hintText': 'What\'s on your mind?',
+      'focusNode': FocusNode(),
+      'obsecure': false,
+    }
+  };
+
+  NewsfeedPostPageState copyWith({
+    Map<String, Map<String, dynamic>>? formData,
+    List<String>? imgList,
+    String? mindFieldErrorText,
+  }) {
+    return NewsfeedPostPageState(
+      formData: formData ?? this.formData,
+      imgList: imgList ?? this.imgList,
+      mindFieldErrorText: mindFieldErrorText ?? this.mindFieldErrorText,
+    );
+  }
 
-  const NewsfeedPostPageState({
-    required this.formData,
-  });
 }

+ 127 - 16
packages/cpt_community/lib/modules/newsfeed/newsfeed_post/newsfeed_post_vm.dart

@@ -7,6 +7,7 @@ import 'package:router/path/router_path.dart';
 import 'package:shared/utils/color_utils.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:auto_route/auto_route.dart';
+import 'package:shared/utils/util.dart';
 
 
 import 'newsfeed_post_page_state.dart';
@@ -18,30 +19,140 @@ class NewsfeedPostVm extends _$NewsfeedPostVm {
 
   NewsfeedPostPageState initState() {
     return NewsfeedPostPageState(
-      formData: {
-        'mind': {
-          'value': '',
-          'controller': TextEditingController(),
-          'hintText': 'What\'s on your mind?',
-          'focusNode': FocusNode(),
-          'obsecure': false,
+        mindFieldErrorText: '',
+        formData: {
+          'mind': {
+            'value': '',
+            'controller': TextEditingController(),
+            'hintText': 'What\'s on your mind?',
+            'focusNode': FocusNode(),
+            'obsecure': false,
+          }
         },
-        'images': {
-          'value': '',
-          'controller': TextEditingController(),
-          'hintText': '',
-          'focusNode': FocusNode(),
-          'obsecure': false,
-        },
-      },
+        imgList: [],
     );
   }
+
   @override
-  NewsfeedPostPageState build(){
+  NewsfeedPostPageState build() {
     // 初始化状态
     NewsfeedPostPageState state = initState();
+
+    // 当前渲染完成后执行一次
+    WidgetsBinding.instance!.addPostFrameCallback((_) {
+      // 获取焦点
+      initListener(state);
+      ref.onDispose(() {
+        onDispose(state);
+      });
+    });
+
     return state;
   }
 
+  // //选择选项
+  // void pickCategory() {
+  //   _dismissKeyboard();
+  //
+  //   OptionPickerUtil.showCupertinoOptionPicker(
+  //     items: state.optionList,
+  //     initialSelectIndex: 0,
+  //     onPickerChanged: (_, index) {
+  //       state = state.copyWith(selectedOption: state.optionList[index]);
+  //     },
+  //   );
+  // }
+
+  // 获取聚焦的node
+  FocusNode getFocusNode(Map<String, dynamic> formData, String keyStr) {
+    return formData![keyStr]!['focusNode'];
+  }
+
+  // 取消表单聚焦状态
+  void _dismissKeyboard({String? keyStr}) {
+    if(keyStr!.isNotEmpty){
+      Log.d("FeedbackCreateViewModel 取消单个表单 $keyStr 聚焦状态");
+      final FocusNode sigleItemFocusNode = state.formData[keyStr]!['focusNode'];
+      sigleItemFocusNode!.unfocus();
+    }else {
+      Log.d("FeedbackCreateViewModel 取消所有表单聚焦状态");
+      // 遍历 formData 的所有表单 然后逐一取消聚焦
+      Map<String, dynamic> formData = state.formData;
+      for(String key in formData.keys){
+        final FocusNode sigleItemFocusNode = formData[key]['focusNode'];
+        sigleItemFocusNode!.unfocus();
+      }
+    }
+  }
+
+  // 获取表单的值
+  dynamic _getFormFieldValue({List<String>? keys, String? keyStr}) {
+    if(keyStr!.isEmpty){
+      if(keys!.isNotEmpty){
+        // 遍历keys获取指定多个 keys 的表单value
+        Map<String, dynamic> resultValueMap = {};
+        for (String itemStr in keys!) {
+          TextEditingController sigleItemController = state.formData[itemStr]!['controller'];
+          resultValueMap[itemStr] = sigleItemController.text;
+        }
+        return resultValueMap;
+      }
+    }else if(keyStr!.isNotEmpty){
+      // 获取单个表单的value
+      final TextEditingController sigleItemController = state.formData[keyStr]!['controller'];
+      return sigleItemController.text;
+    }
+  }
+
+  ///提交反馈
+  void submitNewsfeedPost() {
+    state = state.copyWith(mindFieldErrorText: null);
+
+    _dismissKeyboard();
+
+    // 获取表单的值
+    String mindValue = _getFormFieldValue(keyStr: 'mind');
+
+    Log.d('当前待提交的 mind:$mindValue  imgList:${state.imgList}');
+
+
+    if (Utils.isEmpty(mindValue)) {
+      state = state.copyWith(mindFieldErrorText: "Title cannot be empty!");
+      return;
+    }
+
+    //去成功页面
+    // FeedbackCreateSuccessPage.startInstance();
+    // 返回上一页
+  }
+
+  //选中图片
+  void setImgList(List<String> list) {
+    state = state.copyWith(imgList: list);
+  }
+
+  //初始化监听
+  void initListener(NewsfeedPostPageState initState) {
+
+    // 获取表单的焦点节点
+    final FocusNode focusNode = getFocusNode(state.formData, 'mind');
+
+    focusNode.addListener(() {
+      // 获取焦点的时候清空错误文本
+      if (focusNode.hasFocus) {
+        state = state.copyWith(mindFieldErrorText: null);
+      }
+    });
+  }
+
+  //销毁资源
+  void onDispose(NewsfeedPostPageState initState) {
+    // 获取表单的焦点节点
+    final FocusNode focusNode = getFocusNode(state.formData, 'mind');
+    focusNode.dispose();
+
+    Log.d("NewsfeedPostPageState 销毁 onDispose");
+  }
+
 
 }

+ 1 - 1
packages/cpt_community/lib/modules/newsfeed/newsfeed_post/newsfeed_post_vm.g.dart

@@ -6,7 +6,7 @@ part of 'newsfeed_post_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$newsfeedPostVmHash() => r'3717034c813e1d4cf8b2f212aa15ab483c6f220e';
+String _$newsfeedPostVmHash() => r'a8ecf6c14c636c03fa08a1e050b1f6f6330c5d73';
 
 /// See also [NewsfeedPostVm].
 @ProviderFor(NewsfeedPostVm)

+ 4 - 1
packages/cpt_community/lib/modules/newsfeed/newsfeed_vm.dart

@@ -1,4 +1,5 @@
 
+import 'package:cpt_community/modules/newsfeed/newsfeed_post/newsfeed_post_page.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:flutter/material.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
@@ -195,7 +196,9 @@ class NewsfeedVm extends _$NewsfeedVm {
   void handlerGotoPost(context){
     // ComponentServiceManager().communityService.startCommunityPage();
 
-    AutoRouter.of(context).pushNamed(RouterPath.newsFeedPost);
+    // AutoRouter.of(context).pushNamed(RouterPath.newsFeedPost);
+
+    NewsfeedPostPage.startInstance();
   }
 
   // 点击tab

+ 3 - 0
packages/cpt_property/lib/modules/ioan/property_ioan_page.dart

@@ -1,5 +1,6 @@
 import 'package:cpt_property/components/bottomDialog.dart';
 import 'package:cs_resources/generated/assets.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
@@ -7,6 +8,7 @@ import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:shared/utils/color_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_button.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 
@@ -389,6 +391,7 @@ class PropertyIoanPage extends HookConsumerWidget {
                   "Request a Quote",
                   fontSize: 16,
                   textColor: Colors.white,
+                  isFontMedium: true,
                 ),
               ],
             ),

+ 1 - 1
packages/cpt_property/pubspec.yaml

@@ -49,7 +49,7 @@ dependencies:
   hooks_riverpod: ^2.5.1
 
   # freezed 注解
-  freezed_annotation: ^2.2.0
+#  freezed_annotation: ^2.2.0
 
 dev_dependencies:
   flutter_test: