|
|
@@ -1,7 +1,12 @@
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:keyboard/base/base_view.dart';
|
|
|
+import 'package:keyboard/module/intimacy_analyse/screenshot_reply/scan_image_reply/scan_image_reply_view.dart';
|
|
|
+import 'package:nested_scroll_views/material.dart';
|
|
|
|
|
|
-import '../../../resource/string.gen.dart';
|
|
|
+import '../../../resource/colors.gen.dart';
|
|
|
+import '../../../widget/tabbar/custom_tab_indicator.dart';
|
|
|
+import 'conversation_analysis/conversation_analysis_view.dart';
|
|
|
import 'intimacy_analyse_screenshot_reply_controller.dart';
|
|
|
|
|
|
/// 亲密度分析-截图回复Tab页
|
|
|
@@ -16,6 +21,85 @@ class IntimacyAnalyseScreenshotReplyView
|
|
|
|
|
|
@override
|
|
|
Widget buildBody(BuildContext context) {
|
|
|
- return Center(child: Text(StringName.intimacyAnalyseTabScreenshotReply));
|
|
|
+ return Column(
|
|
|
+ children: [
|
|
|
+ // TabBar
|
|
|
+ _buildTabBar(),
|
|
|
+ // 内容
|
|
|
+ _buildContent(),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ /// TabBar
|
|
|
+ TabBar _buildTabBar() {
|
|
|
+ return TabBar(
|
|
|
+ // 是否可以滚动
|
|
|
+ isScrollable: true,
|
|
|
+ // 去除底部的黑线
|
|
|
+ dividerHeight: 0,
|
|
|
+ // 去除左边的边距,让Tab居中
|
|
|
+ tabAlignment: TabAlignment.start,
|
|
|
+ // 指示器的颜色
|
|
|
+ indicator: _buildGradientLineIndicator(),
|
|
|
+ // 选中时的颜色
|
|
|
+ labelStyle: TextStyle(
|
|
|
+ fontSize: 17.sp,
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ color: ColorName.white,
|
|
|
+ ),
|
|
|
+ // 未选中时的颜色
|
|
|
+ unselectedLabelStyle: TextStyle(
|
|
|
+ fontSize: 17.sp,
|
|
|
+ color: ColorName.white70,
|
|
|
+ ),
|
|
|
+ // 配置Tab数据
|
|
|
+ tabs:
|
|
|
+ controller.tabBarList.map((tab) {
|
|
|
+ return Tab(text: tab);
|
|
|
+ }).toList(),
|
|
|
+ controller: controller.tabController,
|
|
|
+ onTap: (index) {
|
|
|
+ controller.handleTabChange(index);
|
|
|
+ },
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ // 自定义渐变指示器
|
|
|
+ CustomTabIndicator _buildGradientLineIndicator() {
|
|
|
+ return CustomTabIndicator(
|
|
|
+ // 指示器的宽度
|
|
|
+ width: 16.0,
|
|
|
+ // 指示器的形状,圆角
|
|
|
+ strokeCap: StrokeCap.round,
|
|
|
+ // 设置渐变色
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [ColorName.colorBrand, ColorName.colorAuxiliary1],
|
|
|
+ begin: Alignment.centerLeft,
|
|
|
+ end: Alignment.centerRight,
|
|
|
+ ),
|
|
|
+ // 指示器距离Tab的外边距
|
|
|
+ insets: EdgeInsets.only(top: 9),
|
|
|
+ // 指示器的高度
|
|
|
+ borderSide: BorderSide(width: 4),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ /// PageView
|
|
|
+ Widget _buildContent() {
|
|
|
+ return Expanded(
|
|
|
+ child: NestedPageView(
|
|
|
+ controller: controller.pageController,
|
|
|
+ onPageChanged: (index) {
|
|
|
+ controller.handlePageChange(index);
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ // 对话分析Tab
|
|
|
+ ConversationAnalysisView(),
|
|
|
+ // 识图回复Tab
|
|
|
+ ScanImageReplyView(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
}
|
|
|
}
|