|
|
@@ -0,0 +1,150 @@
|
|
|
+import 'package:electronic_assistant/data/bean/agenda_list_all_bean.dart';
|
|
|
+import 'package:electronic_assistant/data/bean/talk_info.dart';
|
|
|
+import 'package:electronic_assistant/dialog/rename_dialog.dart';
|
|
|
+import 'package:electronic_assistant/utils/expand.dart';
|
|
|
+import 'package:flutter/cupertino.dart';
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
+
|
|
|
+import '../../data/bean/agenda.dart';
|
|
|
+import '../../resource/assets.gen.dart';
|
|
|
+import '../../resource/colors.gen.dart';
|
|
|
+import '../../resource/string.gen.dart';
|
|
|
+
|
|
|
+Widget getTalkLoadingView() {
|
|
|
+ return SizedBox(
|
|
|
+ width: double.infinity,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ SizedBox(height: 138.h),
|
|
|
+ SizedBox(
|
|
|
+ width: 100.w,
|
|
|
+ height: 100.w,
|
|
|
+ child: Assets.anim.talkAnalyse.image()),
|
|
|
+ SizedBox(height: 12.h),
|
|
|
+ Text(StringName.talkAnalyzing.tr,
|
|
|
+ style:
|
|
|
+ TextStyle(fontSize: 14.sp, color: ColorName.secondaryTextColor))
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+Widget getTalkFailView() {
|
|
|
+ return SizedBox(
|
|
|
+ width: double.infinity,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ SizedBox(height: 111.h),
|
|
|
+ SizedBox(
|
|
|
+ width: 100.w,
|
|
|
+ height: 100.w,
|
|
|
+ child: Assets.images.iconTalkAnalyseFail.image()),
|
|
|
+ SizedBox(height: 4.h),
|
|
|
+ Text(StringName.talkAnalyseFail.tr,
|
|
|
+ style:
|
|
|
+ TextStyle(fontSize: 15.sp, color: ColorName.primaryTextColor)),
|
|
|
+ SizedBox(height: 2.h),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+Widget getTodoItemView(AgendaListAllBean agenda) {
|
|
|
+ return Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: "#F6F5F8".toColor(),
|
|
|
+ borderRadius: BorderRadius.circular(6),
|
|
|
+ ),
|
|
|
+ child: Builder(builder: (context) {
|
|
|
+ return Theme(
|
|
|
+ data: Theme.of(context).copyWith(
|
|
|
+ splashFactory: NoSplash.splashFactory,
|
|
|
+ ),
|
|
|
+ child: ExpansionTile(
|
|
|
+ onExpansionChanged: (value) {
|
|
|
+ agenda.isExpanded.value = value;
|
|
|
+ },
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
+ borderRadius: BorderRadius.circular(4.0),
|
|
|
+ side: const BorderSide(color: Colors.transparent),
|
|
|
+ ),
|
|
|
+ collapsedShape: RoundedRectangleBorder(
|
|
|
+ borderRadius: BorderRadius.circular(4.0),
|
|
|
+ side: const BorderSide(color: Colors.transparent),
|
|
|
+ ),
|
|
|
+ minTileHeight: 46.h,
|
|
|
+ showTrailingIcon: false,
|
|
|
+ childrenPadding: EdgeInsets.zero,
|
|
|
+ tilePadding: EdgeInsets.zero,
|
|
|
+ title: Row(
|
|
|
+ children: [
|
|
|
+ SizedBox(width: 16.w),
|
|
|
+ Text(agenda.name.orEmpty,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 15.sp,
|
|
|
+ color: ColorName.primaryTextColor,
|
|
|
+ fontWeight: FontWeight.bold)),
|
|
|
+ const Spacer(),
|
|
|
+ Obx(() {
|
|
|
+ return Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '${agenda.list?.length}${StringName.talkTodoItem.tr}',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 15.sp, color: ColorName.secondaryTextColor),
|
|
|
+ ),
|
|
|
+ SizedBox(width: 3.w),
|
|
|
+ SizedBox(
|
|
|
+ width: 16.w,
|
|
|
+ height: 16.w,
|
|
|
+ child: agenda.isExpanded.value
|
|
|
+ ? Assets.images.iconTalkExpand.image()
|
|
|
+ : Assets.images.iconTalkCollapse.image()),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ SizedBox(width: 12.w),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ children: getTalkAgendaList(agenda.list),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+List<Widget> getTalkAgendaList(List<Agenda>? list) {
|
|
|
+ return list?.map((agenda) {
|
|
|
+ return Padding(
|
|
|
+ padding:
|
|
|
+ EdgeInsets.only(left: 12.w, right: 12.w, top: 2.h, bottom: 10.h),
|
|
|
+ child: buildTalkNormalAgendaItem(agenda),
|
|
|
+ );
|
|
|
+ }).toList() ??
|
|
|
+ [];
|
|
|
+}
|
|
|
+
|
|
|
+Widget buildTalkNormalAgendaItem(Agenda agenda) {
|
|
|
+ return Row(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ width: 8.w,
|
|
|
+ height: 8.w,
|
|
|
+ margin: EdgeInsets.only(top: 7.h),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.colorPrimary.withOpacity(0.5),
|
|
|
+ shape: BoxShape.circle,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ SizedBox(width: 4.w),
|
|
|
+ Expanded(
|
|
|
+ child: Text(agenda.content.orEmpty,
|
|
|
+ style:
|
|
|
+ TextStyle(fontSize: 14.sp, color: ColorName.primaryTextColor)),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ );
|
|
|
+}
|