|
|
@@ -77,14 +77,13 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
return true;
|
|
|
},
|
|
|
child: DefaultTabController(
|
|
|
- initialIndex: controller.tabIndex.value,
|
|
|
+ initialIndex: controller.defaultIndex,
|
|
|
length: controller.tabBeans.length,
|
|
|
child: Stack(
|
|
|
children: [
|
|
|
buildTopGradient(),
|
|
|
_buildTalkContentView(),
|
|
|
buildBottomView(),
|
|
|
- buildAIAnalysisView()
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -98,125 +97,54 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
actions: [
|
|
|
_buildEditBtnView(),
|
|
|
],
|
|
|
+ leadingWidth: 0.9.sw,
|
|
|
systemOverlayStyle: SystemUiOverlayStyle.dark,
|
|
|
backgroundColor: Colors.transparent,
|
|
|
- leading: _buildAppbarBackView(),
|
|
|
+ leading: _buildAppbarLeftView(),
|
|
|
),
|
|
|
body: Builder(builder: (context) {
|
|
|
return Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- _buildHeaderView(),
|
|
|
- buildTabBar(context),
|
|
|
- Obx(() {
|
|
|
- return Visibility(
|
|
|
- visible: !controller.isEditModel,
|
|
|
- child: Divider(
|
|
|
- height: 1,
|
|
|
- color: const Color(0xFFf6f6f6),
|
|
|
- indent: 12.w,
|
|
|
- endIndent: 12.w),
|
|
|
- );
|
|
|
- }),
|
|
|
- Obx(() {
|
|
|
- return Visibility(
|
|
|
- visible: !controller.isEditModel,
|
|
|
- child: SizedBox(height: 8.h));
|
|
|
- }),
|
|
|
- buildTalkContentView()
|
|
|
- ],
|
|
|
+ children: [buildTabBar(context), buildTalkContentView()],
|
|
|
);
|
|
|
}),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Padding _buildHeaderView() {
|
|
|
- return Padding(
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 12.w),
|
|
|
- child: Obx(() {
|
|
|
+ Widget buildTabBar(BuildContext context) {
|
|
|
+ TabController tabController = DefaultTabController.of(context);
|
|
|
+ tabController.addListener(() {
|
|
|
+ controller.updateTabIndex(tabController.index);
|
|
|
+ });
|
|
|
+ return Obx(() {
|
|
|
+ if (!controller.isEditModel) {
|
|
|
return Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- SizedBox(height: 8.h),
|
|
|
- _buildTalkTitle(),
|
|
|
- SizedBox(height: 4.h),
|
|
|
- Text(controller.talkBean.value?.createTime ?? '',
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 12.sp, color: ColorName.secondaryTextColor)),
|
|
|
- SizedBox(height: 14.h),
|
|
|
+ TabBar(
|
|
|
+ labelStyle:
|
|
|
+ TextStyle(fontSize: 16.sp, fontWeight: FontWeight.bold),
|
|
|
+ unselectedLabelStyle: TextStyle(fontSize: 14.sp),
|
|
|
+ labelColor: ColorName.primaryTextColor,
|
|
|
+ unselectedLabelColor: ColorName.secondaryTextColor,
|
|
|
+ labelPadding: EdgeInsets.only(top: 4.h),
|
|
|
+ dividerHeight: 0,
|
|
|
+ splashFactory: NoSplash.splashFactory,
|
|
|
+ indicator: FixedSizeTabIndicator(
|
|
|
+ width: 16.w,
|
|
|
+ height: 3.w,
|
|
|
+ radius: 3,
|
|
|
+ color: ColorName.colorPrimary),
|
|
|
+ tabs: controller.tabBeans
|
|
|
+ .map((bean) => Tab(text: bean.title))
|
|
|
+ .toList()),
|
|
|
+ SizedBox(height: 6.h),
|
|
|
+ Divider(height: 1, color: '#F2F4F9'.color)
|
|
|
],
|
|
|
);
|
|
|
- }),
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- Widget _buildTalkTitle() {
|
|
|
- if (!controller.isEditModel || controller.tabIndex.value == 1) {
|
|
|
- return Text(controller.talkBean.value?.title.value ?? '',
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 22.sp,
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
- color: ColorName.primaryTextColor));
|
|
|
- } else {
|
|
|
- return Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: ColorName.white,
|
|
|
- borderRadius: BorderRadius.circular(6.w),
|
|
|
- border: Border.all(color: "#E7E9F6".toColor(), width: 1),
|
|
|
- ),
|
|
|
- child: TextField(
|
|
|
- maxLines: null,
|
|
|
- maxLength: 15,
|
|
|
- decoration: InputDecoration(
|
|
|
- counterText: '',
|
|
|
- border: InputBorder.none,
|
|
|
- fillColor: Colors.transparent,
|
|
|
- contentPadding:
|
|
|
- EdgeInsets.symmetric(vertical: 6.w, horizontal: 8.w),
|
|
|
- ),
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 22.sp,
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
- color: ColorName.primaryTextColor),
|
|
|
- cursorColor: ColorName.primaryTextColor,
|
|
|
- controller: controller.editTalkNameController),
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- Container buildTabBar(BuildContext context) {
|
|
|
- TabController tabController = DefaultTabController.of(context);
|
|
|
- tabController.addListener(() {
|
|
|
- controller.updateTabIndex(tabController.index);
|
|
|
+ } else {
|
|
|
+ return SizedBox(height: 8.h, width: double.infinity);
|
|
|
+ }
|
|
|
});
|
|
|
- return Container(
|
|
|
- decoration: const BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
- borderRadius: BorderRadius.only(
|
|
|
- topLeft: Radius.circular(12),
|
|
|
- topRight: Radius.circular(12),
|
|
|
- )),
|
|
|
- child: Obx(() {
|
|
|
- if (!controller.isEditModel) {
|
|
|
- return TabBar(
|
|
|
- labelStyle:
|
|
|
- TextStyle(fontSize: 16.sp, fontWeight: FontWeight.bold),
|
|
|
- unselectedLabelStyle: TextStyle(fontSize: 14.sp),
|
|
|
- labelColor: ColorName.primaryTextColor,
|
|
|
- unselectedLabelColor: ColorName.secondaryTextColor,
|
|
|
- labelPadding: EdgeInsets.only(top: 4.h),
|
|
|
- dividerHeight: 0,
|
|
|
- indicator: FixedSizeTabIndicator(
|
|
|
- width: 16.w,
|
|
|
- height: 3.w,
|
|
|
- radius: 3,
|
|
|
- color: ColorName.colorPrimary),
|
|
|
- tabs: controller.tabBeans.map((txt) => Tab(text: txt)).toList());
|
|
|
- } else {
|
|
|
- return SizedBox(height: 8.h, width: double.infinity);
|
|
|
- }
|
|
|
- }),
|
|
|
- );
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
@@ -233,7 +161,7 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
colors: ['#E1E9FF'.toColor(), '#F9FAFE'.toColor()],
|
|
|
begin: Alignment.topCenter,
|
|
|
end: Alignment.bottomCenter,
|
|
|
- stops: const [0.3, 1.0],
|
|
|
+ stops: const [0, 1.0],
|
|
|
),
|
|
|
));
|
|
|
}
|
|
|
@@ -256,7 +184,8 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
Widget buildTabContentView() {
|
|
|
return Expanded(
|
|
|
child: TabBarView(
|
|
|
- physics: controller.isEditModel || controller.tabIndex.value == 1
|
|
|
+ physics: controller.isEditModel ||
|
|
|
+ controller.checkTabBean.value?.isDisallowScroll == true
|
|
|
? const NeverScrollableScrollPhysics()
|
|
|
: null,
|
|
|
children: _pages,
|
|
|
@@ -359,28 +288,15 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
child: Align(
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
child: Container(
|
|
|
- margin: EdgeInsets.only(bottom: 20.h), // 设置底部偏移距离
|
|
|
+ margin: EdgeInsets.only(bottom: 20.h),
|
|
|
child: IntrinsicHeight(
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
children: [
|
|
|
- Obx(() {
|
|
|
- return Visibility(
|
|
|
- visible: controller.talkBean.value?.status.value ==
|
|
|
- TalkStatus.analysisSuccess,
|
|
|
- child: GestureDetector(
|
|
|
- onTap: () {
|
|
|
- controller.clickAIAnalysis();
|
|
|
- },
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(right: 8.w),
|
|
|
- width: 64.w,
|
|
|
- height: 64.w,
|
|
|
- child: Assets.images.iconTalkLogo.image()),
|
|
|
- ),
|
|
|
- );
|
|
|
- }),
|
|
|
- SizedBox(height: 24.h),
|
|
|
+ _buildAIAnalysisView(),
|
|
|
+ SizedBox(height: 8.h),
|
|
|
+ _buildTalkEditView(),
|
|
|
+ SizedBox(height: 10.h),
|
|
|
buildAudioView()
|
|
|
],
|
|
|
),
|
|
|
@@ -391,8 +307,70 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- buildAIAnalysisView() {
|
|
|
- return Container();
|
|
|
+ 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 _buildAIAnalysisView() {
|
|
|
+ return Obx(() {
|
|
|
+ return Visibility(
|
|
|
+ visible: controller.talkBean.value?.status.value ==
|
|
|
+ TalkStatus.analysisSuccess,
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.clickAIAnalysis();
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(right: 8.w),
|
|
|
+ width: 64.w,
|
|
|
+ height: 64.w,
|
|
|
+ child: Assets.images.iconTalkLogo.image()),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
buildAudioView() {
|
|
|
@@ -429,8 +407,6 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
SizedBox(width: 15.w),
|
|
|
Builder(builder: (context) {
|
|
|
return Flexible(
|
|
|
- // width: 226.w,
|
|
|
- // height: 18.w,
|
|
|
child: Obx(() {
|
|
|
return SliderTheme(
|
|
|
data: SliderTheme.of(context).copyWith(
|
|
|
@@ -464,29 +440,71 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Widget _buildAppbarBackView() {
|
|
|
+ Widget _buildAppbarLeftView() {
|
|
|
return Obx(() {
|
|
|
- return controller.isEditModel
|
|
|
- ? IconButton(
|
|
|
- icon: SizedBox(
|
|
|
- width: 24.w,
|
|
|
- height: 24.w,
|
|
|
- child: Assets.images.iconTalkEditCancel.image()),
|
|
|
- // Custom icon
|
|
|
- onPressed: () {
|
|
|
- controller.onEditCancel();
|
|
|
- },
|
|
|
- )
|
|
|
- : IconButton(
|
|
|
- icon: SizedBox(
|
|
|
- width: 24.w,
|
|
|
- height: 24.w,
|
|
|
- child: Assets.images.iconBack.image()),
|
|
|
- // Custom icon
|
|
|
+ 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),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ })
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -509,28 +527,13 @@ class TalkPage extends BasePage<TalkController> {
|
|
|
)
|
|
|
: Row(
|
|
|
children: [
|
|
|
- Visibility(
|
|
|
- visible: controller.tabIndex.value != 2,
|
|
|
- child: IconButton(
|
|
|
- icon: SizedBox(
|
|
|
- width: 24.w,
|
|
|
- height: 24.w,
|
|
|
- child: Assets.images.iconTalkEdit.image()),
|
|
|
- onPressed: () {
|
|
|
- controller.onEditModelClick();
|
|
|
- },
|
|
|
- ),
|
|
|
- ),
|
|
|
IconButton(
|
|
|
- icon: SizedBox(
|
|
|
- width: 24.w,
|
|
|
- height: 24.w,
|
|
|
- child: Assets.images.iconTalkShare.image()),
|
|
|
+ icon: Assets.images.iconTalkShare
|
|
|
+ .image(width: 20.w, height: 20.w),
|
|
|
onPressed: () {
|
|
|
controller.onShareClick();
|
|
|
},
|
|
|
),
|
|
|
- SizedBox(width: 12.w)
|
|
|
],
|
|
|
),
|
|
|
);
|