|
|
@@ -63,6 +63,10 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
controller.onEditCancel();
|
|
|
return false;
|
|
|
}
|
|
|
+ if (controller.isSearchModel.value) {
|
|
|
+ controller.onSearchCancel();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
if (controller.isShowMindFullScreen.value) {
|
|
|
controller.onExitMindFullScreen();
|
|
|
return false;
|
|
|
@@ -97,7 +101,6 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
return Column(
|
|
|
children: [
|
|
|
AnimatedContainer(
|
|
|
- key: controller.headGlobalKey,
|
|
|
decoration: BoxDecoration(
|
|
|
gradient: LinearGradient(
|
|
|
colors: ['#E1E9FF'.toColor(), '#F9FAFE'.toColor()],
|
|
|
@@ -106,21 +109,13 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
stops: const [0, 1.0],
|
|
|
),
|
|
|
),
|
|
|
- height: controller.isShowMindFullScreen.value
|
|
|
- ? 0
|
|
|
- : controller.headViewHeight,
|
|
|
+ height: controller.getChangeHeadHeight(),
|
|
|
duration: controller.mindFullDuration,
|
|
|
child: SingleChildScrollView(
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
- child: Column(children: [
|
|
|
+ child: Column(key: controller.headGlobalKey, children: [
|
|
|
SizedBox(height: statusBarHeight),
|
|
|
- Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- children: [
|
|
|
- _buildToolbarLeftView(),
|
|
|
- _buildToolbarRightView(),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ _buildHeadView(),
|
|
|
buildTabBar(context),
|
|
|
]),
|
|
|
),
|
|
|
@@ -132,16 +127,196 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ Widget _buildHeadView() {
|
|
|
+ return Obx(() {
|
|
|
+ if (controller.isEditModel) {
|
|
|
+ return _buildEditHeadView();
|
|
|
+ }
|
|
|
+ if (controller.isSearchModel.value) {
|
|
|
+ return _buildSearchHeadView();
|
|
|
+ }
|
|
|
+ return _buildHeadNormalView();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget _buildSearchHeadView() {
|
|
|
+ return Row(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Align(
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
+ child: IconButton(
|
|
|
+ icon: Assets.images.iconTalkEditCancel
|
|
|
+ .image(width: 24.w, height: 24.w),
|
|
|
+ onPressed: () {
|
|
|
+ controller.onSearchCancel();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ // TextField()
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ height: 38.w,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.white,
|
|
|
+ border: Border.all(color: '#E7E9F6'.color, width: 1.w),
|
|
|
+ borderRadius: BorderRadius.circular(6.w),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: TextField(
|
|
|
+ maxLines: 1,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp, color: ColorName.primaryTextColor),
|
|
|
+ // controller: controller.searchController,
|
|
|
+ decoration: InputDecoration(
|
|
|
+ hintText: StringName.talkSearchHint.tr,
|
|
|
+ hintStyle: TextStyle(
|
|
|
+ fontSize: 14.sp,
|
|
|
+ color: ColorName.tertiaryTextColor,
|
|
|
+ ),
|
|
|
+ contentPadding: EdgeInsets.symmetric(horizontal: 8.w),
|
|
|
+ border:
|
|
|
+ const OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
+ ),
|
|
|
+ onChanged: (value) {
|
|
|
+ controller.setSearchChangeTxt(value);
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ Text(controller.searchResultDesc.value,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp, color: ColorName.secondaryTextColor)),
|
|
|
+ SizedBox(width: 8.w)
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )),
|
|
|
+ SizedBox(width: 11.w),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.onSearchPrevious();
|
|
|
+ },
|
|
|
+ child: Assets.images.iconTalkSearchPrevious
|
|
|
+ .image(width: 24.w, height: 24.w)),
|
|
|
+ SizedBox(width: 16.w),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.onSearchNext();
|
|
|
+ },
|
|
|
+ child: Assets.images.iconTalkSearchNext
|
|
|
+ .image(width: 24.w, height: 24.w)),
|
|
|
+ SizedBox(width: 12.w),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget _buildEditHeadView() {
|
|
|
+ return Row(
|
|
|
+ children: [
|
|
|
+ Align(
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
+ child: IconButton(
|
|
|
+ icon: Assets.images.iconTalkEditCancel
|
|
|
+ .image(width: 24.w, height: 24.w),
|
|
|
+ onPressed: () {
|
|
|
+ controller.onEditCancel();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ const Spacer(),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.onEditDoneClick();
|
|
|
+ },
|
|
|
+ child: Padding(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 12.w),
|
|
|
+ child: Text(StringName.done.tr,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 17.sp, color: ColorName.primaryTextColor)),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget _buildHeadNormalView() {
|
|
|
+ return Row(
|
|
|
+ children: [
|
|
|
+ IconButton(
|
|
|
+ icon: Assets.images.iconTalkBack.image(width: 24.w, height: 24.w),
|
|
|
+ onPressed: () {
|
|
|
+ Get.back();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ SizedBox(width: 6.w),
|
|
|
+ Obx(() {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.onEditTitleClick();
|
|
|
+ },
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ ConstrainedBox(
|
|
|
+ constraints: BoxConstraints(maxWidth: 0.65.sw),
|
|
|
+ child: Text(
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ controller.talkBean.value?.title.value ?? '',
|
|
|
+ style: TextStyle(
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ fontSize: 15.sp,
|
|
|
+ color: ColorName.primaryTextColor,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ SizedBox(width: 2.w),
|
|
|
+ Assets.images.iconTalkEditTitle
|
|
|
+ .image(width: 16.w, height: 16.w)
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ SizedBox(height: 2.h),
|
|
|
+ Text(
|
|
|
+ controller.talkBean.value?.createTime ?? '',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 11.sp, color: ColorName.secondaryTextColor),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ const Spacer(),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ IconButton(
|
|
|
+ icon:
|
|
|
+ Assets.images.iconTalkShare.image(width: 20.w, height: 20.w),
|
|
|
+ onPressed: () {
|
|
|
+ controller.onShareClick();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
Widget buildTabBar(BuildContext context) {
|
|
|
TabController tabController = DefaultTabController.of(context);
|
|
|
tabController.addListener(() {
|
|
|
controller.updateTabIndex(tabController.index);
|
|
|
});
|
|
|
- return Obx(() {
|
|
|
- if (!controller.isEditModel) {
|
|
|
- return Column(
|
|
|
- children: [
|
|
|
- TabBar(
|
|
|
+ return Column(
|
|
|
+ children: [
|
|
|
+ Obx(() {
|
|
|
+ return AbsorbPointer(
|
|
|
+ absorbing: controller.isEditModel || controller.isSearchModel.value,
|
|
|
+ child: TabBar(
|
|
|
+ key: controller.tabBarGlobalKey,
|
|
|
labelStyle:
|
|
|
TextStyle(fontSize: 16.sp, fontWeight: FontWeight.bold),
|
|
|
unselectedLabelStyle: TextStyle(fontSize: 14.sp),
|
|
|
@@ -158,14 +333,12 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
tabs: controller.tabBeans
|
|
|
.map((bean) => Tab(text: bean.title))
|
|
|
.toList()),
|
|
|
- SizedBox(height: 6.h),
|
|
|
- Divider(height: 1, color: '#F2F4F9'.color)
|
|
|
- ],
|
|
|
- );
|
|
|
- } else {
|
|
|
- return SizedBox(height: 8.h, width: double.infinity);
|
|
|
- }
|
|
|
- });
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ SizedBox(height: 6.h),
|
|
|
+ Divider(height: 1, color: '#F2F4F9'.color)
|
|
|
+ ],
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
@@ -192,6 +365,7 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
return Expanded(
|
|
|
child: TabBarView(
|
|
|
physics: controller.isEditModel ||
|
|
|
+ controller.isSearchModel.value ||
|
|
|
controller.checkTabBean.value?.isDisallowScroll == true
|
|
|
? const NeverScrollableScrollPhysics()
|
|
|
: null,
|
|
|
@@ -290,31 +464,26 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
|
|
|
Widget buildBottomView() {
|
|
|
return Obx(() {
|
|
|
- return Visibility(
|
|
|
+ return AnimatedPositioned(
|
|
|
key: controller.bottomGlobalKey,
|
|
|
- visible: controller.isEditModel == false,
|
|
|
- child: AnimatedPositioned(
|
|
|
- duration: controller.mindFullDuration,
|
|
|
- bottom: controller.isShowMindFullScreen.value
|
|
|
- ? controller.getBottomViewHeight()
|
|
|
- : 0.h,
|
|
|
- left: 0,
|
|
|
- right: 0,
|
|
|
- child: Align(
|
|
|
- alignment: Alignment.bottomCenter,
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(bottom: 20.h),
|
|
|
- child: IntrinsicHeight(
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
- children: [
|
|
|
- _buildAIAnalysisView(),
|
|
|
- SizedBox(height: 8.h),
|
|
|
- _buildTalkEditView(),
|
|
|
- SizedBox(height: 10.h),
|
|
|
- buildAudioView()
|
|
|
- ],
|
|
|
- ),
|
|
|
+ duration: controller.mindFullDuration,
|
|
|
+ bottom: controller.getChangeBottomHeight(),
|
|
|
+ left: 0,
|
|
|
+ right: 0,
|
|
|
+ child: Align(
|
|
|
+ alignment: Alignment.bottomCenter,
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(bottom: 20.h),
|
|
|
+ child: IntrinsicHeight(
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
+ children: [
|
|
|
+ _buildAIAnalysisView(),
|
|
|
+ SizedBox(height: 8.h),
|
|
|
+ _buildOperationBtnView(),
|
|
|
+ SizedBox(height: 10.h),
|
|
|
+ buildAudioView()
|
|
|
+ ],
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
@@ -323,51 +492,70 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- Widget _buildTalkEditView() {
|
|
|
- return Obx(() {
|
|
|
- return Visibility(
|
|
|
- visible: controller.talkBean.value?.status.value ==
|
|
|
- TalkStatus.analysisSuccess &&
|
|
|
- controller.checkTabBean.value?.isShowEdit == true,
|
|
|
- maintainState: true,
|
|
|
- maintainAnimation: true,
|
|
|
- maintainSize: true,
|
|
|
- child: GestureDetector(
|
|
|
- onTap: () => controller.onEditModelClick(),
|
|
|
- child: Align(
|
|
|
- alignment: Alignment.centerLeft,
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(left: 12.w),
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 6.w),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: ColorName.white,
|
|
|
- borderRadius: BorderRadius.circular(100),
|
|
|
- boxShadow: [
|
|
|
- BoxShadow(
|
|
|
- color: ColorName.black5.withOpacity(0.08),
|
|
|
- spreadRadius: 2,
|
|
|
- blurRadius: 12,
|
|
|
- offset: const Offset(0, 1),
|
|
|
- ),
|
|
|
- ]),
|
|
|
- child: IntrinsicWidth(
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- Assets.images.iconTalkEdit.image(width: 16.w, height: 16.w),
|
|
|
- SizedBox(width: 2.w),
|
|
|
- Text(StringName.talkUpdateTxt.tr,
|
|
|
- style: TextStyle(
|
|
|
- height: 1,
|
|
|
- fontSize: 14.sp,
|
|
|
- color: ColorName.primaryTextColor))
|
|
|
- ],
|
|
|
- ),
|
|
|
+ Widget _buildOperationBtnView() {
|
|
|
+ return SizedBox(
|
|
|
+ height: 28.w,
|
|
|
+ child: Obx(() {
|
|
|
+ return Visibility(
|
|
|
+ visible: controller.talkBean.value?.status.value ==
|
|
|
+ TalkStatus.analysisSuccess,
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Visibility(
|
|
|
+ visible: controller.checkTabBean.value?.isShowEdit == true,
|
|
|
+ child: _buildCommonOperationView(
|
|
|
+ Assets.images.iconTalkEdit.provider(),
|
|
|
+ StringName.talkUpdateTxt.tr, onClick: () {
|
|
|
+ controller.onEditModelClick();
|
|
|
+ })),
|
|
|
+ Visibility(
|
|
|
+ visible: controller.checkTabBean.value?.isShowSearch == true,
|
|
|
+ child: _buildCommonOperationView(
|
|
|
+ Assets.images.iconTalkSearch.provider(),
|
|
|
+ StringName.talkDetailSearchTxt.tr, onClick: () {
|
|
|
+ controller.onSearchClick();
|
|
|
+ })),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget _buildCommonOperationView(ImageProvider provider, String txt,
|
|
|
+ {VoidCallback? onClick}) {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () => onClick?.call(),
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(left: 12.w),
|
|
|
+ height: 28.w,
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 8.w),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.white,
|
|
|
+ borderRadius: BorderRadius.circular(100),
|
|
|
+ boxShadow: [
|
|
|
+ BoxShadow(
|
|
|
+ color: ColorName.black5.withOpacity(0.08),
|
|
|
+ spreadRadius: 2,
|
|
|
+ blurRadius: 12,
|
|
|
+ offset: const Offset(0, 1),
|
|
|
),
|
|
|
- ),
|
|
|
+ ]),
|
|
|
+ child: IntrinsicWidth(
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Image(image: provider, width: 16.w, height: 16.w),
|
|
|
+ SizedBox(width: 2.w),
|
|
|
+ Text(txt,
|
|
|
+ style: TextStyle(
|
|
|
+ height: 1,
|
|
|
+ fontSize: 14.sp,
|
|
|
+ color: ColorName.primaryTextColor))
|
|
|
+ ],
|
|
|
),
|
|
|
),
|
|
|
- );
|
|
|
- });
|
|
|
+ ),
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
Widget _buildAIAnalysisView() {
|
|
|
@@ -455,106 +643,6 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
- Widget _buildToolbarLeftView() {
|
|
|
- return Obx(() {
|
|
|
- if (controller.isEditModel) {
|
|
|
- return Align(
|
|
|
- alignment: Alignment.centerLeft,
|
|
|
- child: IconButton(
|
|
|
- icon: Assets.images.iconTalkEditCancel
|
|
|
- .image(width: 24.w, height: 24.w),
|
|
|
- onPressed: () {
|
|
|
- controller.onEditCancel();
|
|
|
- },
|
|
|
- ),
|
|
|
- );
|
|
|
- } else {
|
|
|
- return Row(
|
|
|
- children: [
|
|
|
- IconButton(
|
|
|
- icon: Assets.images.iconTalkBack.image(width: 24.w, height: 24.w),
|
|
|
- onPressed: () {
|
|
|
- Get.back();
|
|
|
- },
|
|
|
- ),
|
|
|
- SizedBox(width: 6.w),
|
|
|
- Obx(() {
|
|
|
- return GestureDetector(
|
|
|
- onTap: () {
|
|
|
- controller.onEditTitleClick();
|
|
|
- },
|
|
|
- child: Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- ConstrainedBox(
|
|
|
- constraints: BoxConstraints(maxWidth: 0.65.sw),
|
|
|
- child: Text(
|
|
|
- maxLines: 1,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- controller.talkBean.value?.title.value ?? '',
|
|
|
- style: TextStyle(
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
- fontSize: 15.sp,
|
|
|
- color: ColorName.primaryTextColor,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- SizedBox(width: 2.w),
|
|
|
- Assets.images.iconTalkEditTitle
|
|
|
- .image(width: 16.w, height: 16.w)
|
|
|
- ],
|
|
|
- ),
|
|
|
- SizedBox(height: 2.h),
|
|
|
- Text(
|
|
|
- controller.talkBean.value?.createTime ?? '',
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 11.sp, color: ColorName.secondaryTextColor),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
- })
|
|
|
- ],
|
|
|
- );
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- Widget _buildToolbarRightView() {
|
|
|
- return Obx(() {
|
|
|
- return Visibility(
|
|
|
- visible: controller.talkBean.value?.status.value ==
|
|
|
- TalkStatus.analysisSuccess,
|
|
|
- child: controller.isEditModel
|
|
|
- ? GestureDetector(
|
|
|
- onTap: () {
|
|
|
- controller.onEditDoneClick();
|
|
|
- },
|
|
|
- child: Padding(
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 12.w),
|
|
|
- child: Text(StringName.done.tr,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 17.sp, color: ColorName.primaryTextColor)),
|
|
|
- ),
|
|
|
- )
|
|
|
- : Row(
|
|
|
- children: [
|
|
|
- IconButton(
|
|
|
- icon: Assets.images.iconTalkShare
|
|
|
- .image(width: 20.w, height: 20.w),
|
|
|
- onPressed: () {
|
|
|
- controller.onShareClick();
|
|
|
- },
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
- });
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
class CustomTrackShape extends RoundedRectSliderTrackShape {
|