logo和名称替换
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/base_list_controller.dart';
|
||||
import 'package:wydj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:wydj/tools_base/base_list_controller.dart';
|
||||
|
||||
import 'ai_sub_type/ai_function_logic.dart';
|
||||
import 'models/ai_mod_list_model.dart';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/widget/keep_alive_widget.dart';
|
||||
|
||||
import '../../assets_tool/app_colors.dart';
|
||||
import '../../tools_base/indicator/custom_tab_indicator.dart';
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:get/get.dart';
|
||||
import '../../../alert/mine/vip_level_dialog.dart';
|
||||
import '../../../config/config.dart';
|
||||
import '../../../hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import '../../../tools_base/global_store/store.dart';
|
||||
import '../../../tools_base/loading/loading_helper.dart';
|
||||
import '../ai_sub_type/ai_function_logic.dart';
|
||||
@@ -37,7 +37,8 @@ class AiPaintLogic extends AiFunctionBaseLogic {
|
||||
|
||||
@override
|
||||
Future<void> submit() async {
|
||||
if ((globalStore.wallet?.amount ?? 0) < (int.tryParse(Config.aiDrawPrice) ?? 0)) {
|
||||
if ((globalStore.wallet?.amount ?? 0) <
|
||||
(int.tryParse(Config.aiDrawPrice) ?? 0)) {
|
||||
showVipLevelDialog(
|
||||
"当前金币不足",
|
||||
buttonTitle: '我知道了',
|
||||
|
||||
@@ -2,10 +2,10 @@ import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
|
||||
import '../../../tools_base/widget/net_image_widget.dart';
|
||||
import '../models/ai_mod_list_model.dart';
|
||||
@@ -30,7 +30,8 @@ class AiPaintPage extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
|
||||
keyboardDismissBehavior:
|
||||
ScrollViewKeyboardDismissBehavior.onDrag,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -86,31 +87,45 @@ class AiPaintPage extends StatelessWidget {
|
||||
logic.aspectRatios.length,
|
||||
(index) => Padding(
|
||||
padding: EdgeInsets.only(right: 12),
|
||||
child: InkWell(enableFeedback: false,
|
||||
child: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () {
|
||||
logic.selectIndex = index;
|
||||
logic.update();
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 8),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: logic.selectIndex == index
|
||||
? [AppColors.actionRed, AppColors.actionRed]
|
||||
? [
|
||||
AppColors.actionRed,
|
||||
AppColors.actionRed
|
||||
]
|
||||
: [
|
||||
Colors.white.withValues(alpha: .05),
|
||||
Colors.white.withValues(alpha: .05),
|
||||
Colors.white
|
||||
.withValues(alpha: .05),
|
||||
Colors.white
|
||||
.withValues(alpha: .05),
|
||||
]),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
color: logic.selectIndex == index ? null : Color(0xFF7C7C7C),
|
||||
color: logic.selectIndex == index
|
||||
? null
|
||||
: Color(0xFF7C7C7C),
|
||||
),
|
||||
height: 28,
|
||||
child: Text(
|
||||
logic.aspectRatios[index],
|
||||
style: TextStyle(
|
||||
color: logic.selectIndex == index ? Colors.white : Colors.white.withValues(alpha: .5),
|
||||
fontSize: logic.selectIndex == index ? 14 : 12,
|
||||
color: logic.selectIndex == index
|
||||
? Colors.white
|
||||
: Colors.white
|
||||
.withValues(alpha: .5),
|
||||
fontSize: logic.selectIndex == index
|
||||
? 14
|
||||
: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
@@ -160,7 +175,8 @@ class AiPaintPage extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
InkWell(enableFeedback: false,
|
||||
InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => logic.submit(),
|
||||
child: Container(
|
||||
height: 44,
|
||||
@@ -193,19 +209,23 @@ class AiPaintPage extends StatelessWidget {
|
||||
|
||||
Widget _getStyleView(AiPaintLogic logic) {
|
||||
return logic.isFold
|
||||
? InkWell(enableFeedback: false,
|
||||
? InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () {
|
||||
logic.isFold = !logic.isFold;
|
||||
logic.update();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
_buildStyleTitle(),
|
||||
Spacer(),
|
||||
NetworkImageLoader(
|
||||
imageUrl: logic.models.length > 1 ? logic.models[logic.chooseItemIndex].cover ?? "" : '',
|
||||
imageUrl: logic.models.length > 1
|
||||
? logic.models[logic.chooseItemIndex].cover ?? ""
|
||||
: '',
|
||||
width: 32,
|
||||
height: 32,
|
||||
),
|
||||
@@ -220,13 +240,15 @@ class AiPaintPage extends StatelessWidget {
|
||||
)
|
||||
: Column(
|
||||
children: [
|
||||
InkWell(enableFeedback: false,
|
||||
InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () {
|
||||
logic.isFold = !logic.isFold;
|
||||
logic.update();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10.0, vertical: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
_buildStyleTitle(),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:hgmj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/base_list_controller.dart';
|
||||
import 'package:wydj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:wydj/tools_base/base_list_controller.dart';
|
||||
|
||||
import 'ai_sub_type/ai_function_logic.dart';
|
||||
import 'models/ai_mod_list_model.dart';
|
||||
@@ -28,7 +28,8 @@ class AIFaceTemplateLogic extends ListBaseLogic<TemplateModel> {
|
||||
|
||||
void loadData() async {
|
||||
dataList ??= [];
|
||||
final resp = await AIService.getModelListV2(type: type, categoryId: mod?.id ?? '');
|
||||
final resp =
|
||||
await AIService.getModelListV2(type: type, categoryId: mod?.id ?? '');
|
||||
if (resp != null) {
|
||||
dataList?.addAll(resp.templateList ?? []);
|
||||
//默认上架时间降序
|
||||
@@ -49,18 +50,21 @@ class AIFaceTemplateLogic extends ListBaseLogic<TemplateModel> {
|
||||
switch (sortIndex) {
|
||||
case 0:
|
||||
dataList?.sort(
|
||||
(obj1, obj2) => ascending ? obj2.timestamp.compareTo(obj1.timestamp) : obj1.timestamp.compareTo(obj2.timestamp),
|
||||
(obj1, obj2) => ascending
|
||||
? obj2.timestamp.compareTo(obj1.timestamp)
|
||||
: obj1.timestamp.compareTo(obj2.timestamp),
|
||||
);
|
||||
case 1:
|
||||
dataList?.sort(
|
||||
(obj1, obj2) => ascending
|
||||
? (obj2.usedCount ?? 0).compareTo(obj1.usedCount ?? 0) :
|
||||
(obj1.usedCount ?? 0).compareTo(obj2.usedCount ?? 0),
|
||||
? (obj2.usedCount ?? 0).compareTo(obj1.usedCount ?? 0)
|
||||
: (obj1.usedCount ?? 0).compareTo(obj2.usedCount ?? 0),
|
||||
);
|
||||
case 2:
|
||||
dataList?.sort(
|
||||
(obj1, obj2) =>
|
||||
ascending ? (obj2.coin ?? 0).compareTo(obj1.coin ?? 0) : (obj1.coin ?? 0).compareTo(obj2.coin ?? 0),
|
||||
(obj1, obj2) => ascending
|
||||
? (obj2.coin ?? 0).compareTo(obj1.coin ?? 0)
|
||||
: (obj1.coin ?? 0).compareTo(obj2.coin ?? 0),
|
||||
);
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
|
||||
import '../../assets_tool/app_colors.dart';
|
||||
import 'ai_face_sub_logic.dart';
|
||||
@@ -17,7 +17,8 @@ import 'models/ai_mod_list_model.dart';
|
||||
class AIFaceChangeSubPage extends StatelessWidget {
|
||||
final AICategoryMod? mod;
|
||||
final AiType type; //图片换脸 / 视频换脸
|
||||
const AIFaceChangeSubPage({super.key, this.mod, this.type = AiType.imageChangeFace});
|
||||
const AIFaceChangeSubPage(
|
||||
{super.key, this.mod, this.type = AiType.imageChangeFace});
|
||||
|
||||
// 多分类子页作为 TabBarView 的 keepAlive children 并存,用 type+分类id 隔离各自 logic 实例
|
||||
String get _tag => 'ai_face_sub_${type.name}_${mod?.id}';
|
||||
@@ -51,7 +52,8 @@ class AIFaceChangeSubPage extends StatelessWidget {
|
||||
itemCount: logic.dataList?.length ?? 0,
|
||||
itemBuilder: (context, index) {
|
||||
TemplateModel? model = logic.dataList?[index];
|
||||
return InkWell(enableFeedback: false,
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => Get.to(AIModDetailPage(model!)),
|
||||
child: NetworkImageLoader(imageUrl: model?.cover ?? ''),
|
||||
);
|
||||
@@ -78,9 +80,11 @@ class AIFaceChangeSubPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSortItem(String title, bool ascending, int sortIndex, AIFaceTemplateLogic logic) {
|
||||
Widget _buildSortItem(
|
||||
String title, bool ascending, int sortIndex, AIFaceTemplateLogic logic) {
|
||||
final bool sel = logic.sortIndex == sortIndex;
|
||||
return InkWell(enableFeedback: false,
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => logic.changeSortAction(sortIndex),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 3),
|
||||
@@ -92,7 +96,11 @@ class AIFaceChangeSubPage extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(fontSize: 12, color: Colors.white, fontWeight: FontWeight.w500, height: 1.5),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
height: 1.5),
|
||||
),
|
||||
5.sizeBoxW,
|
||||
Column(
|
||||
@@ -100,7 +108,8 @@ class AIFaceChangeSubPage extends StatelessWidget {
|
||||
children: [
|
||||
_buildArrow(active: sel && ascending),
|
||||
4.sizeBoxH,
|
||||
Transform.rotate(angle: -pi, child: _buildArrow(active: sel && !ascending)),
|
||||
Transform.rotate(
|
||||
angle: -pi, child: _buildArrow(active: sel && !ascending)),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/debug_log.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_alert_widget.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:wydj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:wydj/tools_base/debug_log.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_alert_widget.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
|
||||
import '../models/ai_girl_resp_model.dart';
|
||||
import '../widgets/ai_girl_sheet.dart';
|
||||
@@ -54,7 +54,8 @@ class AIGrilFriendLogic extends GetxController {
|
||||
//充值操作
|
||||
onRechargeBottomSheet() async {
|
||||
if (currencys != null && currencys?.list?.isNotEmpty == true) {
|
||||
Get.bottomSheet(AIGirlSheet(list: currencys?.list), isScrollControlled: true);
|
||||
Get.bottomSheet(AIGirlSheet(list: currencys?.list),
|
||||
isScrollControlled: true);
|
||||
} else {
|
||||
await onFetchChargeList();
|
||||
if (currencys?.list?.isNotEmpty != true) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
|
||||
import '../../../hj_utils/widget_util.dart';
|
||||
import '../../../tools_base/unique_tag_mixin.dart';
|
||||
@@ -15,7 +15,8 @@ class AIGrilFriendPage extends StatefulWidget {
|
||||
State<AIGrilFriendPage> createState() => _AIGrilFriendPageState();
|
||||
}
|
||||
|
||||
class _AIGrilFriendPageState extends State<AIGrilFriendPage> with UniqueTagMixin {
|
||||
class _AIGrilFriendPageState extends State<AIGrilFriendPage>
|
||||
with UniqueTagMixin {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<AIGrilFriendLogic>(
|
||||
@@ -67,7 +68,8 @@ class _AIGrilFriendPageState extends State<AIGrilFriendPage> with UniqueTagMixin
|
||||
child: Obx(
|
||||
() => Text(
|
||||
logic.tips.value,
|
||||
style: textStyle(17, Colors.white, FontWeight.w500),
|
||||
style:
|
||||
textStyle(17, Colors.white, FontWeight.w500),
|
||||
),
|
||||
)),
|
||||
),
|
||||
@@ -77,7 +79,8 @@ class _AIGrilFriendPageState extends State<AIGrilFriendPage> with UniqueTagMixin
|
||||
child: GestureDetector(
|
||||
child: GestureDetector(
|
||||
onTap: () => Get.back(),
|
||||
child: const Icon(Icons.arrow_back_ios, size: 24, color: Colors.white),
|
||||
child: const Icon(Icons.arrow_back_ios,
|
||||
size: 24, color: Colors.white),
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -101,7 +104,8 @@ class _AIGrilFriendPageState extends State<AIGrilFriendPage> with UniqueTagMixin
|
||||
GestureDetector(
|
||||
child: GestureDetector(
|
||||
onTap: () => Get.back(),
|
||||
child: const Icon(Icons.arrow_back_ios, size: 24, color: Colors.white),
|
||||
child: const Icon(Icons.arrow_back_ios,
|
||||
size: 24, color: Colors.white),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:collection';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
|
||||
import '../../../hj_utils/widget_util.dart';
|
||||
import '../../web_page/h5_webview_settings.dart';
|
||||
@@ -27,7 +27,8 @@ class _YHYSH5ViewState extends State<AiH5Page> {
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
InAppWebView(
|
||||
initialUrlRequest: URLRequest(url: WebUri(widget.webUrl ?? "")), //h5的url
|
||||
initialUrlRequest:
|
||||
URLRequest(url: WebUri(widget.webUrl ?? "")), //h5的url
|
||||
initialSettings: h5WebViewSettings,
|
||||
initialUserScripts: UnmodifiableListView<UserScript>([]),
|
||||
),
|
||||
|
||||
@@ -2,10 +2,10 @@ import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:hgmj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:wydj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/tools_base/widget/keep_alive_widget.dart';
|
||||
|
||||
import '../../config/config.dart';
|
||||
import '../../hj_model/splash/domain_source_model.dart';
|
||||
@@ -18,7 +18,8 @@ import './ai_sub_type/ai_strip_sub_page.dart';
|
||||
import './models/ai_mod_list_model.dart';
|
||||
import 'ai_square/ai_square_page.dart';
|
||||
|
||||
class AiHomeLogic extends GetxController with GetSingleTickerProviderStateMixin {
|
||||
class AiHomeLogic extends GetxController
|
||||
with GetSingleTickerProviderStateMixin {
|
||||
bool isShowLoading = true;
|
||||
final AiType? aiType;
|
||||
// int tabIndex;
|
||||
@@ -50,7 +51,8 @@ class AiHomeLogic extends GetxController with GetSingleTickerProviderStateMixin
|
||||
//3.获取到默认进来的排序
|
||||
int? initialIndex = aiTypes?.indexWhere((model) => model.aiType == aiType);
|
||||
initialIndex = max(0, initialIndex ?? 0);
|
||||
tabCtr = TabController(initialIndex: initialIndex, length: menus.length, vsync: this)
|
||||
tabCtr = TabController(
|
||||
initialIndex: initialIndex, length: menus.length, vsync: this)
|
||||
..addListener(() {
|
||||
if (!tabCtr.indexIsChanging) {
|
||||
update(['tab']);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/widget/keep_alive_widget.dart';
|
||||
|
||||
import '../../hj_utils/widget_util.dart';
|
||||
import 'ai_home_logic.dart';
|
||||
@@ -36,7 +36,10 @@ class AiHomePage extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
'记录',
|
||||
style: textStyle(14, Colors.white.withValues(alpha: 0.55), FontWeight.w400),
|
||||
style: textStyle(
|
||||
14,
|
||||
Colors.white.withValues(alpha: 0.55),
|
||||
FontWeight.w400),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -61,7 +64,9 @@ class AiHomePage extends StatelessWidget {
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
controller: logic.tabCtr,
|
||||
children: logic.menus.map<Widget>((e) => logic.subPage(e).keepAlive).toList(),
|
||||
children: logic.menus
|
||||
.map<Widget>((e) => logic.subPage(e).keepAlive)
|
||||
.toList(),
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -100,8 +105,13 @@ class AiHomePage extends StatelessWidget {
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
color: isSelected ? Color(0xffFFC000) : Colors.white.withValues(alpha: .1),
|
||||
border: isSelected ? null : Border.all(width: 1, color: Colors.white.withValues(alpha: .35)),
|
||||
color: isSelected
|
||||
? Color(0xffFFC000)
|
||||
: Colors.white.withValues(alpha: .1),
|
||||
border: isSelected
|
||||
? null
|
||||
: Border.all(
|
||||
width: 1, color: Colors.white.withValues(alpha: .35)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -114,7 +124,10 @@ class AiHomePage extends StatelessWidget {
|
||||
4.sizeBoxW,
|
||||
Text(
|
||||
menu.aiTypeName ?? '',
|
||||
style: textStyle(12, isSelected ? Colors.black : Colors.white, FontWeight.w400),
|
||||
style: textStyle(
|
||||
12,
|
||||
isSelected ? Colors.black : Colors.white,
|
||||
FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:hgmj/tools_base/file_upload/file_upload_tool.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_alert_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/common_alert.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/file_upload/file_upload_tool.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_alert_widget.dart';
|
||||
import 'package:wydj/tools_base/widget/common_alert.dart';
|
||||
|
||||
import '../../../alert/mine/vip_level_dialog.dart';
|
||||
import '../../../hj_model/splash/ads_model.dart';
|
||||
@@ -26,7 +26,8 @@ class AiItvLogic extends GetxController {
|
||||
AiItvLogic({this.model});
|
||||
|
||||
Future<void> submit() async {
|
||||
if ((globalStore.wallet?.amount ?? 0) < (int.tryParse(Config.aiVideoPrice) ?? 0)) {
|
||||
if ((globalStore.wallet?.amount ?? 0) <
|
||||
(int.tryParse(Config.aiVideoPrice) ?? 0)) {
|
||||
showVipLevelDialog(
|
||||
"当前金币不足",
|
||||
buttonTitle: '我知道了',
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/banner/ads_banner.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/banner/ads_banner.dart';
|
||||
|
||||
import '../../../hj_model/splash/ads_model.dart';
|
||||
import '../widgets/pic_picker.dart';
|
||||
@@ -20,7 +20,8 @@ class AiItvPage extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
model?.title ?? '图生视频',
|
||||
style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 16, fontWeight: FontWeight.w600),
|
||||
),
|
||||
centerTitle: false,
|
||||
titleSpacing: -20,
|
||||
@@ -78,7 +79,10 @@ class AiItvPage extends StatelessWidget {
|
||||
18.sizeBoxH,
|
||||
Text(
|
||||
"案列鉴赏",
|
||||
style: TextStyle(fontSize: 18, color: Colors.white, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
12.sizeBoxH,
|
||||
ClipRRect(
|
||||
@@ -100,7 +104,9 @@ class AiItvPage extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
"处理一张照片的费用是 ",
|
||||
style: TextStyle(color: Colors.white.withValues(alpha: .6), fontSize: 14),
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .6),
|
||||
fontSize: 14),
|
||||
),
|
||||
Text(
|
||||
"${Config.aiVideoPrice}金币",
|
||||
@@ -112,7 +118,8 @@ class AiItvPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
18.sizeBoxH,
|
||||
InkWell(enableFeedback: false,
|
||||
InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => logic.submit(),
|
||||
child: Container(
|
||||
height: 44,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'package:easy_rich_text/easy_rich_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../hj_model/video_model.dart';
|
||||
@@ -45,7 +45,8 @@ class AIModDetailPage extends StatelessWidget {
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: InkWell(enableFeedback: false,
|
||||
child: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => logic.submit(),
|
||||
child: Container(
|
||||
height: 44,
|
||||
@@ -91,9 +92,11 @@ class AIModDetailPage extends StatelessWidget {
|
||||
),
|
||||
//视频换脸
|
||||
if (logic.isChangeVideo)
|
||||
InkWell(enableFeedback: false,
|
||||
InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () {
|
||||
VideoModel videoModel = VideoModel()..sourceURL = logic.mod.m3u8Url;
|
||||
VideoModel videoModel = VideoModel()
|
||||
..sourceURL = logic.mod.m3u8Url;
|
||||
Get.to(
|
||||
SimpleVideoPlayerPage(
|
||||
videoUrl: videoModel.realVideoUrl,
|
||||
@@ -205,7 +208,10 @@ class AIModDetailPage extends StatelessWidget {
|
||||
12.sizeBoxH,
|
||||
EasyRichText(
|
||||
'处理一张照片的费用是 ${logic.price}金币',
|
||||
defaultStyle: TextStyle(color: Color(0xff989898), fontSize: 14, fontWeight: FontWeight.w400),
|
||||
defaultStyle: TextStyle(
|
||||
color: Color(0xff989898),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400),
|
||||
patternList: [
|
||||
EasyRichTextPattern(
|
||||
targetString: '${logic.price}金币',
|
||||
@@ -218,7 +224,10 @@ class AIModDetailPage extends StatelessWidget {
|
||||
12.sizeBoxH,
|
||||
EasyRichText(
|
||||
'已抵扣 ${logic.coupon?.goodsValue ?? 0}金币',
|
||||
defaultStyle: TextStyle(color: Colors.white.withValues(alpha: .55), fontSize: 14, fontWeight: FontWeight.w400),
|
||||
defaultStyle: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .55),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400),
|
||||
patternList: [
|
||||
EasyRichTextPattern(
|
||||
targetString: '${logic.coupon?.goodsValue ?? 0}金币',
|
||||
@@ -230,7 +239,8 @@ class AIModDetailPage extends StatelessWidget {
|
||||
12.sizeBoxH,
|
||||
Row(
|
||||
children: [
|
||||
InkWell(enableFeedback: false,
|
||||
InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => logic.showCoupon(),
|
||||
child: GradientText(
|
||||
logic.coupon == null ? '使用抵扣券' : '更换抵扣券',
|
||||
@@ -245,7 +255,8 @@ class AIModDetailPage extends StatelessWidget {
|
||||
),
|
||||
if (logic.coupon != null) ...[
|
||||
12.sizeBoxW,
|
||||
InkWell(enableFeedback: false,
|
||||
InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () {
|
||||
//取消优惠券
|
||||
logic.coupon = null;
|
||||
@@ -253,7 +264,8 @@ class AIModDetailPage extends StatelessWidget {
|
||||
},
|
||||
child: Text(
|
||||
'取消',
|
||||
style: textStyle(14, Colors.white.withValues(alpha: .55), FontWeight.w400),
|
||||
style: textStyle(14, Colors.white.withValues(alpha: .55),
|
||||
FontWeight.w400),
|
||||
),
|
||||
)
|
||||
]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//ai小说
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_helper.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_helper.dart';
|
||||
|
||||
import '../../../../hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import '../ai_sub_type/ai_function_logic.dart';
|
||||
|
||||
class AINovelLogic extends AiFunctionBaseLogic {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
|
||||
import '../widgets/ai_draw_text_field.dart';
|
||||
import 'ai_novel_logic.dart';
|
||||
@@ -22,7 +22,8 @@ class AINovelSubPage extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
|
||||
keyboardDismissBehavior:
|
||||
ScrollViewKeyboardDismissBehavior.onDrag,
|
||||
padding: EdgeInsets.symmetric(horizontal: 6).copyWith(top: 12),
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -70,7 +71,8 @@ class AINovelSubPage extends StatelessWidget {
|
||||
logic.mods.length,
|
||||
(index) => Padding(
|
||||
padding: EdgeInsets.only(right: 12),
|
||||
child: InkWell(enableFeedback: false,
|
||||
child: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () {
|
||||
logic.selectIndex = index;
|
||||
logic.update();
|
||||
@@ -81,19 +83,28 @@ class AINovelSubPage extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: logic.selectIndex == index
|
||||
? [AppColors.actionRed, AppColors.actionRed]
|
||||
? [
|
||||
AppColors.actionRed,
|
||||
AppColors.actionRed
|
||||
]
|
||||
: [
|
||||
Colors.white.withValues(alpha: .05),
|
||||
Colors.white.withValues(alpha: .05),
|
||||
Colors.white
|
||||
.withValues(alpha: .05),
|
||||
Colors.white
|
||||
.withValues(alpha: .05),
|
||||
]),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
color: logic.selectIndex == index ? null : Color(0xFF7C7C7C),
|
||||
color: logic.selectIndex == index
|
||||
? null
|
||||
: Color(0xFF7C7C7C),
|
||||
),
|
||||
height: 28,
|
||||
child: Text(
|
||||
logic.mods[index],
|
||||
style: TextStyle(
|
||||
color: logic.selectIndex == index ? Colors.black : Colors.white.withValues(alpha: .5),
|
||||
color: logic.selectIndex == index
|
||||
? Colors.black
|
||||
: Colors.white.withValues(alpha: .5),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
@@ -125,7 +136,8 @@ class AINovelSubPage extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
InkWell(enableFeedback: false,
|
||||
InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => logic.submit(),
|
||||
child: Container(
|
||||
height: 44,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/tools_base/indicator/custom_tab_indicator.dart';
|
||||
import 'package:hgmj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:wydj/tools_base/indicator/custom_tab_indicator.dart';
|
||||
import 'package:wydj/tools_base/widget/keep_alive_widget.dart';
|
||||
|
||||
import '../../../hj_model/splash/domain_source_model.dart';
|
||||
import '../ai_sub_type/ai_function_logic.dart';
|
||||
@@ -65,7 +65,8 @@ class AIMainRecordPage extends StatelessWidget {
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
unselectedLabelColor: Colors.white.withValues(alpha: .35),
|
||||
unselectedLabelStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.w400),
|
||||
unselectedLabelStyle:
|
||||
const TextStyle(fontSize: 14, fontWeight: FontWeight.w400),
|
||||
indicator: CustomIndicator(
|
||||
isGradient: true,
|
||||
width: 13,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/list_base_model.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:wydj/hj_model/list_base_model.dart';
|
||||
import 'package:wydj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:hgmj/tools_base/widget/common_alert.dart';
|
||||
import 'package:wydj/tools_base/widget/common_alert.dart';
|
||||
|
||||
import '../ai_sub_type/ai_function_logic.dart';
|
||||
import '../models/ai_record_model.dart';
|
||||
@@ -41,7 +41,9 @@ class AIRecordLogic extends GetxController {
|
||||
refreshCtr?.refreshCompleted();
|
||||
}
|
||||
dataSource.addAll(res?.list ?? []);
|
||||
(res?.hasNext ?? false) ? refreshCtr?.loadComplete() : refreshCtr?.loadNoData();
|
||||
(res?.hasNext ?? false)
|
||||
? refreshCtr?.loadComplete()
|
||||
: refreshCtr?.loadNoData();
|
||||
page += 1;
|
||||
} catch (e) {
|
||||
isLoading = false;
|
||||
@@ -73,13 +75,17 @@ class AIRecordLogic extends GetxController {
|
||||
final model = dataSource[index];
|
||||
switch (aiType) {
|
||||
case AiType.aiNovel:
|
||||
return AINovelRecord(model, onDeleteCallback: () => deleteRecord(index));
|
||||
return AINovelRecord(model,
|
||||
onDeleteCallback: () => deleteRecord(index));
|
||||
case AiType.imageToVideo:
|
||||
return AIVideoRecord(model, status: sort, onDeleteCallback: () => deleteRecord(index));
|
||||
return AIVideoRecord(model,
|
||||
status: sort, onDeleteCallback: () => deleteRecord(index));
|
||||
case AiType.aiPaint:
|
||||
return AIPaintRecord(model, status: sort, onDeleteCallback: () => deleteRecord(index));
|
||||
return AIPaintRecord(model,
|
||||
status: sort, onDeleteCallback: () => deleteRecord(index));
|
||||
default: //脱衣 / 视频换脸 / 图片换脸
|
||||
return AIImageRecord(model, aiType: aiType, onDeleteCallback: () => deleteRecord(index));
|
||||
return AIImageRecord(model,
|
||||
aiType: aiType, onDeleteCallback: () => deleteRecord(index));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/refresh/pull_refresh.dart';
|
||||
import 'package:hgmj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/refresh/pull_refresh.dart';
|
||||
import 'package:wydj/tools_base/widget/keep_alive_widget.dart';
|
||||
|
||||
import '../ai_sub_type/ai_function_logic.dart';
|
||||
import 'ai_record_logic.dart';
|
||||
@@ -20,8 +20,10 @@ class AiRecordPage extends StatefulWidget {
|
||||
State<AiRecordPage> createState() => _AiRecordPageState();
|
||||
}
|
||||
|
||||
class _AiRecordPageState extends State<AiRecordPage> with SingleTickerProviderStateMixin {
|
||||
late final TabController _tabCtr = TabController(length: _subTypes.length, vsync: this);
|
||||
class _AiRecordPageState extends State<AiRecordPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late final TabController _tabCtr =
|
||||
TabController(length: _subTypes.length, vsync: this);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -39,7 +41,9 @@ class _AiRecordPageState extends State<AiRecordPage> with SingleTickerProviderSt
|
||||
controller: _tabCtr,
|
||||
children: List.generate(
|
||||
_subTypes.length,
|
||||
(index) => _AiRecordStatusList(aiType: widget.aiType, status: index + 1).keepAlive,
|
||||
(index) =>
|
||||
_AiRecordStatusList(aiType: widget.aiType, status: index + 1)
|
||||
.keepAlive,
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -58,7 +62,8 @@ class _AiRecordPageState extends State<AiRecordPage> with SingleTickerProviderSt
|
||||
decoration: BoxDecoration(
|
||||
border: index != 2
|
||||
? Border(
|
||||
right: BorderSide(width: .5, color: Colors.white.withValues(alpha: .1)),
|
||||
right: BorderSide(
|
||||
width: .5, color: Colors.white.withValues(alpha: .1)),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
@@ -69,8 +74,10 @@ class _AiRecordPageState extends State<AiRecordPage> with SingleTickerProviderSt
|
||||
padding: EdgeInsets.only(top: 10, left: 7),
|
||||
labelPadding: EdgeInsets.zero,
|
||||
tabAlignment: TabAlignment.start,
|
||||
unselectedLabelStyle: TextStyle(color: Colors.white.withValues(alpha: .35), fontSize: 14),
|
||||
labelStyle: TextStyle(color: Colors.white.withValues(alpha: .9), fontSize: 14),
|
||||
unselectedLabelStyle:
|
||||
TextStyle(color: Colors.white.withValues(alpha: .35), fontSize: 14),
|
||||
labelStyle:
|
||||
TextStyle(color: Colors.white.withValues(alpha: .9), fontSize: 14),
|
||||
indicator: const BoxDecoration(),
|
||||
);
|
||||
}
|
||||
@@ -108,7 +115,8 @@ class _AiRecordStatusList extends StatelessWidget {
|
||||
padding: EdgeInsets.only(left: 16, right: 16, top: 18),
|
||||
separatorBuilder: (_, index) => 12.sizeBoxH,
|
||||
itemCount: logic.dataSource.length,
|
||||
itemBuilder: (BuildContext context, int index) => logic.instanceChild(index),
|
||||
itemBuilder: (BuildContext context, int index) =>
|
||||
logic.instanceChild(index),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/base_list_controller.dart';
|
||||
import 'package:wydj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:wydj/tools_base/base_list_controller.dart';
|
||||
|
||||
import '../ai_mod_detail_page.dart';
|
||||
import '../ai_home_logic.dart';
|
||||
@@ -15,7 +15,8 @@ class AiSquareLogic extends ListBaseLogic<AISquareItemModel> {
|
||||
}
|
||||
|
||||
//isRefresh=true 下拉刷新 / false 上拉加载更多
|
||||
void loadData({bool isRefresh = true}) => fetchData(isRefresh: isRefresh, fetch: _fetch);
|
||||
void loadData({bool isRefresh = true}) =>
|
||||
fetchData(isRefresh: isRefresh, fetch: _fetch);
|
||||
|
||||
Future<(List<AISquareItemModel>?, bool)> _fetch(int page) async {
|
||||
final resp = await AIService.getPlazaList(page);
|
||||
@@ -44,7 +45,8 @@ class AiSquareLogic extends ListBaseLogic<AISquareItemModel> {
|
||||
Get.to(() => AIModDetailPage(mod));
|
||||
return;
|
||||
}
|
||||
final isImageFace = AiTypeCode.fromServerCode(model.type) == AiType.imageChangeFace;
|
||||
final isImageFace =
|
||||
AiTypeCode.fromServerCode(model.type) == AiType.imageChangeFace;
|
||||
Get.find<AiHomeLogic>().jumpSubModule(isImageFace ? 5 : 4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/refresh/pull_refresh.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/refresh/pull_refresh.dart';
|
||||
|
||||
import '../widgets/ai_square_cell.dart';
|
||||
import 'ai_square_logic.dart';
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/tools_base/file_upload/file_upload_tool.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_alert_widget.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:hgmj/tools_base/widget/common_alert.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:wydj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:wydj/tools_base/file_upload/file_upload_tool.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_alert_widget.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/widget/common_alert.dart';
|
||||
|
||||
import '../../../alert/mine/vip_level_dialog.dart';
|
||||
import '../../../routers/jump_router.dart';
|
||||
@@ -68,7 +68,8 @@ abstract class AiFunctionBaseLogic extends GetxController {
|
||||
|
||||
//免费次数或金币够不够本次消费
|
||||
bool canPay(int price) {
|
||||
final freeCount = (globalStore.wallet?.todayAiFreeTimes ?? 0) + (presaleProvider.remain?.todayAiUndressCount ?? 0);
|
||||
final freeCount = (globalStore.wallet?.todayAiFreeTimes ?? 0) +
|
||||
(presaleProvider.remain?.todayAiUndressCount ?? 0);
|
||||
if ((globalStore.wallet?.amount ?? 0) < price && freeCount <= 0) {
|
||||
showVipLevelDialog("当前免费次数不足或金币余额不足", buttonTitle: '去充值', vipEvent: () {
|
||||
Get.back();
|
||||
@@ -142,13 +143,19 @@ class AiStripLogic extends AiFunctionBaseLogic {
|
||||
Future<void> submit() async {
|
||||
if (!checkPic()) return;
|
||||
//预售期有免费次数先走免费,否则查金币
|
||||
if (presaleProvider.isOpen && presaleProvider.hasLimit && (presaleProvider.remain?.todayAiUndressCount ?? 0) > 0) {
|
||||
presaleProvider.remain?.todayAiUndressCount = (presaleProvider.remain?.todayAiUndressCount ?? 0) - 1;
|
||||
if (presaleProvider.isOpen &&
|
||||
presaleProvider.hasLimit &&
|
||||
(presaleProvider.remain?.todayAiUndressCount ?? 0) > 0) {
|
||||
presaleProvider.remain?.todayAiUndressCount =
|
||||
(presaleProvider.remain?.todayAiUndressCount ?? 0) - 1;
|
||||
} else {
|
||||
if (!canPay(int.tryParse(Config.aiUndressPrice) ?? 0)) return;
|
||||
}
|
||||
//传副本:提交成功回调里会清空 localPicList
|
||||
await upload([...localPicList], (urls) => AIService.generateUndress(urls, shareToAiSquare, editingCtr.text));
|
||||
await upload(
|
||||
[...localPicList],
|
||||
(urls) =>
|
||||
AIService.generateUndress(urls, shareToAiSquare, editingCtr.text));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,16 +178,22 @@ class AiFaceDetailLogic extends AiFunctionBaseLogic {
|
||||
Future<void> submit() async {
|
||||
if (!checkPic()) return;
|
||||
//预售期图片换脸有免费次数先走免费,否则查金币
|
||||
if (presaleProvider.isOpen && presaleProvider.hasLimit && (presaleProvider.remain?.todayAiUndressCount ?? 0) > 0 && !isChangeVideo) {
|
||||
presaleProvider.remain?.todayAiUndressCount = (presaleProvider.remain?.todayAiUndressCount ?? 0) - 1;
|
||||
if (presaleProvider.isOpen &&
|
||||
presaleProvider.hasLimit &&
|
||||
(presaleProvider.remain?.todayAiUndressCount ?? 0) > 0 &&
|
||||
!isChangeVideo) {
|
||||
presaleProvider.remain?.todayAiUndressCount =
|
||||
(presaleProvider.remain?.todayAiUndressCount ?? 0) - 1;
|
||||
} else {
|
||||
if (!canPay(price)) return;
|
||||
}
|
||||
await upload(
|
||||
localPicList,
|
||||
(urls) => isChangeVideo
|
||||
? AIService.generateChangeFace(urls, mod.id, coupon?.id, shareToAiSquare, editingCtr.text) //视频换脸
|
||||
: AIService.generateImg(urls.firstOrNull ?? '', mod.id ?? '', shareToAiSquare, editingCtr.text), //图片换脸
|
||||
? AIService.generateChangeFace(
|
||||
urls, mod.id, coupon?.id, shareToAiSquare, editingCtr.text) //视频换脸
|
||||
: AIService.generateImg(urls.firstOrNull ?? '', mod.id ?? '',
|
||||
shareToAiSquare, editingCtr.text), //图片换脸
|
||||
onDone: () => coupon = null,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/config/config.dart';
|
||||
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/routers/jump_router.dart';
|
||||
import 'package:hgmj/tools_base/banner/ads_banner.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/config/config.dart';
|
||||
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/routers/jump_router.dart';
|
||||
import 'package:wydj/tools_base/banner/ads_banner.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../widgets/pic_picker.dart';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:hgmj/hj_utils/text_util.dart';
|
||||
import 'package:wydj/hj_utils/text_util.dart';
|
||||
|
||||
import '../../../hj_model/splash/ads_model.dart';
|
||||
import 'ai_change_face_video_model.dart';
|
||||
@@ -18,9 +18,15 @@ class AiModList {
|
||||
|
||||
AiModList.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
aiUndressMod = (json['aiUndressMod'] as List?)?.map((e) => AdsInfoModel.fromJson(e)).toList();
|
||||
aiImgToVideoMod = (json['aiImgToVideoMod'] as List?)?.map((e) => AdsInfoModel.fromJson(e)).toList();
|
||||
aiTextToImgMod = (json['aiTextToImgMod'] as List?)?.map((e) => AiChangeFaceVideoMod.fromJson(e)).toList();
|
||||
aiUndressMod = (json['aiUndressMod'] as List?)
|
||||
?.map((e) => AdsInfoModel.fromJson(e))
|
||||
.toList();
|
||||
aiImgToVideoMod = (json['aiImgToVideoMod'] as List?)
|
||||
?.map((e) => AdsInfoModel.fromJson(e))
|
||||
.toList();
|
||||
aiTextToImgMod = (json['aiTextToImgMod'] as List?)
|
||||
?.map((e) => AiChangeFaceVideoMod.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +39,12 @@ class AiChangeModList {
|
||||
AiChangeModList.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
categoryId = json['categoryId'];
|
||||
categoryList = (json['categoryList'] as List?)?.map((e) => AICategoryMod.fromJson(e)).toList();
|
||||
templateList = (json['templateList'] as List?)?.map((e) => TemplateModel.fromJson(e)).toList();
|
||||
categoryList = (json['categoryList'] as List?)
|
||||
?.map((e) => AICategoryMod.fromJson(e))
|
||||
.toList();
|
||||
templateList = (json['templateList'] as List?)
|
||||
?.map((e) => TemplateModel.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +87,8 @@ class TemplateModel {
|
||||
int? vipCoin;
|
||||
|
||||
/// 上架时间戳,模版列表按它排序;时间解析不了按 0 排最前
|
||||
int get timestamp => DateTime.tryParse(createdAt ?? '')?.millisecondsSinceEpoch ?? 0;
|
||||
int get timestamp =>
|
||||
DateTime.tryParse(createdAt ?? '')?.millisecondsSinceEpoch ?? 0;
|
||||
|
||||
TemplateModel.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
|
||||
@@ -7,7 +7,7 @@ cover换脸后封面大图
|
||||
url换脸后视频地址
|
||||
*/
|
||||
|
||||
import 'package:hgmj/hj_utils/text_util.dart';
|
||||
import 'package:wydj/hj_utils/text_util.dart';
|
||||
|
||||
import '../../../config/address.dart';
|
||||
|
||||
@@ -41,7 +41,8 @@ class AiRecordModel {
|
||||
String? locationScene; //地点场景
|
||||
|
||||
/// 换脸结果视频地址。query 用 cdn= 而不是 VideoModel 的 c=,两边接口不同,别顺手统一
|
||||
String get realVideoUrl => "${Address.baseApiPath}/vid/h5/m3u8/$url?token=${Address.token}&cdn=${Address.cdnAddress}";
|
||||
String get realVideoUrl =>
|
||||
"${Address.baseApiPath}/vid/h5/m3u8/$url?token=${Address.token}&cdn=${Address.cdnAddress}";
|
||||
|
||||
AiRecordModel.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/mine_service.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/refresh/pull_refresh.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_utils/api_service/mine_service.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/refresh/pull_refresh.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:hgmj/tools_base/widget/sheet_handle_bar.dart';
|
||||
import 'package:wydj/tools_base/widget/sheet_handle_bar.dart';
|
||||
|
||||
import '../../../hj_utils/widget_util.dart';
|
||||
import '../../mine/mine_vip/coupon_model.dart';
|
||||
@@ -42,7 +42,9 @@ class _AICouponSheetState extends State<AICouponSheet> {
|
||||
dataList ??= []; //首屏失败也要退出 loading,否则永远转圈
|
||||
setState(() {});
|
||||
if (page == 1) refreshCtr?.refreshCompleted();
|
||||
(res?.length ?? 0) < size ? refreshCtr?.loadNoData() : refreshCtr?.loadComplete();
|
||||
(res?.length ?? 0) < size
|
||||
? refreshCtr?.loadNoData()
|
||||
: refreshCtr?.loadComplete();
|
||||
}
|
||||
|
||||
Future<void> loadMore() => loadData(page: curPage + 1);
|
||||
@@ -59,7 +61,9 @@ class _AICouponSheetState extends State<AICouponSheet> {
|
||||
children: [
|
||||
const SheetHandleBar(),
|
||||
18.sizeBoxH,
|
||||
Text('使用抵扣券', style: textStyle(18, Colors.white.withValues(alpha: .9), FontWeight.w600)),
|
||||
Text('使用抵扣券',
|
||||
style: textStyle(
|
||||
18, Colors.white.withValues(alpha: .9), FontWeight.w600)),
|
||||
18.sizeBoxH,
|
||||
Expanded(child: _list()),
|
||||
],
|
||||
@@ -92,12 +96,14 @@ class _AICouponSheetState extends State<AICouponSheet> {
|
||||
alignment: Alignment.center,
|
||||
height: 68,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(image: AssetImage('ai_coupon_bg.webp'.aiPath), fit: BoxFit.fill),
|
||||
image: DecorationImage(
|
||||
image: AssetImage('ai_coupon_bg.webp'.aiPath), fit: BoxFit.fill),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
18.sizeBoxW,
|
||||
Text('${model.goodsName}', style: textStyle(18, couponText, FontWeight.w600)),
|
||||
Text('${model.goodsName}',
|
||||
style: textStyle(18, couponText, FontWeight.w600)),
|
||||
12.sizeBoxW,
|
||||
Expanded(
|
||||
child: Text(
|
||||
@@ -116,7 +122,8 @@ class _AICouponSheetState extends State<AICouponSheet> {
|
||||
color: const Color(0xffFFDCB3),
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
),
|
||||
child: Text('立即使用', style: textStyle(12, Color(0xFF7F0000), FontWeight.w400)),
|
||||
child: Text('立即使用',
|
||||
style: textStyle(12, Color(0xFF7F0000), FontWeight.w400)),
|
||||
),
|
||||
18.sizeBoxW,
|
||||
],
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:hgmj/routers/jump_router.dart';
|
||||
import 'package:hgmj/tools_base/debug_log.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_alert_widget.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:hgmj/tools_base/widget/sheet_handle_bar.dart';
|
||||
import 'package:wydj/hj_utils/api_service/ai_service.dart';
|
||||
import 'package:wydj/routers/jump_router.dart';
|
||||
import 'package:wydj/tools_base/debug_log.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_alert_widget.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/widget/sheet_handle_bar.dart';
|
||||
|
||||
import '../../../hj_utils/widget_util.dart';
|
||||
import '../models/ai_girl_resp_model.dart';
|
||||
@@ -26,7 +26,8 @@ class _AIGirlSheetState extends State<AIGirlSheet> {
|
||||
List<AIGirlFriendCurrency> get _items => widget.list ?? [];
|
||||
|
||||
//列表可能为空,取不到就没得选
|
||||
AIGirlFriendCurrency? get _selected => selectIndex < _items.length ? _items[selectIndex] : null;
|
||||
AIGirlFriendCurrency? get _selected =>
|
||||
selectIndex < _items.length ? _items[selectIndex] : null;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -44,9 +45,12 @@ class _AIGirlSheetState extends State<AIGirlSheet> {
|
||||
const SheetHandleBar(color: Color(0x1AFFFFFF)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 18, bottom: 12),
|
||||
child: Text('AI女友', style: textStyle(20, Colors.white, FontWeight.w600)),
|
||||
child: Text('AI女友',
|
||||
style: textStyle(20, Colors.white, FontWeight.w600)),
|
||||
),
|
||||
Text('充值积分', style: textStyle(14, Colors.white.withValues(alpha: .8), FontWeight.w400)),
|
||||
Text('充值积分',
|
||||
style: textStyle(
|
||||
14, Colors.white.withValues(alpha: .8), FontWeight.w400)),
|
||||
GridView.builder(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18),
|
||||
shrinkWrap: true,
|
||||
@@ -65,11 +69,13 @@ class _AIGirlSheetState extends State<AIGirlSheet> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('支付小贴士:', style: textStyle(14, Colors.white, FontWeight.w500)),
|
||||
Text('支付小贴士:',
|
||||
style: textStyle(14, Colors.white, FontWeight.w500)),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
'1.因超时支付无法到账,请重新发起。\n2.连续发起且未支付,账号可能被加入黑名单\n3.充值成功后会在1~5分钟内到账,可重新刷新进入当前页面',
|
||||
style: textStyle(12, Colors.white.withValues(alpha: .6), FontWeight.w400),
|
||||
style: textStyle(12, Colors.white.withValues(alpha: .6),
|
||||
FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -83,7 +89,12 @@ class _AIGirlSheetState extends State<AIGirlSheet> {
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xff1E3C72), Color(0xff5F40B6), Color(0xff1E3C72), Color(0xff2A5298)],
|
||||
colors: [
|
||||
Color(0xff1E3C72),
|
||||
Color(0xff5F40B6),
|
||||
Color(0xff1E3C72),
|
||||
Color(0xff2A5298)
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
@@ -109,10 +120,14 @@ class _AIGirlSheetState extends State<AIGirlSheet> {
|
||||
onTap: () => setState(() => selectIndex = index),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? const Color(0xff4039A1) : Colors.white.withValues(alpha: .05),
|
||||
color: isSelected
|
||||
? const Color(0xff4039A1)
|
||||
: Colors.white.withValues(alpha: .05),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(
|
||||
color: isSelected ? const Color(0xff30509C) : Colors.white.withValues(alpha: .1),
|
||||
color: isSelected
|
||||
? const Color(0xff30509C)
|
||||
: Colors.white.withValues(alpha: .1),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
@@ -120,14 +135,21 @@ class _AIGirlSheetState extends State<AIGirlSheet> {
|
||||
children: [
|
||||
Text(
|
||||
'${item.coins ?? 0}积分',
|
||||
style: textStyle(16, isSelected ? const Color(0xffAFABFF) : const Color(0xff7D95D5), FontWeight.w400),
|
||||
style: textStyle(
|
||||
16,
|
||||
isSelected
|
||||
? const Color(0xffAFABFF)
|
||||
: const Color(0xff7D95D5),
|
||||
FontWeight.w400),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'${(item.price ?? 0).truncate()}金币',
|
||||
style: textStyle(
|
||||
12,
|
||||
isSelected ? const Color(0x4DF3F5FF) : Colors.white.withValues(alpha: .3),
|
||||
isSelected
|
||||
? const Color(0x4DF3F5FF)
|
||||
: Colors.white.withValues(alpha: .3),
|
||||
FontWeight.w400,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/hj_model/video_model.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:hgmj/tools_base/video_download/video_cache_store.dart';
|
||||
import 'package:hgmj/tools_base/video_download/video_download_manager.dart';
|
||||
import 'package:hgmj/tools_base/widget/image_browser_page.dart';
|
||||
import 'package:wydj/hj_model/video_model.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/video_download/video_cache_store.dart';
|
||||
import 'package:wydj/tools_base/video_download/video_download_manager.dart';
|
||||
import 'package:wydj/tools_base/widget/image_browser_page.dart';
|
||||
|
||||
import '../../video/simple_video_player_page.dart';
|
||||
import '../ai_sub_type/ai_function_logic.dart';
|
||||
@@ -39,7 +39,8 @@ class AIImageRecord extends StatelessWidget {
|
||||
final AiType aiType;
|
||||
final VoidCallback? onDeleteCallback;
|
||||
|
||||
const AIImageRecord(this.model, {super.key, this.aiType = AiType.autoStrip, this.onDeleteCallback});
|
||||
const AIImageRecord(this.model,
|
||||
{super.key, this.aiType = AiType.autoStrip, this.onDeleteCallback});
|
||||
|
||||
bool get isVideoFace => aiType.isVideoFace;
|
||||
|
||||
@@ -110,7 +111,8 @@ class AIImageRecord extends StatelessWidget {
|
||||
String get _resultCover {
|
||||
if (_state == AIRecordState.success) {
|
||||
//视频换脸有的成功订单后端不回 cover,退回素材封面,别让结果位空着露占位图
|
||||
if (isVideoFace) return model.cover?.isNotEmpty == true ? model.cover! : _sourceCover;
|
||||
if (isVideoFace)
|
||||
return model.cover?.isNotEmpty == true ? model.cover! : _sourceCover;
|
||||
return model.newPic?.firstOrNull ?? '';
|
||||
}
|
||||
if (isVideoFace) return model.picture?.firstOrNull ?? '';
|
||||
@@ -124,14 +126,17 @@ class AIImageRecord extends StatelessWidget {
|
||||
ImageBrowserPage.open([images.first], showSaveButton: true);
|
||||
return;
|
||||
}
|
||||
final isCached = await VideoCacheStore.instance.isExistLoadVideoByUrl(MediaStyle.Video, model.url ?? '');
|
||||
final isCached = await VideoCacheStore.instance
|
||||
.isExistLoadVideoByUrl(MediaStyle.Video, model.url ?? '');
|
||||
if (isCached) {
|
||||
showToast('你已经添加过缓存了');
|
||||
return;
|
||||
}
|
||||
|
||||
/// VideoDownloadManager下载到了 应用的外部私有目录中,无需动态权限
|
||||
/// if (!await _checkPermission()) return;
|
||||
final result = await VideoDownloadManager.instance.download(url: model.url ?? '');
|
||||
final result =
|
||||
await VideoDownloadManager.instance.download(url: model.url ?? '');
|
||||
if (result != null) return;
|
||||
final viewModel = VideoModel()
|
||||
..sourceURL = model.url
|
||||
@@ -147,7 +152,8 @@ class AIImageRecord extends StatelessWidget {
|
||||
//视频换脸的结果位单独接播放器,链接由 VideoModel 拼(和 AiRecordModel.realVideoUrl 的 query 不一样)
|
||||
void _playResultVideo() {
|
||||
final videoModel = VideoModel()..sourceURL = model.url;
|
||||
Get.to(SimpleVideoPlayerPage(videoUrl: videoModel.realVideoUrl, title: 'AI生成视频'));
|
||||
Get.to(SimpleVideoPlayerPage(
|
||||
videoUrl: videoModel.realVideoUrl, title: 'AI生成视频'));
|
||||
}
|
||||
|
||||
//三张图:模版 + 素材 = 结果
|
||||
@@ -164,7 +170,10 @@ class AIImageRecord extends StatelessWidget {
|
||||
),
|
||||
const AIRecordJoin(gap: 3.5),
|
||||
],
|
||||
AIRecordThumb(imageUrl: _sourceCover, badge: const AISourceBadge(isTemplate: false), width: 90.w),
|
||||
AIRecordThumb(
|
||||
imageUrl: _sourceCover,
|
||||
badge: const AISourceBadge(isTemplate: false),
|
||||
width: 90.w),
|
||||
const AIRecordJoin(isEquals: true, gap: 3.5),
|
||||
AIResultThumb(
|
||||
imageUrl: _resultCover,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
|
||||
import '../models/ai_change_face_video_model.dart';
|
||||
|
||||
@@ -10,7 +10,8 @@ class AIModCell extends StatelessWidget {
|
||||
final bool isSelected;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
const AIModCell({super.key, required this.mod, this.isSelected = false, this.onTap});
|
||||
const AIModCell(
|
||||
{super.key, required this.mod, this.isSelected = false, this.onTap});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -28,7 +29,9 @@ class AIModCell extends StatelessWidget {
|
||||
right: 8,
|
||||
top: 8,
|
||||
child: Image.asset(
|
||||
isSelected ? 'radio_select.png'.commonImgPath : 'ai_draw_unselected.png'.aiPath,
|
||||
isSelected
|
||||
? 'radio_select.png'.commonImgPath
|
||||
: 'ai_draw_unselected.png'.aiPath,
|
||||
width: 20,
|
||||
),
|
||||
),
|
||||
@@ -38,7 +41,10 @@ class AIModCell extends StatelessWidget {
|
||||
const Spacer(),
|
||||
Text(
|
||||
mod.title ?? '',
|
||||
style: TextStyle(color: Colors.white.withValues(alpha: .8), fontSize: 14, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: .8),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:hgmj/tools_base/widget/image_browser_page.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/widget/image_browser_page.dart';
|
||||
|
||||
import '../models/ai_record_model.dart';
|
||||
import 'ai_record_parts.dart';
|
||||
@@ -11,7 +11,8 @@ class AIPaintRecord extends StatelessWidget {
|
||||
final int status; // 1 排队 2 成功 3 失败
|
||||
final VoidCallback? onDeleteCallback;
|
||||
|
||||
const AIPaintRecord(this.model, {super.key, required this.status, this.onDeleteCallback});
|
||||
const AIPaintRecord(this.model,
|
||||
{super.key, required this.status, this.onDeleteCallback});
|
||||
|
||||
AIRecordState get _state => switch (status) {
|
||||
2 => AIRecordState.success,
|
||||
@@ -22,10 +23,13 @@ class AIPaintRecord extends StatelessWidget {
|
||||
/// 排队/失败没有结果图,退回模版封面占位。
|
||||
/// 后端在这个接口里放模版封面的字段不固定(styleUrl 常为空),挨个兜一遍,别露占位图
|
||||
String get _templateCover =>
|
||||
[model.styleUrl, model.cover, model.modCover, model.modPic].firstWhere((e) => e?.isNotEmpty == true, orElse: () => '') ?? '';
|
||||
[model.styleUrl, model.cover, model.modCover, model.modPic]
|
||||
.firstWhere((e) => e?.isNotEmpty == true, orElse: () => '') ??
|
||||
'';
|
||||
|
||||
//只有成功才是真结果图;未知 status 按排队处理,与 _state 的口径保持一致
|
||||
String get _resultCover => status == 2 ? (model.newImgUrl ?? '') : _templateCover;
|
||||
String get _resultCover =>
|
||||
status == 2 ? (model.newImgUrl ?? '') : _templateCover;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -71,7 +75,10 @@ class AIPaintRecord extends StatelessWidget {
|
||||
AIResultThumb(
|
||||
imageUrl: _resultCover,
|
||||
state: _state,
|
||||
onTap: _resultCover.isEmpty ? null : () => ImageBrowserPage.open([_resultCover], showSaveButton: true),
|
||||
onTap: _resultCover.isEmpty
|
||||
? null
|
||||
: () =>
|
||||
ImageBrowserPage.open([_resultCover], showSaveButton: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_utils/date_time_util.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/widget/common_alert.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_utils/date_time_util.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/widget/common_alert.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
|
||||
import '../../../hj_utils/widget_util.dart';
|
||||
|
||||
@@ -13,7 +13,8 @@ import '../../../hj_utils/widget_util.dart';
|
||||
enum AIRecordState { queuing, success, failed }
|
||||
|
||||
/// 失败原因:接口没给就退回通用文案。底部文案和失败弹窗共用,改一处即可
|
||||
String _failedText(String? remark) => remark?.isNotEmpty == true ? remark! : '生成失败';
|
||||
String _failedText(String? remark) =>
|
||||
remark?.isNotEmpty == true ? remark! : '生成失败';
|
||||
|
||||
/// 记录卡:白 5% 底 + 12 圆角,版式固定为
|
||||
/// 创建时间/删除 → 内容 → 细线 → 状态胶囊/下载或失败原因。
|
||||
@@ -60,7 +61,11 @@ class AIRecordCard extends StatelessWidget {
|
||||
12.sizeBoxH,
|
||||
0.5.line,
|
||||
12.sizeBoxH,
|
||||
AIRecordFooter(state: state, remark: remark, onDownload: onDownload, onStatusTap: onStatusTap),
|
||||
AIRecordFooter(
|
||||
state: state,
|
||||
remark: remark,
|
||||
onDownload: onDownload,
|
||||
onStatusTap: onStatusTap),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -68,7 +73,8 @@ class AIRecordCard extends StatelessWidget {
|
||||
//失败原因底部只放得下两行,点卡片看全文。四类记录都走这里,别再各自实现
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque, //卡片内的空白也要能点
|
||||
onTap: () => CommonAlert.show(title: '失败原因', content: _failedText(remark), showCancel: false),
|
||||
onTap: () => CommonAlert.show(
|
||||
title: '失败原因', content: _failedText(remark), showCancel: false),
|
||||
child: card,
|
||||
);
|
||||
}
|
||||
@@ -108,7 +114,12 @@ class AIRecordFooter extends StatelessWidget {
|
||||
final VoidCallback? onDownload;
|
||||
final VoidCallback? onStatusTap;
|
||||
|
||||
const AIRecordFooter({super.key, required this.state, this.remark, this.onDownload, this.onStatusTap});
|
||||
const AIRecordFooter(
|
||||
{super.key,
|
||||
required this.state,
|
||||
this.remark,
|
||||
this.onDownload,
|
||||
this.onStatusTap});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -117,7 +128,8 @@ class AIRecordFooter extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
AIStatusPill(state, onTap: state == AIRecordState.success ? onStatusTap : null),
|
||||
AIStatusPill(state,
|
||||
onTap: state == AIRecordState.success ? onStatusTap : null),
|
||||
if (state == AIRecordState.success && onDownload != null)
|
||||
AIDownloadBtn(onTap: onDownload)
|
||||
else if (state == AIRecordState.failed)
|
||||
@@ -154,13 +166,18 @@ class AIStatusPill extends StatelessWidget {
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
||||
decoration:
|
||||
isFailed ? null : BoxDecoration(color: const Color(0x1AFFDB9E), borderRadius: BorderRadius.circular(3)),
|
||||
decoration: isFailed
|
||||
? null
|
||||
: BoxDecoration(
|
||||
color: const Color(0x1AFFDB9E),
|
||||
borderRadius: BorderRadius.circular(3)),
|
||||
child: Text(
|
||||
text,
|
||||
style: textStyle(
|
||||
13,
|
||||
isFailed ? Colors.white.withValues(alpha: .55) : const Color(0xffFFDB9E),
|
||||
isFailed
|
||||
? Colors.white.withValues(alpha: .55)
|
||||
: const Color(0xffFFDB9E),
|
||||
FontWeight.w400,
|
||||
),
|
||||
),
|
||||
@@ -183,14 +200,16 @@ class AIDownloadBtn extends StatelessWidget {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(width: 0.5, color: Colors.white.withValues(alpha: .15)),
|
||||
border: Border.all(
|
||||
width: 0.5, color: Colors.white.withValues(alpha: .15)),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset('icon_ai_download.png'.aiPath, width: 18),
|
||||
2.5.sizeBoxW,
|
||||
const Text('一键下载', style: TextStyle(color: Colors.white, fontSize: 12)),
|
||||
const Text('一键下载',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -206,7 +225,8 @@ class AIRecordThumb extends StatelessWidget {
|
||||
final VoidCallback? onTap;
|
||||
final double width;
|
||||
|
||||
const AIRecordThumb({super.key, this.imageUrl, this.badge, this.onTap, this.width = 90});
|
||||
const AIRecordThumb(
|
||||
{super.key, this.imageUrl, this.badge, this.onTap, this.width = 90});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -222,7 +242,11 @@ class AIRecordThumb extends StatelessWidget {
|
||||
color: Color(0xff262626),
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
),
|
||||
child: NetworkImageLoader(imageUrl: imageUrl, width: width, height: 90, borderRadius: 8),
|
||||
child: NetworkImageLoader(
|
||||
imageUrl: imageUrl,
|
||||
width: width,
|
||||
height: 90,
|
||||
borderRadius: 8),
|
||||
),
|
||||
if (badge != null) badge!,
|
||||
],
|
||||
@@ -239,7 +263,12 @@ class AIResultThumb extends StatelessWidget {
|
||||
final VoidCallback? onTap;
|
||||
final double width;
|
||||
|
||||
const AIResultThumb({super.key, this.imageUrl, required this.state, this.onTap, this.width = 90});
|
||||
const AIResultThumb(
|
||||
{super.key,
|
||||
this.imageUrl,
|
||||
required this.state,
|
||||
this.onTap,
|
||||
this.width = 90});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -260,7 +289,10 @@ class AIResultThumb extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
if (state == AIRecordState.failed)
|
||||
Positioned.fill(child: Center(child: Image.asset('ai_record_failed.webp'.aiPath, width: 20))),
|
||||
Positioned.fill(
|
||||
child: Center(
|
||||
child:
|
||||
Image.asset('ai_record_failed.webp'.aiPath, width: 20))),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_page/video/simple_video_player_page.dart';
|
||||
import 'package:hgmj/hj_utils/date_time_util.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/widget/header_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_page/video/simple_video_player_page.dart';
|
||||
import 'package:wydj/hj_utils/date_time_util.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/widget/header_widget.dart';
|
||||
import 'package:wydj/tools_base/widget/net_image_widget.dart';
|
||||
|
||||
import '../../../hj_utils/widget_util.dart';
|
||||
import 'package:hgmj/tools_base/widget/image_browser_page.dart';
|
||||
import 'package:wydj/tools_base/widget/image_browser_page.dart';
|
||||
import '../ai_sub_type/ai_function_logic.dart';
|
||||
import '../models/ai_square_model.dart';
|
||||
|
||||
@@ -39,7 +39,9 @@ class AISquareCell extends StatelessWidget {
|
||||
|
||||
Widget _imgView() {
|
||||
return switch (AiTypeCode.fromServerCode(model.type)) {
|
||||
AiType.imageChangeFace || AiType.autoStrip => _twoImgsView(model.originalImage, model.generateImage),
|
||||
AiType.imageChangeFace ||
|
||||
AiType.autoStrip =>
|
||||
_twoImgsView(model.originalImage, model.generateImage),
|
||||
AiType.videoChangeFace => _videoChangeFace(),
|
||||
AiType.imageToVideo => _imgToVideo(),
|
||||
AiType.aiPaint => _aiDraw(),
|
||||
@@ -53,20 +55,24 @@ class AISquareCell extends StatelessWidget {
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => ImageBrowserPage.open([left ?? ''], showSaveButton: true),
|
||||
onTap: () =>
|
||||
ImageBrowserPage.open([left ?? ''], showSaveButton: true),
|
||||
child: NetworkImageLoader(
|
||||
imageUrl: left,
|
||||
imgBorderRadius: const BorderRadius.horizontal(left: Radius.circular(9)),
|
||||
imgBorderRadius:
|
||||
const BorderRadius.horizontal(left: Radius.circular(9)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => ImageBrowserPage.open([right ?? ''], showSaveButton: true),
|
||||
onTap: () =>
|
||||
ImageBrowserPage.open([right ?? ''], showSaveButton: true),
|
||||
child: NetworkImageLoader(
|
||||
imageUrl: right,
|
||||
imgBorderRadius: const BorderRadius.horizontal(right: Radius.circular(9)),
|
||||
imgBorderRadius:
|
||||
const BorderRadius.horizontal(right: Radius.circular(9)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -80,7 +86,10 @@ class AISquareCell extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
'“${model.originContent ?? ''}”',
|
||||
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xff03FCEB)),
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xff03FCEB)),
|
||||
),
|
||||
12.sizeBoxH,
|
||||
Row(
|
||||
@@ -88,7 +97,8 @@ class AISquareCell extends StatelessWidget {
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => ImageBrowserPage.open([model.generateImage ?? ''], showSaveButton: true),
|
||||
onTap: () => ImageBrowserPage.open([model.generateImage ?? ''],
|
||||
showSaveButton: true),
|
||||
child: NetworkImageLoader(imageUrl: model.generateImage),
|
||||
),
|
||||
),
|
||||
@@ -113,7 +123,9 @@ class AISquareCell extends StatelessWidget {
|
||||
Widget _videoChangeFace() {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(child: _videoItem(model.generateVideoCover, model.realGenerateVideoUrl)),
|
||||
Expanded(
|
||||
child: _videoItem(
|
||||
model.generateVideoCover, model.realGenerateVideoUrl)),
|
||||
10.sizeBoxW,
|
||||
const Expanded(child: SizedBox.shrink()),
|
||||
],
|
||||
@@ -141,7 +153,10 @@ class AISquareCell extends StatelessWidget {
|
||||
style: textStyle(10, Colors.white, FontWeight.w500),
|
||||
),
|
||||
)),
|
||||
TextSpan(text: model.title, style: textStyle(14, Colors.white.withValues(alpha: .9), FontWeight.w500))
|
||||
TextSpan(
|
||||
text: model.title,
|
||||
style: textStyle(
|
||||
14, Colors.white.withValues(alpha: .9), FontWeight.w500))
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -175,7 +190,8 @@ class AISquareCell extends StatelessWidget {
|
||||
10.sizeBoxW,
|
||||
Text(
|
||||
DateTimeUtil.utcTurnYear(model.reviewAt),
|
||||
style: textStyle(12, Colors.white.withValues(alpha: 0.55), FontWeight.w400),
|
||||
style: textStyle(12, Colors.white.withValues(alpha: 0.55),
|
||||
FontWeight.w400),
|
||||
)
|
||||
],
|
||||
)
|
||||
@@ -189,7 +205,9 @@ class AISquareCell extends StatelessWidget {
|
||||
width: 70,
|
||||
height: 24,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(3), color: AppColors.actionRed),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
color: AppColors.actionRed),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@@ -218,7 +236,8 @@ class AISquareCell extends StatelessWidget {
|
||||
Widget _videoItem(String? img, String url) {
|
||||
return InkWell(
|
||||
enableFeedback: false,
|
||||
onTap: () => Get.to(() => SimpleVideoPlayerPage(videoUrl: url, title: model.title ?? '')),
|
||||
onTap: () => Get.to(
|
||||
() => SimpleVideoPlayerPage(videoUrl: url, title: model.title ?? '')),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:hgmj/tools_base/widget/image_browser_page.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'package:wydj/tools_base/widget/image_browser_page.dart';
|
||||
|
||||
import '../models/ai_record_model.dart';
|
||||
import 'ai_record_parts.dart';
|
||||
@@ -12,7 +12,8 @@ class AIVideoRecord extends StatelessWidget {
|
||||
final int status; // 1 排队 2 成功 3 失败
|
||||
final VoidCallback? onDeleteCallback;
|
||||
|
||||
const AIVideoRecord(this.model, {super.key, required this.status, this.onDeleteCallback});
|
||||
const AIVideoRecord(this.model,
|
||||
{super.key, required this.status, this.onDeleteCallback});
|
||||
|
||||
AIRecordState get _state => switch (status) {
|
||||
2 => AIRecordState.success,
|
||||
@@ -20,7 +21,8 @@ class AIVideoRecord extends StatelessWidget {
|
||||
_ => AIRecordState.queuing,
|
||||
};
|
||||
|
||||
String get _resultCover => model.status == 3 ? (model.newImgUrl ?? '') : (model.imgUrl ?? '');
|
||||
String get _resultCover =>
|
||||
model.status == 3 ? (model.newImgUrl ?? '') : (model.imgUrl ?? '');
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -51,13 +53,17 @@ class AIVideoRecord extends StatelessWidget {
|
||||
children: [
|
||||
AIRecordThumb(
|
||||
imageUrl: model.imgUrl,
|
||||
badge: Image.asset('ai_record_org.png'.aiPath, width: 36, height: 18),
|
||||
badge:
|
||||
Image.asset('ai_record_org.png'.aiPath, width: 36, height: 18),
|
||||
),
|
||||
const AIRecordJoin(isEquals: true),
|
||||
AIResultThumb(
|
||||
imageUrl: _resultCover,
|
||||
state: _state,
|
||||
onTap: _resultCover.isEmpty ? null : () => ImageBrowserPage.open([_resultCover], showSaveButton: true),
|
||||
onTap: _resultCover.isEmpty
|
||||
? null
|
||||
: () =>
|
||||
ImageBrowserPage.open([_resultCover], showSaveButton: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2,10 +2,10 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image_pickers/image_pickers.dart';
|
||||
import 'package:hgmj/assets_tool/app_colors.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/tools_base/toast.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:wydj/assets_tool/app_colors.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/tools_base/toast.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:mobkit_dashed_border/mobkit_dashed_border.dart';
|
||||
|
||||
/// AI 功能的单图选择器:未选时是虚线占位框,选后是缩略图 + 右上角删除
|
||||
@@ -54,7 +54,8 @@ class _PicPickerState extends State<PicPicker> {
|
||||
selectCount: 1,
|
||||
showCamera: true,
|
||||
);
|
||||
final paths = medias.map((e) => e.path ?? "").where((e) => e.isNotEmpty).toList();
|
||||
final paths =
|
||||
medias.map((e) => e.path ?? "").where((e) => e.isNotEmpty).toList();
|
||||
if (paths.length < medias.length) showToast("添加图片失败");
|
||||
return paths;
|
||||
}
|
||||
@@ -92,7 +93,8 @@ class _PicPickerState extends State<PicPicker> {
|
||||
onTap: _delPic,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Image.asset("close_grey.png".commonImgPath, width: 14, height: 14),
|
||||
child: Image.asset("close_grey.png".commonImgPath,
|
||||
width: 14, height: 14),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -120,7 +122,8 @@ class _PicPickerState extends State<PicPicker> {
|
||||
children: [
|
||||
Image.asset('add_grey.png'.communityPath, width: 24),
|
||||
10.sizeBoxH,
|
||||
const Text("添加图片", style: TextStyle(fontSize: 12, color: Color(0xff999999))),
|
||||
const Text("添加图片",
|
||||
style: TextStyle(fontSize: 12, color: Color(0xff999999))),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user