import 'package:cpt_community/modules/community/newsfeed_detail/newsfeed_detail_vm.dart'; import 'package:cs_resources/generated/l10n.dart'; import 'package:cs_resources/theme/app_colors_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:shared/utils/log_utils.dart'; import 'package:widgets/my_text_view.dart'; /// 多行输入框 class CommentsTextareaInput extends HookConsumerWidget { bool showCounter = true; CommentsTextareaInput({Key? key,this.showCounter = true}): super(key: key); @override Widget build(BuildContext context, WidgetRef ref) { final state = ref.watch(newsfeedDetailVmProvider); final vm = ref.read(newsfeedDetailVmProvider.notifier); final noteCount = useState(0); return _buildTextAreaLayout(context, ref, state, vm, noteCount); } Widget _buildTextAreaLayout(BuildContext context, ref, state, vm , noteCount){ Log.d("----898989----${state.commentFieldInfo}-----"); // return Text('角度看是否 ${state.commentFieldInfo['hintText']}'); return Stack( children: [ Text("发的时刻减肥的"), ] ); // Row( // mainAxisSize: MainAxisSize.max, // children: [ // Expanded( // child: Stack( // children: [ // TextField( // cursorColor: context.appColors.authFiledText, // cursorWidth: 1.5, // autofocus: false, // enabled: true, // maxLines: null, // focusNode: state.commentFieldInfo['focusNode'], // controller: state.commentFieldInfo!['controller'], // decoration: InputDecoration( // isDense: true, // isCollapsed: true, // border: InputBorder.none, // hintText: state.commentFieldInfo!['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) { // // 当文本改变时,更新字符数量 // if(showCounter){ // noteCount.value = text.length; // } // }, // ), // Visibility( // visible: showCounter, // child: Positioned( // bottom: 0.0, // right: 0.0, // child: Text( // S.current.characters(noteCount.value), // style: TextStyle( // color: context.appColors.textBlack, // fontSize: 15.0, // ), // ), // ), // ), // ] // ), // ), // ], // ); } }