|
|
@@ -1,6 +1,19 @@
|
|
|
+import 'package:electronic_assistant/base/base_controller.dart';
|
|
|
import 'package:electronic_assistant/base/base_page.dart';
|
|
|
+import 'package:electronic_assistant/dialog/rename_dialog.dart';
|
|
|
+import 'package:electronic_assistant/resource/colors.gen.dart';
|
|
|
+import 'package:electronic_assistant/resource/string.gen.dart';
|
|
|
+import 'package:electronic_assistant/utils/expand.dart';
|
|
|
+import 'package:electronic_assistant/utils/toast_util.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
|
|
|
+import '../../../data/bean/agenda.dart';
|
|
|
+import '../../../data/bean/talks.dart';
|
|
|
+import '../../../resource/assets.gen.dart';
|
|
|
+import '../../../utils/common_style.dart';
|
|
|
+import '../common_view.dart';
|
|
|
import 'controller.dart';
|
|
|
|
|
|
class TodoView extends BasePage<TodoController> {
|
|
|
@@ -8,8 +21,159 @@ class TodoView extends BasePage<TodoController> {
|
|
|
|
|
|
@override
|
|
|
Widget buildBody(BuildContext context) {
|
|
|
+ return Obx(() {
|
|
|
+ return _buildTodoStatusView();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ _buildAllTaskView() {
|
|
|
+ return Padding(
|
|
|
+ padding: EdgeInsets.only(top: 6.h, bottom: 16.h),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Text(StringName.talkTodoAll.tr,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp, color: ColorName.secondaryTextColor)),
|
|
|
+ SizedBox(height: 12.h),
|
|
|
+ buildAllTodoView(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget buildAllTodoView() {
|
|
|
+ return Obx(() {
|
|
|
+ return Column(
|
|
|
+ children: controller.agendaAllList.map((agenda) {
|
|
|
+ return Padding(
|
|
|
+ padding: EdgeInsets.only(bottom: 8.h),
|
|
|
+ child: getTodoItemView(
|
|
|
+ agenda,
|
|
|
+ (list) => getTalkAgendaSettingList(list, itemClick: (agenda) {
|
|
|
+ controller.agendaTodo(agenda);
|
|
|
+ })),
|
|
|
+ );
|
|
|
+ }).toList());
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget _buildMineTodoList() {
|
|
|
+ return Builder(builder: (context) {
|
|
|
+ return Theme(
|
|
|
+ data: Theme.of(context).copyWith(
|
|
|
+ splashFactory: NoSplash.splashFactory,
|
|
|
+ ),
|
|
|
+ child: Obx(() {
|
|
|
+ return ExpansionTile(
|
|
|
+ onExpansionChanged: (value) {
|
|
|
+ controller.mineAgendaIsExpanded.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: [
|
|
|
+ Text(StringName.talkTabMyTask.tr,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp, color: ColorName.secondaryTextColor)),
|
|
|
+ const Spacer(),
|
|
|
+ Obx(() {
|
|
|
+ return Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '${controller.agendaMineList.length}${StringName.talkTodoItem.tr}',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 15.sp,
|
|
|
+ color: ColorName.secondaryTextColor),
|
|
|
+ ),
|
|
|
+ SizedBox(width: 3.w),
|
|
|
+ SizedBox(
|
|
|
+ width: 16.w,
|
|
|
+ height: 16.w,
|
|
|
+ child: controller.mineAgendaIsExpanded.value
|
|
|
+ ? Assets.images.iconTalkExpand.image()
|
|
|
+ : Assets.images.iconTalkCollapse.image()),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ SizedBox(width: 12.w),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ children: controller.agendaMineList.map((agenda) {
|
|
|
+ return _buildMineItem(agenda);
|
|
|
+ }).toList(),
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget _buildMineItem(Agenda agenda) {
|
|
|
return Container(
|
|
|
- child: Text('todo页面'),
|
|
|
+ margin: EdgeInsets.only(bottom: 8.w),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(8.0),
|
|
|
+ border: Border.all(
|
|
|
+ color: '#F6F6F6'.toColor(),
|
|
|
+ width: 2,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 17.w, horizontal: 12.w),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.only(right: 12).w,
|
|
|
+ child: Text(agenda.content ?? '',
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 15.sp,
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ color: ColorName.primaryTextColor)),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.onClickThinking(agenda);
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ decoration: getPrimaryBtnDecoration(6),
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 9, vertical: 4).w,
|
|
|
+ child: Text(
|
|
|
+ StringName.homeTalkThinking.tr,
|
|
|
+ style: TextStyle(fontSize: 13.sp, color: ColorName.white),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ Widget _buildTodoStatusView() {
|
|
|
+ if (controller.talkBean.value.status == TalkStatus.analysisFail) {
|
|
|
+ return getTalkFailView();
|
|
|
+ } else if (controller.talkBean.value.status == TalkStatus.analysing ||
|
|
|
+ controller.talkBean.value.status == TalkStatus.waitAnalysis) {
|
|
|
+ return getTalkLoadingView();
|
|
|
+ } else if (controller.talkBean.value.status == TalkStatus.analysisSuccess) {
|
|
|
+ return ListView(
|
|
|
+ padding: EdgeInsets.only(left: 12.w, right: 12.w),
|
|
|
+ children: [_buildMineTodoList(), _buildAllTaskView()],
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return Container();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|