|
|
@@ -0,0 +1,136 @@
|
|
|
+import 'package:electronic_assistant/base/base_page.dart';
|
|
|
+import 'package:electronic_assistant/module/talk/controller.dart';
|
|
|
+import 'package:electronic_assistant/module/talk/original/view.dart';
|
|
|
+import 'package:electronic_assistant/module/talk/summary/view.dart';
|
|
|
+import 'package:electronic_assistant/module/talk/todo/view.dart';
|
|
|
+import 'package:electronic_assistant/resource/colors.gen.dart';
|
|
|
+import 'package:electronic_assistant/utils/expand.dart';
|
|
|
+import 'package:electronic_assistant/utils/fixed_size_tab_indicator.dart';
|
|
|
+import 'package:flutter/cupertino.dart';
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter/services.dart';
|
|
|
+import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
+import 'package:get/get_core/src/get_main.dart';
|
|
|
+
|
|
|
+import '../../data/bean/talks.dart';
|
|
|
+import '../../resource/assets.gen.dart';
|
|
|
+import '../../router/app_pages.dart';
|
|
|
+
|
|
|
+class TalkPage extends BasePage<TalkController> {
|
|
|
+ TalkPage({super.key});
|
|
|
+
|
|
|
+ static void start(TalkBean item) {
|
|
|
+ Get.toNamed(RoutePath.talkDetail, arguments: item);
|
|
|
+ }
|
|
|
+
|
|
|
+ final pages = [SummaryView(), TodoView(), OriginalView()];
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget buildBody(BuildContext context) {
|
|
|
+ return Stack(
|
|
|
+ children: [
|
|
|
+ buildTopGradient(),
|
|
|
+ Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ AppBar(
|
|
|
+ systemOverlayStyle: SystemUiOverlayStyle.dark,
|
|
|
+ backgroundColor: Colors.transparent,
|
|
|
+ leading: IconButton(
|
|
|
+ icon: SizedBox(
|
|
|
+ width: 24.w,
|
|
|
+ height: 24.w,
|
|
|
+ child: Assets.images.iconBack.image()),
|
|
|
+ // Custom icon
|
|
|
+ onPressed: () {
|
|
|
+ Get.back();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 12.w),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ SizedBox(height: 8.h),
|
|
|
+ Text('8月16日10时53分录音',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 22.sp,
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ color: ColorName.primaryTextColor)),
|
|
|
+ SizedBox(height: 4.h),
|
|
|
+ Text('2024-07-25 16:31',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 12.sp,
|
|
|
+ color: ColorName.secondaryTextColor)),
|
|
|
+ SizedBox(height: 14.h),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: DefaultTabController(
|
|
|
+ length: controller.tabBeans.length,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ decoration: const BoxDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topLeft: Radius.circular(12),
|
|
|
+ topRight: Radius.circular(12),
|
|
|
+ )),
|
|
|
+ child: 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()),
|
|
|
+ ),
|
|
|
+ Divider(
|
|
|
+ height: 1,
|
|
|
+ color: const Color(0xFFf6f6f6),
|
|
|
+ indent: 12.w,
|
|
|
+ endIndent: 12.w),
|
|
|
+ Expanded(
|
|
|
+ child: TabBarView(
|
|
|
+ children: pages,
|
|
|
+ ))
|
|
|
+ ],
|
|
|
+ )))
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ bool immersive() {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ Container buildTopGradient() {
|
|
|
+ return Container(
|
|
|
+ width: 1.sw,
|
|
|
+ height: 180.h,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: ['#E1E9FF'.toColor(), '#F9FAFE'.toColor()],
|
|
|
+ begin: Alignment.topCenter,
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
+ stops: const [0.3, 1.0],
|
|
|
+ ),
|
|
|
+ ));
|
|
|
+ }
|
|
|
+}
|