|
|
@@ -98,92 +98,14 @@ class HomePage extends BasePage<HomePageController> {
|
|
|
),
|
|
|
padding:
|
|
|
EdgeInsets.only(left: 12.w, right: 12.w, top: 8.h, bottom: 16.h),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- child: _buildHeaderCard(
|
|
|
- StringName.homeTalkAudio.tr,
|
|
|
- StringName.homeTalkQuickAudio.tr,
|
|
|
- Assets.images.iconHomeTalkRecordCard.image().image, [
|
|
|
- "#1763F9".toColor(),
|
|
|
- "#28B2FF".toColor(),
|
|
|
- ], onTap: () {
|
|
|
- controller.onRecordClick();
|
|
|
- }),
|
|
|
- ),
|
|
|
- SizedBox(width: 8.w),
|
|
|
- Expanded(
|
|
|
- child: _buildHeaderCard(
|
|
|
- StringName.homeTalkImportAudio.tr,
|
|
|
- StringName.homeTalkAnalyzeLocalAudio.tr,
|
|
|
- Assets.images.iconHomeTalkSelectCard.image().image, [
|
|
|
- "#5869ED".toColor(),
|
|
|
- "#6E8AF7".toColor(),
|
|
|
- ], onTap: () {
|
|
|
- controller.onPickerAudioFile();
|
|
|
- }),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- Widget _buildHeaderCard(
|
|
|
- String title,
|
|
|
- String content,
|
|
|
- ImageProvider imageProvider,
|
|
|
- List<Color> bgColor, {
|
|
|
- VoidCallback? onTap,
|
|
|
- }) {
|
|
|
- return GestureDetector(
|
|
|
- onTap: onTap,
|
|
|
- child: AspectRatio(
|
|
|
- aspectRatio: 164 / 80,
|
|
|
- child: Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- begin: Alignment.topLeft,
|
|
|
- end: Alignment.bottomRight,
|
|
|
- colors: bgColor,
|
|
|
- ),
|
|
|
- borderRadius: BorderRadius.circular(12),
|
|
|
- ),
|
|
|
- child: Stack(
|
|
|
- children: [
|
|
|
- Align(
|
|
|
- alignment: Alignment.centerRight,
|
|
|
- child: AspectRatio(
|
|
|
- aspectRatio: 1,
|
|
|
- child: SizedBox(
|
|
|
- height: double.infinity,
|
|
|
- child: Image(image: imageProvider)),
|
|
|
- ),
|
|
|
- ),
|
|
|
- Align(
|
|
|
- alignment: Alignment.centerLeft,
|
|
|
- child: IntrinsicHeight(
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(left: 12.w),
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Text(title,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 16.sp,
|
|
|
- color: ColorName.white,
|
|
|
- fontWeight: FontWeight.bold)),
|
|
|
- SizedBox(height: 4.h),
|
|
|
- Text(content,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 12.sp, color: ColorName.white80)),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
+ child: getHomeHeadView(
|
|
|
+ key: controller.headGuideKey,
|
|
|
+ recordClick: () {
|
|
|
+ controller.onRecordClick();
|
|
|
+ },
|
|
|
+ pickerAudioFileClick: () {
|
|
|
+ controller.onPickerAudioFile();
|
|
|
+ },
|
|
|
),
|
|
|
),
|
|
|
);
|
|
|
@@ -598,34 +520,6 @@ class HomePage extends BasePage<HomePageController> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- void showUnfinishedRecordPopup() {
|
|
|
- SmartDialog.showAttach(
|
|
|
- targetContext: controller.todoTargetContext,
|
|
|
- alignment: Alignment.bottomRight,
|
|
|
- animationType: SmartAnimationType.fade,
|
|
|
- clickMaskDismiss: true,
|
|
|
- maskColor: Colors.transparent,
|
|
|
- bindPage: true,
|
|
|
- builder: (_) => Padding(
|
|
|
- padding: const EdgeInsets.only(top: 7).h,
|
|
|
- child: Stack(
|
|
|
- alignment: Alignment.topCenter,
|
|
|
- children: [
|
|
|
- SizedBox(
|
|
|
- width: 146.w,
|
|
|
- height: 66.w,
|
|
|
- child: Assets.images.bgAudioTodoPopup.image()),
|
|
|
- Container(
|
|
|
- alignment: Alignment.center,
|
|
|
- padding: const EdgeInsets.only(top: 17).w,
|
|
|
- width: 146.w,
|
|
|
- child: Text(StringName.homePopupTipsTxt.tr,
|
|
|
- style: TextStyle(fontSize: 14.sp, color: Colors.white)))
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- );
|
|
|
- }
|
|
|
|
|
|
void showRenameTalkDialog(TalkBean item) {
|
|
|
reNameDialog(StringName.talkRenameTitle.tr, item.title.value,
|
|
|
@@ -677,3 +571,97 @@ Widget buildAgendaEmptyView(double top, {bool isVisible = true}) {
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+Widget getHomeHeadView(
|
|
|
+ {GlobalKey? key,
|
|
|
+ VoidCallback? recordClick,
|
|
|
+ VoidCallback? pickerAudioFileClick}) {
|
|
|
+ return Row(
|
|
|
+ key: key,
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: _buildHeaderCard(
|
|
|
+ StringName.homeTalkAudio.tr,
|
|
|
+ StringName.homeTalkQuickAudio.tr,
|
|
|
+ Assets.images.iconHomeTalkRecordCard.image().image, [
|
|
|
+ "#1763F9".toColor(),
|
|
|
+ "#28B2FF".toColor(),
|
|
|
+ ], onTap: () {
|
|
|
+ recordClick?.call();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ SizedBox(width: 8.w),
|
|
|
+ Expanded(
|
|
|
+ child: _buildHeaderCard(
|
|
|
+ StringName.homeTalkImportAudio.tr,
|
|
|
+ StringName.homeTalkAnalyzeLocalAudio.tr,
|
|
|
+ Assets.images.iconHomeTalkSelectCard.image().image, [
|
|
|
+ "#5869ED".toColor(),
|
|
|
+ "#6E8AF7".toColor(),
|
|
|
+ ], onTap: () {
|
|
|
+ pickerAudioFileClick?.call();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+Widget _buildHeaderCard(
|
|
|
+ String title,
|
|
|
+ String content,
|
|
|
+ ImageProvider imageProvider,
|
|
|
+ List<Color> bgColor, {
|
|
|
+ VoidCallback? onTap,
|
|
|
+}) {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: onTap,
|
|
|
+ child: AspectRatio(
|
|
|
+ aspectRatio: 164 / 80,
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ gradient: LinearGradient(
|
|
|
+ begin: Alignment.topLeft,
|
|
|
+ end: Alignment.bottomRight,
|
|
|
+ colors: bgColor,
|
|
|
+ ),
|
|
|
+ borderRadius: BorderRadius.circular(12),
|
|
|
+ ),
|
|
|
+ child: Stack(
|
|
|
+ children: [
|
|
|
+ Align(
|
|
|
+ alignment: Alignment.centerRight,
|
|
|
+ child: AspectRatio(
|
|
|
+ aspectRatio: 1,
|
|
|
+ child: SizedBox(
|
|
|
+ height: double.infinity,
|
|
|
+ child: Image(image: imageProvider)),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Align(
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
+ child: IntrinsicHeight(
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(left: 12.w),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Text(title,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 16.sp,
|
|
|
+ color: ColorName.white,
|
|
|
+ fontWeight: FontWeight.bold)),
|
|
|
+ SizedBox(height: 4.h),
|
|
|
+ Text(content,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 12.sp, color: ColorName.white80)),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+}
|