|
|
@@ -7,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
import '../../data/bean/agenda.dart';
|
|
|
+import '../../data/bean/template_bean.dart';
|
|
|
import '../../resource/assets.gen.dart';
|
|
|
import '../../resource/colors.gen.dart';
|
|
|
import '../../resource/string.gen.dart';
|
|
|
@@ -366,3 +367,69 @@ List<Widget> getTalkAgendaNormalList(List<Agenda>? list) {
|
|
|
}).toList() ??
|
|
|
[];
|
|
|
}
|
|
|
+
|
|
|
+Widget buildTemplateView(List<TemplateBean>? templateList, int? id,
|
|
|
+ {bool? isShowAdd, VoidCallback? addCallback}) {
|
|
|
+ return SizedBox(
|
|
|
+ height: 28.h,
|
|
|
+ child: ListView(
|
|
|
+ scrollDirection: Axis.horizontal,
|
|
|
+ shrinkWrap: true,
|
|
|
+ children: [
|
|
|
+ SizedBox(width: 12.w),
|
|
|
+ for (var item in templateList ?? <TemplateBean>[])
|
|
|
+ Container(
|
|
|
+ height: double.infinity,
|
|
|
+ decoration: item.id == id
|
|
|
+ ? BoxDecoration(
|
|
|
+ color: ColorName.colorPrimary,
|
|
|
+ borderRadius: BorderRadius.circular(6.w),
|
|
|
+ )
|
|
|
+ : BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(6.w),
|
|
|
+ color: "#FAF9FB".toColor(),
|
|
|
+ border: Border.all(color: '#F2EFF5'.toColor(), width: 1.w),
|
|
|
+ ),
|
|
|
+ margin: EdgeInsets.only(right: 8.w),
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 8.w),
|
|
|
+ child: Center(
|
|
|
+ child: Text(item.name ?? '',
|
|
|
+ style: TextStyle(
|
|
|
+ height: 1,
|
|
|
+ fontSize: 13.sp,
|
|
|
+ color: item.id == id
|
|
|
+ ? ColorName.white
|
|
|
+ : ColorName.secondaryTextColor)),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ _buildAddTemplateView(isShowAdd, addCallback)
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+Widget _buildAddTemplateView(bool? isShowAdd, VoidCallback? addCallback) {
|
|
|
+ return Container(
|
|
|
+ height: double.infinity,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: "#FAF9FB".toColor(),
|
|
|
+ borderRadius: BorderRadius.circular(6.w),
|
|
|
+ border: Border.all(color: '#F2EFF5'.toColor(), width: 1.w),
|
|
|
+ ),
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 8.w),
|
|
|
+ child: Center(
|
|
|
+ child: IntrinsicWidth(
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Assets.images.iconTalkAddTemplate.image(width: 16.w, height: 16.w),
|
|
|
+ Text(StringName.talkAddTemplate.tr,
|
|
|
+ style: TextStyle(
|
|
|
+ height: 1,
|
|
|
+ fontSize: 13.sp,
|
|
|
+ color: ColorName.tertiaryTextColor))
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+}
|