| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- import 'package:electronic_assistant/data/bean/agenda_list_all_bean.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),
- ],
- ),
- );
- }
- typedef TodoItemBuilder = List<Widget> Function(List<Agenda>? list);
- Widget getTodoItemView(AgendaListAllBean agenda, TodoItemBuilder builder) {
- return Container(
- decoration: BoxDecoration(
- color: ColorName.colorPrimary,
- borderRadius: BorderRadius.circular(6),
- ),
- child: Builder(builder: (context) {
- return Theme(
- data: Theme.of(context).copyWith(
- splashFactory: NoSplash.splashFactory,
- ),
- child: Container(
- margin: EdgeInsets.only(left: 4.w),
- decoration: BoxDecoration(
- color: "#F6F5F8".toColor(),
- borderRadius: const BorderRadius.only(
- topRight: Radius.circular(6),
- bottomRight: Radius.circular(6),
- ),
- ),
- 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: 12.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: builder(agenda.list),
- ),
- ),
- );
- }),
- );
- }
- typedef TodoItemClick = void Function(Agenda? agenda);
- List<Widget> getTalkAgendaSettingList(List<Agenda>? list,
- {TodoItemClick? itemClick}) {
- return list?.map((agenda) {
- return Padding(
- padding:
- EdgeInsets.only(left: 12.w, right: 12.w, top: 2.h, bottom: 10.h),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Expanded(
- child: 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)),
- ),
- ]),
- ),
- SizedBox(width: 20.w),
- GestureDetector(
- onTap: () {
- itemClick?.call(agenda);
- },
- child: Obx(() {
- return Container(
- decoration: BoxDecoration(
- color: agenda.isSetMine.value
- ? "#E7E9F6".toColor()
- : ColorName.colorPrimary,
- borderRadius: BorderRadius.circular(6),
- ),
- padding:
- EdgeInsets.symmetric(horizontal: 9.w, vertical: 5.w),
- child: Text(
- agenda.isSetMine.value
- ? StringName.talkTodoCancelMine.tr
- : StringName.talkTodoSetMine.tr,
- style: TextStyle(
- fontSize: 13.sp,
- color: agenda.isSetMine.value
- ? ColorName.colorPrimary
- : Colors.white),
- ),
- );
- }),
- )
- ],
- ),
- );
- }).toList() ??
- [];
- }
- List<Widget> getTalkAgendaNormalList(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: 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)),
- ),
- ],
- ),
- );
- }).toList() ??
- [];
- }
|