Compare commits
No commits in common. "f22c893932f9befe41a790221dffd3fd13999f42" and "bd65038cfc9184b0cdc5c049676e039c3f2cbcd9" have entirely different histories.
f22c893932
...
bd65038cfc
0
lib/kt_pages/kt_main_page/logic.dart
Normal file
0
lib/kt_pages/kt_main_page/logic.dart
Normal file
0
lib/kt_pages/kt_main_page/state.dart
Normal file
0
lib/kt_pages/kt_main_page/state.dart
Normal file
@ -3,12 +3,10 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_kinetra/kt_pages/kt_actor/kt_actor_page.dart';
|
import 'package:flutter_kinetra/kt_pages/kt_actor/kt_actor_page.dart';
|
||||||
import 'package:flutter_kinetra/kt_utils/kt_string_extend.dart';
|
import 'package:flutter_kinetra/kt_utils/kt_string_extend.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
|
|
||||||
import '../kt_explore/view.dart';
|
import '../kt_explore/view.dart';
|
||||||
import '../kt_home/view.dart';
|
import '../kt_home/view.dart';
|
||||||
import '../kt_mine/view.dart';
|
import '../kt_mine/view.dart';
|
||||||
import '../kt_my_list/logic.dart';
|
|
||||||
import '../kt_my_list/view.dart';
|
import '../kt_my_list/view.dart';
|
||||||
|
|
||||||
class KtMainPage extends StatefulWidget {
|
class KtMainPage extends StatefulWidget {
|
||||||
@ -105,8 +103,13 @@ class _KtMainPageState extends State<KtMainPage>
|
|||||||
onTap: (index) {
|
onTap: (index) {
|
||||||
_currentIndex = index;
|
_currentIndex = index;
|
||||||
_controller.jumpToPage(index);
|
_controller.jumpToPage(index);
|
||||||
final myListLogic = Get.put(MyListLogic());
|
// final recommendLogic = Get.put(RecommendLogic());
|
||||||
myListLogic.initData();
|
// if (index != 1) {
|
||||||
|
// recommendLogic.videoCtrl?.pause();
|
||||||
|
// } else {
|
||||||
|
// recommendLogic.videoCtrl?.play();
|
||||||
|
// }
|
||||||
|
// recommendLogic.update();
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
..._tabsTitle.map(
|
..._tabsTitle.map(
|
||||||
|
@ -125,7 +125,25 @@ class MyListLogic extends GetxController {
|
|||||||
"video_id": video.shortPlayVideoId,
|
"video_id": video.shortPlayVideoId,
|
||||||
};
|
};
|
||||||
if (video.isCollect == 1) {
|
if (video.isCollect == 1) {
|
||||||
cancelCollect(video.shortPlayId!);
|
Get.dialog(
|
||||||
|
KtDialog(
|
||||||
|
title: 'Remove from your list?',
|
||||||
|
subTitle: 'This drama will be removed from your saved list.',
|
||||||
|
rightBtnText: 'Remove',
|
||||||
|
rightBtnIcon: 'ic_dialog_delete.png',
|
||||||
|
rightBtnFunc: () async {
|
||||||
|
ApiResponse res = await KtHttpClient().request(
|
||||||
|
KtApis.deleteFavoriteVideo,
|
||||||
|
data: params,
|
||||||
|
);
|
||||||
|
if (res.success) {
|
||||||
|
video.isCollect = 0;
|
||||||
|
getCollectList(refresh: true);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
ApiResponse res = await KtHttpClient().request(
|
ApiResponse res = await KtHttpClient().request(
|
||||||
KtApis.collectVideo,
|
KtApis.collectVideo,
|
||||||
@ -152,7 +170,7 @@ class MyListLogic extends GetxController {
|
|||||||
queryParameters: {'short_play_id': id},
|
queryParameters: {'short_play_id': id},
|
||||||
);
|
);
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
// state.favoriteList.removeWhere((item) => id == item.shortPlayId);
|
state.favoriteList.removeWhere((item) => id == item.shortPlayId);
|
||||||
state.chestList.removeWhere((item) => id == item.shortPlayId);
|
state.chestList.removeWhere((item) => id == item.shortPlayId);
|
||||||
state.historyList
|
state.historyList
|
||||||
.firstWhereOrNull((item) => id == item.shortPlayId)
|
.firstWhereOrNull((item) => id == item.shortPlayId)
|
||||||
|
@ -26,7 +26,7 @@ class _KtMyListPageState extends State<KtMyListPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GetBuilder<MyListLogic>(
|
return GetBuilder<MyListLogic>(
|
||||||
builder: (ctrl) {
|
builder: (ctrl) {
|
||||||
// if (state.loadStatus == KtLoadStatusType.loading) return Center(child: CircularProgressIndicator());
|
if (state.loadStatus == KtLoadStatusType.loading) return Container();
|
||||||
return Container(
|
return Container(
|
||||||
width: ScreenUtil().screenWidth,
|
width: ScreenUtil().screenWidth,
|
||||||
height: ScreenUtil().screenHeight,
|
height: ScreenUtil().screenHeight,
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import 'package:easy_debounce/easy_throttle.dart';
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_kinetra/kt_pages/kt_mine/logic.dart';
|
import 'package:flutter_kinetra/kt_pages/kt_mine/logic.dart';
|
||||||
@ -14,7 +12,6 @@ import 'package:video_player/video_player.dart';
|
|||||||
import '../../dio_cilent/kt_apis.dart';
|
import '../../dio_cilent/kt_apis.dart';
|
||||||
import '../../dio_cilent/kt_request.dart';
|
import '../../dio_cilent/kt_request.dart';
|
||||||
import '../../kt_model/kt_video_detail_bean.dart';
|
import '../../kt_model/kt_video_detail_bean.dart';
|
||||||
import '../../kt_utils/kt_device_info_utils.dart';
|
|
||||||
import '../../kt_widgets/kt_status_widget.dart';
|
import '../../kt_widgets/kt_status_widget.dart';
|
||||||
import '../../kt_widgets/kt_store_widget.dart';
|
import '../../kt_widgets/kt_store_widget.dart';
|
||||||
import '../kt_mine/kt_store/logic.dart';
|
import '../kt_mine/kt_store/logic.dart';
|
||||||
@ -225,14 +222,7 @@ class VideoPlayLogic extends GetxController {
|
|||||||
if (controllers[index] != null) return;
|
if (controllers[index] != null) return;
|
||||||
|
|
||||||
final episode = state.episodeList[index];
|
final episode = state.episodeList[index];
|
||||||
VideoPlayerController controller =
|
final controller = VideoPlayerController.networkUrl(
|
||||||
Platform.isAndroid && KtDeviceInfoUtil().osVersion == '10'
|
|
||||||
? VideoPlayerController.networkUrl(
|
|
||||||
Uri.parse(episode.videoUrl!),
|
|
||||||
formatHint: VideoFormat.hls,
|
|
||||||
viewType: VideoViewType.platformView,
|
|
||||||
)
|
|
||||||
: VideoPlayerController.networkUrl(
|
|
||||||
Uri.parse(episode.videoUrl!),
|
Uri.parse(episode.videoUrl!),
|
||||||
formatHint: VideoFormat.hls,
|
formatHint: VideoFormat.hls,
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user