Merge branch 'main' into feature-media_kit
This commit is contained in:
24
change_log/1.0.8.0917.md
Normal file
24
change_log/1.0.8.0917.md
Normal file
@ -0,0 +1,24 @@
|
||||
## 1.0.8
|
||||
|
||||
直播弹幕、循环播放等功能开发中
|
||||
|
||||
### 新功能
|
||||
+ 用户拉黑功能
|
||||
+ gif图片保存
|
||||
+ 删除已看历史记录
|
||||
|
||||
### 修复
|
||||
+ 弹幕数量较少
|
||||
+ 弹幕屏蔽设置自动记忆
|
||||
+ 动态页面渲染
|
||||
+ 用户主页数据错乱
|
||||
+ 大家都在搜空白
|
||||
+ 默认自动全屏,顶部操作栏丢失
|
||||
|
||||
|
||||
### 优化
|
||||
+ 全屏状态栏区域显示优化
|
||||
+ 图片保存至PiliPala文件夹
|
||||
|
||||
更多更新日志可在Github上查看
|
||||
问题反馈、功能建议请查看「关于」页面。
|
@ -1,6 +1,8 @@
|
||||
PODS:
|
||||
- appscheme (1.0.4):
|
||||
- Flutter
|
||||
- auto_orientation (0.0.1):
|
||||
- Flutter
|
||||
- connectivity_plus (0.0.1):
|
||||
- Flutter
|
||||
- ReachabilitySwift
|
||||
@ -12,8 +14,6 @@ PODS:
|
||||
- FMDB (2.7.5):
|
||||
- FMDB/standard (= 2.7.5)
|
||||
- FMDB/standard (2.7.5)
|
||||
- image_gallery_saver (2.0.2):
|
||||
- Flutter
|
||||
- media_kit_libs_ios_video (1.0.4):
|
||||
- Flutter
|
||||
- media_kit_native_event_loop (1.0.0):
|
||||
@ -28,6 +28,8 @@ PODS:
|
||||
- permission_handler_apple (9.1.1):
|
||||
- Flutter
|
||||
- ReachabilitySwift (5.0.0)
|
||||
- saver_gallery (0.0.1):
|
||||
- Flutter
|
||||
- screen_brightness_ios (0.1.0):
|
||||
- Flutter
|
||||
- share_plus (0.0.1):
|
||||
@ -52,17 +54,18 @@ PODS:
|
||||
|
||||
DEPENDENCIES:
|
||||
- appscheme (from `.symlinks/plugins/appscheme/ios`)
|
||||
- auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
|
||||
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_volume_controller (from `.symlinks/plugins/flutter_volume_controller/ios`)
|
||||
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
|
||||
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
|
||||
- media_kit_native_event_loop (from `.symlinks/plugins/media_kit_native_event_loop/ios`)
|
||||
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
|
||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||
- saver_gallery (from `.symlinks/plugins/saver_gallery/ios`)
|
||||
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
|
||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
||||
@ -82,6 +85,8 @@ SPEC REPOS:
|
||||
EXTERNAL SOURCES:
|
||||
appscheme:
|
||||
:path: ".symlinks/plugins/appscheme/ios"
|
||||
auto_orientation:
|
||||
:path: ".symlinks/plugins/auto_orientation/ios"
|
||||
connectivity_plus:
|
||||
:path: ".symlinks/plugins/connectivity_plus/ios"
|
||||
device_info_plus:
|
||||
@ -90,8 +95,6 @@ EXTERNAL SOURCES:
|
||||
:path: Flutter
|
||||
flutter_volume_controller:
|
||||
:path: ".symlinks/plugins/flutter_volume_controller/ios"
|
||||
image_gallery_saver:
|
||||
:path: ".symlinks/plugins/image_gallery_saver/ios"
|
||||
media_kit_libs_ios_video:
|
||||
:path: ".symlinks/plugins/media_kit_libs_ios_video/ios"
|
||||
media_kit_native_event_loop:
|
||||
@ -104,6 +107,8 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||
permission_handler_apple:
|
||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||
saver_gallery:
|
||||
:path: ".symlinks/plugins/saver_gallery/ios"
|
||||
screen_brightness_ios:
|
||||
:path: ".symlinks/plugins/screen_brightness_ios/ios"
|
||||
share_plus:
|
||||
@ -127,12 +132,12 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
appscheme: b1c3f8862331cb20430cf9e0e4af85dbc1572ad8
|
||||
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
||||
connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a
|
||||
device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
flutter_volume_controller: e4d5832f08008180f76e30faf671ffd5a425e529
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
|
||||
media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
|
||||
media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a
|
||||
media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e
|
||||
@ -140,6 +145,7 @@ SPEC CHECKSUMS:
|
||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
|
||||
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
|
||||
saver_gallery: 2b4e584106fde2407ab51560f3851564963e6b78
|
||||
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
|
||||
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
|
||||
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class HtmlRender extends StatelessWidget {
|
||||
@ -20,35 +20,47 @@ class HtmlRender extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Html(
|
||||
data: htmlContent,
|
||||
// tagsList: Html.tags..addAll(["form", "label", "input"]),
|
||||
onLinkTap: (url, buildContext, attributes) => {},
|
||||
extensions: [
|
||||
TagExtension(
|
||||
tagsToExtend: {"img"},
|
||||
builder: (extensionContext) {
|
||||
String? imgUrl = extensionContext.attributes['src'];
|
||||
if (imgUrl!.startsWith('//')) {
|
||||
imgUrl = 'https:$imgUrl';
|
||||
try {
|
||||
Map attributes = extensionContext.attributes;
|
||||
List key = attributes.keys.toList();
|
||||
String? imgUrl = key.contains('src')
|
||||
? attributes['src']
|
||||
: attributes['data-src'];
|
||||
if (imgUrl!.startsWith('//')) {
|
||||
imgUrl = 'https:$imgUrl';
|
||||
}
|
||||
if (imgUrl.startsWith('http://')) {
|
||||
imgUrl = imgUrl.replaceAll('http://', 'https://');
|
||||
}
|
||||
imgUrl = imgUrl.contains('@') ? imgUrl.split('@').first : imgUrl;
|
||||
bool isEmote = imgUrl.contains('/emote/');
|
||||
bool isMall = imgUrl.contains('/mall/');
|
||||
if (isMall) {
|
||||
return const SizedBox();
|
||||
}
|
||||
// bool inTable =
|
||||
// extensionContext.element!.previousElementSibling == null ||
|
||||
// extensionContext.element!.nextElementSibling == null;
|
||||
// imgUrl = Utils().imageUrl(imgUrl!);
|
||||
// return Image.network(
|
||||
// imgUrl,
|
||||
// width: isEmote ? 22 : null,
|
||||
// height: isEmote ? 22 : null,
|
||||
// );
|
||||
return NetworkImgLayer(
|
||||
width: isEmote ? 22 : Get.size.width - 24,
|
||||
height: isEmote ? 22 : 200,
|
||||
src: imgUrl,
|
||||
);
|
||||
} catch (err) {
|
||||
print(err);
|
||||
return const SizedBox();
|
||||
}
|
||||
if (imgUrl.startsWith('http://')) {
|
||||
imgUrl = imgUrl.replaceAll('http://', 'https://');
|
||||
}
|
||||
|
||||
print(imgUrl);
|
||||
bool isEmote = imgUrl.contains('/emote/');
|
||||
bool isMall = imgUrl.contains('/mall/');
|
||||
if (isMall) {
|
||||
return SizedBox();
|
||||
}
|
||||
// bool inTable =
|
||||
// extensionContext.element!.previousElementSibling == null ||
|
||||
// extensionContext.element!.nextElementSibling == null;
|
||||
// imgUrl = Utils().imageUrl(imgUrl!);
|
||||
return Image.network(
|
||||
imgUrl,
|
||||
width: isEmote ? 22 : null,
|
||||
height: isEmote ? 22 : null,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -63,11 +75,13 @@ class HtmlRender extends StatelessWidget {
|
||||
textDecoration: TextDecoration.none,
|
||||
),
|
||||
"p": Style(
|
||||
margin: Margins.only(bottom: 0),
|
||||
margin: Margins.only(bottom: 10),
|
||||
),
|
||||
"span": Style(
|
||||
fontSize: FontSize.medium,
|
||||
height: Height(1.65),
|
||||
),
|
||||
"div": Style(height: Height.auto()),
|
||||
"li > p": Style(
|
||||
display: Display.inline,
|
||||
),
|
||||
@ -75,61 +89,7 @@ class HtmlRender extends StatelessWidget {
|
||||
padding: HtmlPaddings.only(bottom: 4),
|
||||
textAlign: TextAlign.justify,
|
||||
),
|
||||
"image": Style(margin: Margins.only(top: 4, bottom: 4)),
|
||||
"p > img": Style(margin: Margins.only(top: 4, bottom: 4)),
|
||||
"code": Style(
|
||||
backgroundColor: Theme.of(context).colorScheme.onInverseSurface),
|
||||
"code > span": Style(textAlign: TextAlign.start),
|
||||
"hr": Style(
|
||||
margin: Margins.zero,
|
||||
padding: HtmlPaddings.zero,
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
width: 1.0,
|
||||
color:
|
||||
Theme.of(context).colorScheme.onBackground.withOpacity(0.3),
|
||||
),
|
||||
),
|
||||
),
|
||||
'table': Style(
|
||||
border: Border(
|
||||
right: BorderSide(
|
||||
width: 0.5,
|
||||
color:
|
||||
Theme.of(context).colorScheme.onBackground.withOpacity(0.3),
|
||||
),
|
||||
bottom: BorderSide(
|
||||
width: 0.5,
|
||||
color:
|
||||
Theme.of(context).colorScheme.onBackground.withOpacity(0.3),
|
||||
),
|
||||
),
|
||||
),
|
||||
'tr': Style(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
width: 1.0,
|
||||
color:
|
||||
Theme.of(context).colorScheme.onBackground.withOpacity(0.3),
|
||||
),
|
||||
left: BorderSide(
|
||||
width: 1.0,
|
||||
color:
|
||||
Theme.of(context).colorScheme.onBackground.withOpacity(0.3),
|
||||
),
|
||||
),
|
||||
),
|
||||
'thead': Style(
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
),
|
||||
'th': Style(
|
||||
padding: HtmlPaddings.only(left: 3, right: 3),
|
||||
),
|
||||
'td': Style(
|
||||
padding: HtmlPaddings.all(4.0),
|
||||
alignment: Alignment.center,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
"img": Style(margin: Margins.only(top: 4, bottom: 4)),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -62,6 +62,15 @@ class VideoCardV extends StatelessWidget {
|
||||
'heroTag': heroTag,
|
||||
});
|
||||
break;
|
||||
// 动态
|
||||
case 'picture':
|
||||
Get.toNamed('/htmlRender', parameters: {
|
||||
'url': videoItem.uri,
|
||||
'title': videoItem.title,
|
||||
'id': videoItem.param.toString(),
|
||||
'dynamicType': 'picture'
|
||||
});
|
||||
break;
|
||||
default:
|
||||
SmartDialog.showToast(videoItem.goto);
|
||||
Get.toNamed(
|
||||
|
@ -245,6 +245,9 @@ class Api {
|
||||
// wts=1689767832
|
||||
static const String memberArchive = '/x/space/wbi/arc/search';
|
||||
|
||||
// 用户动态搜索
|
||||
static const String memberDynamicSearch = '/x/space/dynamic/search';
|
||||
|
||||
// 用户动态
|
||||
static const String memberDynamic = '/x/polymer/web-dynamic/v1/feed/space';
|
||||
|
||||
|
@ -17,17 +17,11 @@ class DanmakaHttp {
|
||||
'oid': cid,
|
||||
'segment_index': segmentIndex,
|
||||
};
|
||||
|
||||
// 计算函数
|
||||
Future<DmSegMobileReply> computeTask(Map<String, int> params) async {
|
||||
var response = await Request().get(
|
||||
Api.webDanmaku,
|
||||
data: params,
|
||||
extra: {'resType': ResponseType.bytes},
|
||||
);
|
||||
return DmSegMobileReply.fromBuffer(response.data);
|
||||
}
|
||||
|
||||
return await compute(computeTask, params);
|
||||
var response = await Request().get(
|
||||
Api.webDanmaku,
|
||||
data: params,
|
||||
extra: {'resType': ResponseType.bytes},
|
||||
);
|
||||
return DmSegMobileReply.fromBuffer(response.data);
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,12 @@ import 'package:html/parser.dart';
|
||||
import 'package:pilipala/http/index.dart';
|
||||
|
||||
class HtmlHttp {
|
||||
static Future reqHtml(id) async {
|
||||
var response = await Request().get("https://www.bilibili.com/opus/$id");
|
||||
// article
|
||||
static Future reqHtml(id, dynamicType) async {
|
||||
var response = await Request().get(
|
||||
"https://www.bilibili.com/opus/$id",
|
||||
extra: {'ua': 'pc'},
|
||||
);
|
||||
Document rootTree = parse(response.data);
|
||||
Element body = rootTree.body!;
|
||||
Element appDom = body.querySelector('#app')!;
|
||||
@ -34,7 +38,46 @@ class HtmlHttp {
|
||||
'uname': uname,
|
||||
'updateTime': updateTime,
|
||||
'content': opusContent,
|
||||
'commentId': commentId
|
||||
'commentId': int.parse(commentId)
|
||||
};
|
||||
}
|
||||
|
||||
// read
|
||||
static Future reqReadHtml(id, dynamicType) async {
|
||||
var response = await Request().get(
|
||||
"https://www.bilibili.com/$dynamicType/$id/",
|
||||
extra: {'ua': 'pc'},
|
||||
);
|
||||
Document rootTree = parse(response.data);
|
||||
Element body = rootTree.body!;
|
||||
Element appDom = body.querySelector('#app')!;
|
||||
Element authorHeader = appDom.querySelector('.up-left')!;
|
||||
// 头像
|
||||
// String avatar =
|
||||
// authorHeader.querySelector('.bili-avatar-img')!.attributes['data-src']!;
|
||||
// print(avatar);
|
||||
// avatar = 'https:${avatar.split('@')[0]}';
|
||||
String uname = authorHeader.querySelector('.up-name')!.text.trim();
|
||||
// 动态详情
|
||||
Element opusDetail = appDom.querySelector('.article-content')!;
|
||||
// 发布时间
|
||||
// String updateTime =
|
||||
// opusDetail.querySelector('.opus-module-author__pub__text')!.text;
|
||||
// print(updateTime);
|
||||
|
||||
//
|
||||
String opusContent =
|
||||
opusDetail.querySelector('#read-article-holder')!.innerHtml;
|
||||
RegExp digitRegExp = RegExp(r'\d+');
|
||||
Iterable<Match> matches = digitRegExp.allMatches(id);
|
||||
String number = matches.first.group(0)!;
|
||||
return {
|
||||
'status': true,
|
||||
'avatar': '',
|
||||
'uname': uname,
|
||||
'updateTime': '',
|
||||
'content': opusContent,
|
||||
'commentId': int.parse(number)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -89,11 +89,7 @@ class Request {
|
||||
//响应流上前后两次接受到数据的间隔,单位为毫秒。
|
||||
receiveTimeout: const Duration(milliseconds: 12000),
|
||||
//Http请求头.
|
||||
headers: {
|
||||
'keep-alive': 'true',
|
||||
'user-agent': headerUa(),
|
||||
},
|
||||
persistentConnection: true,
|
||||
headers: {},
|
||||
);
|
||||
|
||||
dio = Dio(options)
|
||||
@ -128,13 +124,16 @@ class Request {
|
||||
*/
|
||||
get(url, {data, options, cancelToken, extra}) async {
|
||||
Response response;
|
||||
Options options;
|
||||
Options options = Options();
|
||||
ResponseType resType = ResponseType.json;
|
||||
if (extra != null) {
|
||||
resType = extra!['resType'] ?? ResponseType.json;
|
||||
if (extra['ua'] != null) {
|
||||
options.headers = {'user-agent': headerUa(type: extra['ua'])};
|
||||
}
|
||||
}
|
||||
options = Options();
|
||||
options.responseType = resType;
|
||||
|
||||
try {
|
||||
response = await dio.get(
|
||||
url,
|
||||
@ -201,14 +200,19 @@ class Request {
|
||||
token.cancel("cancelled");
|
||||
}
|
||||
|
||||
String headerUa() {
|
||||
String headerUa({type = 'mob'}) {
|
||||
String headerUa = '';
|
||||
if (Platform.isIOS) {
|
||||
headerUa =
|
||||
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 Safari/604.1';
|
||||
if (type == 'mob') {
|
||||
if (Platform.isIOS) {
|
||||
headerUa =
|
||||
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 Safari/604.1';
|
||||
} else {
|
||||
headerUa =
|
||||
'Mozilla/5.0 (Linux; Android 10; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36';
|
||||
}
|
||||
} else {
|
||||
headerUa =
|
||||
'Mozilla/5.0 (Linux; Android 10; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36';
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15';
|
||||
}
|
||||
return headerUa;
|
||||
}
|
||||
|
@ -46,7 +46,10 @@ class ApiInterceptor extends Interceptor {
|
||||
void onError(DioException err, ErrorInterceptorHandler handler) async {
|
||||
// 处理网络请求错误
|
||||
// handler.next(err);
|
||||
SmartDialog.showToast(await dioError(err));
|
||||
SmartDialog.showToast(
|
||||
await dioError(err),
|
||||
displayType: SmartToastType.onlyRefresh,
|
||||
);
|
||||
super.onError(err, handler);
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ class MemberHttp {
|
||||
var res = await Request().get(
|
||||
Api.memberInfo,
|
||||
data: params,
|
||||
extra: {'ua': 'pc'},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
@ -65,7 +66,7 @@ class MemberHttp {
|
||||
int ps = 30,
|
||||
int tid = 0,
|
||||
int? pn,
|
||||
String keyword = '',
|
||||
String? keyword,
|
||||
String order = 'pubdate',
|
||||
bool orderAvoided = true,
|
||||
}) async {
|
||||
@ -74,7 +75,7 @@ class MemberHttp {
|
||||
'ps': ps,
|
||||
'tid': tid,
|
||||
'pn': pn,
|
||||
'keyword': keyword,
|
||||
'keyword': keyword ?? '',
|
||||
'order': order,
|
||||
'platform': 'web',
|
||||
'web_location': 1550101,
|
||||
@ -83,6 +84,7 @@ class MemberHttp {
|
||||
var res = await Request().get(
|
||||
Api.memberArchive,
|
||||
data: params,
|
||||
extra: {'ua': 'pc'},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
@ -119,4 +121,27 @@ class MemberHttp {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 搜索用户动态
|
||||
static Future memberDynamicSearch({int? pn, int? ps, int? mid}) async {
|
||||
var res = await Request().get(Api.memberDynamic, data: {
|
||||
'keyword': '海拔',
|
||||
'mid': mid,
|
||||
'pn': pn,
|
||||
'ps': ps,
|
||||
'platform': 'web'
|
||||
});
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': DynamicsDataModel.fromJson(res.data['data']),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ class ReplyHttp {
|
||||
Map errMap = {
|
||||
-400: '请求错误',
|
||||
-404: '无此项',
|
||||
12002: '当前页面评论功能已关闭"',
|
||||
12002: '当前页面评论功能已关闭',
|
||||
12009: '评论主体的type不合法',
|
||||
12061: 'UP主已关闭评论区',
|
||||
};
|
||||
|
@ -238,7 +238,7 @@ class UserHttp {
|
||||
var res = await Request().post(
|
||||
Api.delHistory,
|
||||
queryParameters: {
|
||||
'kid': 'archive_$kid',
|
||||
'kid': kid,
|
||||
'jsonp': 'jsonp',
|
||||
'csrf': await Request.getCsrf(),
|
||||
},
|
||||
|
@ -1,4 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -61,6 +64,23 @@ class MyApp extends StatelessWidget {
|
||||
double textScale =
|
||||
setting.get(SettingBoxKey.defaultTextScale, defaultValue: 1.0);
|
||||
|
||||
// 强制设置高帧率
|
||||
if (Platform.isAndroid) {
|
||||
try {
|
||||
late List modes;
|
||||
FlutterDisplayMode.supported.then((value) {
|
||||
modes = value;
|
||||
var storageDisplay = setting.get(SettingBoxKey.displayMode);
|
||||
DisplayMode f = DisplayMode.auto;
|
||||
if (storageDisplay != null) {
|
||||
f = modes.firstWhere((e) => e.toString() == storageDisplay);
|
||||
}
|
||||
DisplayMode preferred = modes.toList().firstWhere((el) => el == f);
|
||||
FlutterDisplayMode.setPreferredMode(preferred);
|
||||
});
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
return DynamicColorBuilder(
|
||||
builder: ((ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
|
||||
ColorScheme? lightColorScheme;
|
||||
|
@ -397,6 +397,7 @@ class SearchArticleItemModel {
|
||||
this.pubTime,
|
||||
this.like,
|
||||
this.title,
|
||||
this.subTitle,
|
||||
this.rankOffset,
|
||||
this.mid,
|
||||
this.imageUrls,
|
||||
@ -414,6 +415,7 @@ class SearchArticleItemModel {
|
||||
int? pubTime;
|
||||
int? like;
|
||||
List? title;
|
||||
String? subTitle;
|
||||
int? rankOffset;
|
||||
int? mid;
|
||||
List? imageUrls;
|
||||
@ -431,6 +433,7 @@ class SearchArticleItemModel {
|
||||
pubTime = json['pub_time'];
|
||||
like = json['like'];
|
||||
title = Em.regTitle(json['title']);
|
||||
subTitle = json['title'].replaceAll(RegExp(r'<[^>]*>'), '');
|
||||
rankOffset = json['rank_offset'];
|
||||
mid = json['mid'];
|
||||
imageUrls = json['image_urls'];
|
||||
|
@ -184,7 +184,7 @@ class AboutController extends GetxController {
|
||||
|
||||
// 获取远程版本
|
||||
Future getRemoteApp() async {
|
||||
var result = await Request().get(Api.latestApp);
|
||||
var result = await Request().get(Api.latestApp, extra: {'ua': 'pc'});
|
||||
data = LatestDataModel.fromJson(result.data);
|
||||
remoteAppInfo = data;
|
||||
remoteVersion.value = data.tagName!;
|
||||
|
@ -10,22 +10,32 @@ class PlDanmakuController {
|
||||
// 按 6min 分段
|
||||
int segCount = 0;
|
||||
List<DmSegMobileReply> dmSegList = [];
|
||||
int currentSegIndex = 0;
|
||||
int currentSegIndex = 1;
|
||||
int currentDmIndex = 0;
|
||||
|
||||
void calcSegment() {
|
||||
dmSegList.clear();
|
||||
// 视频分段数
|
||||
segCount = (videoDuration.inSeconds / (60 * 6)).ceil();
|
||||
dmSegList = List<DmSegMobileReply>.generate(
|
||||
segCount < 1 ? 1 : segCount, (index) => DmSegMobileReply());
|
||||
// 当前分段
|
||||
try {
|
||||
currentSegIndex =
|
||||
(playerController.position.value.inSeconds / (60 * 6)).ceil();
|
||||
currentSegIndex = currentSegIndex < 1 ? 1 : currentSegIndex;
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
Future<List<DmSegMobileReply>> queryDanmaku() async {
|
||||
dmSegList.clear();
|
||||
for (int segIndex = 1; segIndex <= segCount; segIndex++) {
|
||||
DmSegMobileReply result =
|
||||
await DanmakaHttp.queryDanmaku(cid: cid, segmentIndex: segIndex);
|
||||
if (result.elems.isNotEmpty) {
|
||||
result.elems.sort((a, b) => (a.progress).compareTo(b.progress));
|
||||
dmSegList.add(result);
|
||||
}
|
||||
// dmSegList.clear();
|
||||
DmSegMobileReply result =
|
||||
await DanmakaHttp.queryDanmaku(cid: cid, segmentIndex: currentSegIndex);
|
||||
if (result.elems.isNotEmpty) {
|
||||
result.elems.sort((a, b) => (a.progress).compareTo(b.progress));
|
||||
// dmSegList.add(result);
|
||||
currentSegIndex = currentSegIndex < 1 ? 1 : currentSegIndex;
|
||||
dmSegList[currentSegIndex - 1] = result;
|
||||
}
|
||||
if (dmSegList.isNotEmpty) {
|
||||
findClosestPositionIndex(playerController.position.value.inMilliseconds);
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
@ -85,12 +86,20 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
||||
_controller!.onResume();
|
||||
danmuPlayStatus = true;
|
||||
}
|
||||
if (!playerController.isOpenDanmu.value) {
|
||||
return;
|
||||
}
|
||||
PlDanmakuController ctr = _plDanmakuController;
|
||||
int currentPosition = position.inMilliseconds;
|
||||
blockTypes = playerController.blockTypes;
|
||||
|
||||
if (!playerController.isOpenDanmu.value) {
|
||||
return;
|
||||
// 根据position判断是否有已缓存弹幕。没有则请求对应段
|
||||
int segIndex = (currentPosition / (6 * 60 * 1000)).ceil();
|
||||
segIndex = segIndex < 1 ? 1 : segIndex;
|
||||
if (ctr.dmSegList[segIndex - 1].elems.isEmpty) {
|
||||
ctr.currentSegIndex = segIndex;
|
||||
EasyThrottle.throttle('follow', const Duration(seconds: 1), () {
|
||||
ctr.queryDanmaku();
|
||||
});
|
||||
}
|
||||
// 超出分段数返回
|
||||
if (ctr.currentSegIndex >= ctr.dmSegList.length) {
|
||||
@ -140,23 +149,30 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(
|
||||
() => AnimatedOpacity(
|
||||
opacity: playerController.isOpenDanmu.value ? 1 : 0,
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: DanmakuView(
|
||||
createdController: (DanmakuController e) async {
|
||||
widget.playerController.danmakuController = _controller = e;
|
||||
},
|
||||
option: DanmakuOption(
|
||||
fontSize: 15 * fontSizeVal,
|
||||
area: showArea,
|
||||
opacity: opacityVal,
|
||||
duration: danmakuSpeedVal * widget.playerController.playbackSpeed,
|
||||
return LayoutBuilder(builder: (context, box) {
|
||||
double initDuration = box.maxWidth / 12;
|
||||
return Obx(
|
||||
() => AnimatedOpacity(
|
||||
opacity: playerController.isOpenDanmu.value ? 1 : 0,
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: DanmakuView(
|
||||
createdController: (DanmakuController e) async {
|
||||
widget.playerController.danmakuController = _controller = e;
|
||||
},
|
||||
option: DanmakuOption(
|
||||
fontSize: 15 * fontSizeVal,
|
||||
area: showArea,
|
||||
opacity: opacityVal,
|
||||
hideTop: blockTypes.contains(5),
|
||||
hideScroll: blockTypes.contains(2),
|
||||
hideBottom: blockTypes.contains(4),
|
||||
duration: initDuration /
|
||||
(danmakuSpeedVal * widget.playerController.playbackSpeed),
|
||||
),
|
||||
statusChanged: (isPlaying) {},
|
||||
),
|
||||
statusChanged: (isPlaying) {},
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -149,10 +149,30 @@ class DynamicsController extends GetxController {
|
||||
case 'DYNAMIC_TYPE_ARTICLE':
|
||||
String title = item.modules.moduleDynamic.major.opus.title;
|
||||
String url = item.modules.moduleDynamic.major.opus.jumpUrl;
|
||||
Get.toNamed(
|
||||
'/webview',
|
||||
parameters: {'url': 'https:$url', 'type': 'note', 'pageTitle': title},
|
||||
);
|
||||
if (url.contains('opus') || url.contains('read')) {
|
||||
RegExp digitRegExp = RegExp(r'\d+');
|
||||
Iterable<Match> matches = digitRegExp.allMatches(url);
|
||||
String number = matches.first.group(0)!;
|
||||
if (url.contains('read')) {
|
||||
number = 'cv$number';
|
||||
}
|
||||
Get.toNamed('/htmlRender', parameters: {
|
||||
'url': url.startsWith('//') ? url.split('//').last : url,
|
||||
'title': title,
|
||||
'id': number,
|
||||
'dynamicType': url.split('//').last.split('/')[1]
|
||||
});
|
||||
} else {
|
||||
Get.toNamed(
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url': 'https:$url',
|
||||
'type': 'note',
|
||||
'pageTitle': title
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_PGC':
|
||||
print('番剧');
|
||||
|
@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/http/search.dart';
|
||||
|
||||
/// TODO 点击跳转
|
||||
Widget addWidget(item, context, type, {floor = 1}) {
|
||||
@ -19,8 +22,27 @@ Widget addWidget(item, context, type, {floor = 1}) {
|
||||
: Theme.of(context).colorScheme.background;
|
||||
switch (type) {
|
||||
case 'ADDITIONAL_TYPE_UGC':
|
||||
// 转发的投稿
|
||||
return InkWell(
|
||||
onTap: () {},
|
||||
onTap: () async {
|
||||
String text = dynamicProperty[type].jumpUrl;
|
||||
RegExp bvRegex = RegExp(r'BV[0-9A-Za-z]{10}', caseSensitive: false);
|
||||
Iterable<Match> matches = bvRegex.allMatches(text);
|
||||
if (matches.isNotEmpty) {
|
||||
Match match = matches.first;
|
||||
String bvid = match.group(0)!;
|
||||
String cover = dynamicProperty[type].cover;
|
||||
try {
|
||||
int cid = await SearchHttp.ab2c(bvid: bvid);
|
||||
Get.toNamed('/video?bvid=$bvid&cid=$cid',
|
||||
arguments: {'pic': cover, 'heroTag': bvid});
|
||||
} catch (err) {
|
||||
SmartDialog.showToast(err.toString());
|
||||
}
|
||||
} else {
|
||||
print("No match found.");
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 12, top: 8, right: 12, bottom: 8),
|
||||
|
@ -225,8 +225,10 @@ InlineSpan richNode(item, context) {
|
||||
width: box.maxWidth / 2,
|
||||
height: box.maxWidth *
|
||||
0.5 *
|
||||
pictureItem.height! /
|
||||
pictureItem.width!,
|
||||
(pictureItem.height != null &&
|
||||
pictureItem.width != null
|
||||
? pictureItem.height! / pictureItem.width!
|
||||
: 1),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -91,7 +91,10 @@ class _UpPanelState extends State<UpPanel> {
|
||||
),
|
||||
Material(
|
||||
child: InkWell(
|
||||
onTap: () => {feedBack(), Get.toNamed('/follow')},
|
||||
onTap: () => {
|
||||
feedBack(),
|
||||
Get.toNamed('/follow?mid=${userInfo.mid}')
|
||||
},
|
||||
child: Container(
|
||||
height: 100,
|
||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
|
@ -16,13 +16,16 @@ class FansPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FansPageState extends State<FansPage> {
|
||||
final FansController _fansController = Get.put(FansController());
|
||||
late String mid;
|
||||
late FansController _fansController;
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Future? _futureBuilderFuture;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
mid = Get.parameters['mid']!;
|
||||
_fansController = Get.put(FansController(), tag: mid);
|
||||
_futureBuilderFuture = _fansController.queryFans('init');
|
||||
scrollController.addListener(
|
||||
() async {
|
||||
|
@ -16,13 +16,16 @@ class FollowPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FollowPageState extends State<FollowPage> {
|
||||
final FollowController _followController = Get.put(FollowController());
|
||||
late String mid;
|
||||
late FollowController _followController;
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Future? _futureBuilderFuture;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
mid = Get.parameters['mid']!;
|
||||
_followController = Get.put(FollowController(), tag: mid);
|
||||
_futureBuilderFuture = _followController.queryFollowings('init');
|
||||
scrollController.addListener(
|
||||
() async {
|
||||
|
@ -123,8 +123,15 @@ class HistoryController extends GetxController {
|
||||
}
|
||||
|
||||
// 删除某条历史记录
|
||||
Future delHistory(kid) async {
|
||||
var res = await UserHttp.delHistory(kid);
|
||||
Future delHistory(kid, business) async {
|
||||
String resKid = 'archive_$kid';
|
||||
if (business == 'live') {
|
||||
resKid = 'live_$kid';
|
||||
} else if (business.contains('article')) {
|
||||
resKid = 'article_$kid';
|
||||
}
|
||||
|
||||
var res = await UserHttp.delHistory(resKid);
|
||||
if (res['status']) {
|
||||
historyList.removeWhere((e) => e.kid == kid);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
@ -136,7 +143,8 @@ class HistoryController extends GetxController {
|
||||
List<HisListItem> result =
|
||||
historyList.where((e) => e.progress == -1).toList();
|
||||
for (HisListItem i in result) {
|
||||
await UserHttp.delHistory(i.kid);
|
||||
String resKid = 'archive_${i.kid}';
|
||||
await UserHttp.delHistory(resKid);
|
||||
historyList.removeWhere((e) => e.kid == i.kid);
|
||||
}
|
||||
SmartDialog.showToast('操作完成');
|
||||
|
@ -247,26 +247,26 @@ class VideoContent extends StatelessWidget {
|
||||
Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||
color: Theme.of(context).colorScheme.outline),
|
||||
),
|
||||
if (videoItem.badge != '番剧' &&
|
||||
!videoItem.tagName.contains('动画') &&
|
||||
videoItem.history.business != 'live' &&
|
||||
!videoItem.history.business.contains('article'))
|
||||
SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: PopupMenuButton<String>(
|
||||
padding: EdgeInsets.zero,
|
||||
tooltip: '功能菜单',
|
||||
icon: Icon(
|
||||
Icons.more_vert_outlined,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
size: 14,
|
||||
),
|
||||
position: PopupMenuPosition.under,
|
||||
// constraints: const BoxConstraints(maxHeight: 35),
|
||||
onSelected: (String type) {},
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<String>>[
|
||||
SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: PopupMenuButton<String>(
|
||||
padding: EdgeInsets.zero,
|
||||
tooltip: '功能菜单',
|
||||
icon: Icon(
|
||||
Icons.more_vert_outlined,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
size: 14,
|
||||
),
|
||||
position: PopupMenuPosition.under,
|
||||
// constraints: const BoxConstraints(maxHeight: 35),
|
||||
onSelected: (String type) {},
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<String>>[
|
||||
if (videoItem.badge != '番剧' &&
|
||||
!videoItem.tagName.contains('动画') &&
|
||||
videoItem.history.business != 'live' &&
|
||||
!videoItem.history.business.contains('article'))
|
||||
PopupMenuItem<String>(
|
||||
onTap: () async {
|
||||
var res = await UserHttp.toViewLater(
|
||||
@ -283,21 +283,22 @@ class VideoContent extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<String>(
|
||||
onTap: () => ctr!.delHistory(videoItem.kid),
|
||||
value: 'pause',
|
||||
height: 35,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.close_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('删除记录', style: TextStyle(fontSize: 13))
|
||||
],
|
||||
),
|
||||
PopupMenuItem<String>(
|
||||
onTap: () => ctr!.delHistory(
|
||||
videoItem.kid, videoItem.history.business),
|
||||
value: 'pause',
|
||||
height: 35,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.close_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('删除记录', style: TextStyle(fontSize: 13))
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
@ -1,19 +1,112 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/html.dart';
|
||||
import 'package:pilipala/http/reply.dart';
|
||||
import 'package:pilipala/models/common/reply_sort_type.dart';
|
||||
import 'package:pilipala/models/video/reply/item.dart';
|
||||
import 'package:pilipala/utils/feed_back.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class HtmlRenderController extends GetxController {
|
||||
late String id;
|
||||
late String dynamicType;
|
||||
late int type;
|
||||
RxInt oid = (-1).obs;
|
||||
late Map response;
|
||||
int? floor;
|
||||
int currentPage = 0;
|
||||
bool isLoadingMore = false;
|
||||
RxString noMore = ''.obs;
|
||||
RxList<ReplyItemModel> replyList = <ReplyItemModel>[].obs;
|
||||
RxInt acount = 0.obs;
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
ReplySortType _sortType = ReplySortType.time;
|
||||
RxString sortTypeTitle = ReplySortType.time.titles.obs;
|
||||
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
id = Get.parameters['id']!;
|
||||
dynamicType = Get.parameters['dynamicType']!;
|
||||
type = dynamicType == 'picture' ? 11 : 12;
|
||||
}
|
||||
|
||||
Future reqHtml() async {
|
||||
var res = await HtmlHttp.reqHtml(id);
|
||||
// 请求动态内容
|
||||
Future reqHtml(id) async {
|
||||
late dynamic res;
|
||||
if (dynamicType == 'opus' || dynamicType == 'picture') {
|
||||
res = await HtmlHttp.reqHtml(id, dynamicType);
|
||||
} else {
|
||||
res = await HtmlHttp.reqReadHtml(id, dynamicType);
|
||||
}
|
||||
response = res;
|
||||
oid.value = res['commentId'];
|
||||
return res;
|
||||
}
|
||||
|
||||
// 请求评论
|
||||
Future queryReplyList({reqType = 'init'}) async {
|
||||
var res = await ReplyHttp.replyList(
|
||||
oid: oid.value,
|
||||
pageNum: currentPage + 1,
|
||||
type: type,
|
||||
sort: _sortType.index,
|
||||
);
|
||||
if (res['status']) {
|
||||
List<ReplyItemModel> replies = res['data'].replies;
|
||||
acount.value = res['data'].page.acount;
|
||||
if (replies.isNotEmpty) {
|
||||
currentPage++;
|
||||
noMore.value = '加载中...';
|
||||
if (replies.length < 20) {
|
||||
noMore.value = '没有更多了';
|
||||
}
|
||||
} else {
|
||||
noMore.value = currentPage == 0 ? '还没有评论' : '没有更多了';
|
||||
}
|
||||
if (reqType == 'init') {
|
||||
// 添加置顶回复
|
||||
if (res['data'].upper.top != null) {
|
||||
bool flag = res['data']
|
||||
.topReplies
|
||||
.any((reply) => reply.rpid == res['data'].upper.top.rpid);
|
||||
if (!flag) {
|
||||
replies.insert(0, res['data'].upper.top);
|
||||
}
|
||||
}
|
||||
replies.insertAll(0, res['data'].topReplies);
|
||||
replyList.value = replies;
|
||||
} else {
|
||||
replyList.addAll(replies);
|
||||
}
|
||||
}
|
||||
isLoadingMore = false;
|
||||
return res;
|
||||
}
|
||||
|
||||
// 排序搜索评论
|
||||
queryBySort() {
|
||||
feedBack();
|
||||
switch (_sortType) {
|
||||
case ReplySortType.time:
|
||||
_sortType = ReplySortType.like;
|
||||
break;
|
||||
case ReplySortType.like:
|
||||
_sortType = ReplySortType.reply;
|
||||
break;
|
||||
case ReplySortType.reply:
|
||||
_sortType = ReplySortType.time;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
sortTypeTitle.value = _sortType.titles;
|
||||
sortTypeLabel.value = _sortType.labels;
|
||||
currentPage = 0;
|
||||
replyList.clear();
|
||||
queryReplyList(reqType: 'init');
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,19 @@
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/skeleton/video_reply.dart';
|
||||
import 'package:pilipala/common/widgets/html_render.dart';
|
||||
import 'package:pilipala/common/widgets/http_error.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/models/common/reply_type.dart';
|
||||
import 'package:pilipala/pages/mine/index.dart';
|
||||
import 'package:pilipala/pages/video/detail/reply/widgets/reply_item.dart';
|
||||
import 'package:pilipala/pages/video/detail/replyNew/index.dart';
|
||||
import 'package:pilipala/pages/video/detail/replyReply/index.dart';
|
||||
import 'package:pilipala/utils/feed_back.dart';
|
||||
|
||||
import 'controller.dart';
|
||||
|
||||
@ -12,16 +24,104 @@ class HtmlRenderPage extends StatefulWidget {
|
||||
State<HtmlRenderPage> createState() => _HtmlRenderPageState();
|
||||
}
|
||||
|
||||
class _HtmlRenderPageState extends State<HtmlRenderPage> {
|
||||
HtmlRenderController htmlRenderCtr = Get.put(HtmlRenderController());
|
||||
class _HtmlRenderPageState extends State<HtmlRenderPage>
|
||||
with TickerProviderStateMixin {
|
||||
final HtmlRenderController _htmlRenderCtr = Get.put(HtmlRenderController());
|
||||
late String title;
|
||||
late String id;
|
||||
late String url;
|
||||
late String dynamicType;
|
||||
late int type;
|
||||
bool _isFabVisible = true;
|
||||
late Future _futureBuilderFuture;
|
||||
late ScrollController scrollController;
|
||||
late AnimationController fabAnimationCtr;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
title = Get.parameters['title']!;
|
||||
id = Get.parameters['id']!;
|
||||
url = Get.parameters['url']!;
|
||||
dynamicType = Get.parameters['dynamicType']!;
|
||||
type = dynamicType == 'picture' ? 11 : 12;
|
||||
_futureBuilderFuture = _htmlRenderCtr.reqHtml(id);
|
||||
fabAnimationCtr = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
);
|
||||
scrollListener();
|
||||
}
|
||||
|
||||
void scrollListener() {
|
||||
scrollController = _htmlRenderCtr.scrollController;
|
||||
scrollController.addListener(
|
||||
() {
|
||||
// 分页加载
|
||||
if (scrollController.position.pixels >=
|
||||
scrollController.position.maxScrollExtent - 300) {
|
||||
EasyThrottle.throttle('replylist', const Duration(seconds: 2), () {
|
||||
_htmlRenderCtr.queryReplyList(reqType: 'onLoad');
|
||||
});
|
||||
}
|
||||
|
||||
// 标题
|
||||
// if (scrollController.offset > 55 && !_visibleTitle) {
|
||||
// _visibleTitle = true;
|
||||
// titleStreamC.add(true);
|
||||
// } else if (scrollController.offset <= 55 && _visibleTitle) {
|
||||
// _visibleTitle = false;
|
||||
// titleStreamC.add(false);
|
||||
// }
|
||||
|
||||
// fab按钮
|
||||
final ScrollDirection direction =
|
||||
scrollController.position.userScrollDirection;
|
||||
if (direction == ScrollDirection.forward) {
|
||||
_showFab();
|
||||
} else if (direction == ScrollDirection.reverse) {
|
||||
_hideFab();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _showFab() {
|
||||
if (!_isFabVisible) {
|
||||
_isFabVisible = true;
|
||||
fabAnimationCtr.forward();
|
||||
}
|
||||
}
|
||||
|
||||
void _hideFab() {
|
||||
if (_isFabVisible) {
|
||||
_isFabVisible = false;
|
||||
fabAnimationCtr.reverse();
|
||||
}
|
||||
}
|
||||
|
||||
void replyReply(replyItem) {
|
||||
int oid = replyItem.oid;
|
||||
int rpid = replyItem.rpid!;
|
||||
Get.to(
|
||||
() => Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Text(
|
||||
'评论详情',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
body: VideoReplyReplyPanel(
|
||||
oid: oid,
|
||||
rpid: rpid,
|
||||
source: 'dynamic',
|
||||
replyType: ReplyType.values[type],
|
||||
firstFloor: replyItem,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -29,88 +129,328 @@ class _HtmlRenderPageState extends State<HtmlRenderPage> {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
title: Text(title),
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
actions: [
|
||||
const SizedBox(width: 4),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Get.toNamed('/webview', parameters: {
|
||||
'url': 'https:$url',
|
||||
'type': 'url',
|
||||
'pageTitle': title,
|
||||
});
|
||||
},
|
||||
icon: const Icon(Icons.open_in_browser_outlined, size: 19),
|
||||
),
|
||||
PopupMenuButton(
|
||||
icon: const Icon(Icons.more_vert),
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () => {
|
||||
Clipboard.setData(ClipboardData(text: url)),
|
||||
SmartDialog.showToast('已复制'),
|
||||
},
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.copy_rounded, size: 19),
|
||||
SizedBox(width: 10),
|
||||
Text('复制链接'),
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () => {},
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.share_outlined, size: 19),
|
||||
SizedBox(width: 10),
|
||||
Text('分享'),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 6)
|
||||
],
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
FutureBuilder(
|
||||
future: htmlRenderCtr.reqHtml(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
var data = snapshot.data;
|
||||
if (data['status']) {
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 12, 12, 8),
|
||||
child: Row(
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
width: 40,
|
||||
height: 40,
|
||||
type: 'avatar',
|
||||
src: htmlRenderCtr.response['avatar']!,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
body: Stack(
|
||||
children: [
|
||||
SingleChildScrollView(
|
||||
controller: scrollController,
|
||||
child: Column(
|
||||
children: [
|
||||
FutureBuilder(
|
||||
future: _futureBuilderFuture,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
var data = snapshot.data;
|
||||
fabAnimationCtr.forward();
|
||||
if (data['status']) {
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 12, 12, 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(htmlRenderCtr.response['uname'],
|
||||
style: TextStyle(
|
||||
fontSize: Theme.of(context)
|
||||
.textTheme
|
||||
.titleSmall!
|
||||
.fontSize,
|
||||
)),
|
||||
Text(
|
||||
htmlRenderCtr.response['updateTime'],
|
||||
style: TextStyle(
|
||||
color:
|
||||
Theme.of(context).colorScheme.outline,
|
||||
fontSize: Theme.of(context)
|
||||
.textTheme
|
||||
.labelSmall!
|
||||
.fontSize,
|
||||
),
|
||||
NetworkImgLayer(
|
||||
width: 40,
|
||||
height: 40,
|
||||
type: 'avatar',
|
||||
src: _htmlRenderCtr.response['avatar']!,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(_htmlRenderCtr.response['uname'],
|
||||
style: TextStyle(
|
||||
fontSize: Theme.of(context)
|
||||
.textTheme
|
||||
.titleSmall!
|
||||
.fontSize,
|
||||
)),
|
||||
Text(
|
||||
_htmlRenderCtr.response['updateTime'],
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.outline,
|
||||
fontSize: Theme.of(context)
|
||||
.textTheme
|
||||
.labelSmall!
|
||||
.fontSize,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 12, 12, 8),
|
||||
child: HtmlRender(
|
||||
htmlContent: htmlRenderCtr.response['content'],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 8, 12, 8),
|
||||
child: HtmlRender(
|
||||
htmlContent: _htmlRenderCtr.response['content'],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
width: 8,
|
||||
color: Theme.of(context)
|
||||
.dividerColor
|
||||
.withOpacity(0.05),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return const Text('error');
|
||||
}
|
||||
} else {
|
||||
// 骨架屏
|
||||
return const SizedBox();
|
||||
}
|
||||
},
|
||||
),
|
||||
Obx(
|
||||
() => _htmlRenderCtr.oid.value != -1
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
width: 8,
|
||||
top: BorderSide(
|
||||
width: 0.6,
|
||||
color: Theme.of(context)
|
||||
.dividerColor
|
||||
.withOpacity(0.05),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Text('error');
|
||||
}
|
||||
} else {
|
||||
// 骨架屏
|
||||
return const SizedBox();
|
||||
}
|
||||
},
|
||||
height: 45,
|
||||
padding: const EdgeInsets.only(left: 12, right: 6),
|
||||
child: Row(
|
||||
children: [
|
||||
const Text('回复'),
|
||||
const Spacer(),
|
||||
SizedBox(
|
||||
height: 35,
|
||||
child: TextButton.icon(
|
||||
onPressed: () => _htmlRenderCtr.queryBySort(),
|
||||
icon: const Icon(Icons.sort, size: 16),
|
||||
label: Obx(
|
||||
() => Text(
|
||||
_htmlRenderCtr.sortTypeLabel.value,
|
||||
style: const TextStyle(fontSize: 13),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
Obx(
|
||||
() => _htmlRenderCtr.oid.value != -1
|
||||
? FutureBuilder(
|
||||
future: _htmlRenderCtr.queryReplyList(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.done) {
|
||||
Map data = snapshot.data as Map;
|
||||
if (snapshot.data['status']) {
|
||||
// 请求成功
|
||||
return Obx(
|
||||
() => _htmlRenderCtr.replyList.isEmpty &&
|
||||
_htmlRenderCtr.isLoadingMore
|
||||
? ListView.builder(
|
||||
itemCount: 5,
|
||||
shrinkWrap: true,
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return const VideoReplySkeleton();
|
||||
},
|
||||
)
|
||||
: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
itemCount:
|
||||
_htmlRenderCtr.replyList.length +
|
||||
1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index ==
|
||||
_htmlRenderCtr
|
||||
.replyList.length) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(
|
||||
bottom:
|
||||
MediaQuery.of(context)
|
||||
.padding
|
||||
.bottom),
|
||||
height: MediaQuery.of(context)
|
||||
.padding
|
||||
.bottom +
|
||||
100,
|
||||
child: Center(
|
||||
child: Obx(
|
||||
() => Text(
|
||||
_htmlRenderCtr
|
||||
.noMore.value,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.outline,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return ReplyItem(
|
||||
replyItem: _htmlRenderCtr
|
||||
.replyList[index],
|
||||
showReplyRow: true,
|
||||
replyLevel: '1',
|
||||
replyReply: (replyItem) =>
|
||||
replyReply(replyItem),
|
||||
replyType:
|
||||
ReplyType.values[type],
|
||||
addReply: (replyItem) {
|
||||
_htmlRenderCtr
|
||||
.replyList[index].replies!
|
||||
.add(replyItem);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// 请求错误
|
||||
return CustomScrollView(
|
||||
slivers: [
|
||||
HttpError(
|
||||
errMsg: data['msg'],
|
||||
fn: () => setState(() {}),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// 骨架屏
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: 5,
|
||||
itemBuilder: (context, index) {
|
||||
return const VideoReplySkeleton();
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
)
|
||||
: const SizedBox(),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: MediaQuery.of(context).padding.bottom + 14,
|
||||
right: 14,
|
||||
child: SlideTransition(
|
||||
position: Tween<Offset>(
|
||||
begin: const Offset(0, 2),
|
||||
end: const Offset(0, 0),
|
||||
).animate(CurvedAnimation(
|
||||
parent: fabAnimationCtr,
|
||||
curve: Curves.easeInOut,
|
||||
)),
|
||||
child: FloatingActionButton(
|
||||
heroTag: null,
|
||||
onPressed: () {
|
||||
feedBack();
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext context) {
|
||||
return VideoReplyNewDialog(
|
||||
oid: _htmlRenderCtr.oid.value,
|
||||
root: 0,
|
||||
parent: 0,
|
||||
replyType: ReplyType.values[type],
|
||||
);
|
||||
},
|
||||
).then(
|
||||
(value) => {
|
||||
// 完成评论,数据添加
|
||||
if (value != null && value['data'] != null)
|
||||
{
|
||||
_htmlRenderCtr.replyList.add(value['data']),
|
||||
_htmlRenderCtr.acount.value++
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
tooltip: '评论动态',
|
||||
child: const Icon(Icons.reply),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -25,9 +25,9 @@ class LiveController extends GetxController {
|
||||
|
||||
// 获取推荐
|
||||
Future queryLiveList(type) async {
|
||||
if (type == 'init') {
|
||||
_currentPage = 1;
|
||||
}
|
||||
// if (type == 'init') {
|
||||
// _currentPage = 1;
|
||||
// }
|
||||
var res = await LiveHttp.liveList(
|
||||
pn: _currentPage,
|
||||
);
|
||||
|
@ -21,11 +21,15 @@ class LivePage extends StatefulWidget {
|
||||
State<LivePage> createState() => _LivePageState();
|
||||
}
|
||||
|
||||
class _LivePageState extends State<LivePage> {
|
||||
class _LivePageState extends State<LivePage>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
final LiveController _liveController = Get.put(LiveController());
|
||||
late Future _futureBuilderFuture;
|
||||
late ScrollController scrollController;
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@ -37,7 +41,7 @@ class _LivePageState extends State<LivePage> {
|
||||
() {
|
||||
if (scrollController.position.pixels >=
|
||||
scrollController.position.maxScrollExtent - 200) {
|
||||
EasyThrottle.throttle('my-throttler', const Duration(seconds: 1), () {
|
||||
EasyThrottle.throttle('liveList', const Duration(seconds: 1), () {
|
||||
_liveController.isLoadingMore = true;
|
||||
_liveController.onLoad();
|
||||
});
|
||||
@ -144,9 +148,9 @@ class _LivePageState extends State<LivePage> {
|
||||
return SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
// 行间距
|
||||
mainAxisSpacing: StyleString.cardSpace + 4,
|
||||
mainAxisSpacing: StyleString.safeSpace,
|
||||
// 列间距
|
||||
crossAxisSpacing: StyleString.cardSpace + 4,
|
||||
crossAxisSpacing: StyleString.safeSpace,
|
||||
// 列数
|
||||
crossAxisCount: crossAxisCount,
|
||||
mainAxisExtent:
|
||||
|
@ -24,7 +24,7 @@ class LiveCardV extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
String heroTag = Utils.makeHeroTag(liveItem.roomId);
|
||||
return Card(
|
||||
elevation: crossAxisCount == 1 ? 0 : 1,
|
||||
elevation: 0,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: EdgeInsets.zero,
|
||||
child: GestureDetector(
|
||||
@ -102,7 +102,7 @@ class LiveContent extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: crossAxisCount == 1
|
||||
? const EdgeInsets.fromLTRB(9, 9, 9, 4)
|
||||
: const EdgeInsets.fromLTRB(9, 8, 9, 8),
|
||||
: const EdgeInsets.fromLTRB(5, 8, 5, 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
|
@ -5,20 +5,38 @@ class ArchiveController extends GetxController {
|
||||
int? mid;
|
||||
int pn = 1;
|
||||
int count = 0;
|
||||
RxMap<String, String> currentOrder = <String, String>{}.obs;
|
||||
List<Map<String, String>> orderList = [
|
||||
{'type': 'pubdate', 'label': '最新发布'},
|
||||
{'type': 'click', 'label': '最多播放'},
|
||||
{'type': 'stow', 'label': '最多收藏'},
|
||||
];
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
mid = int.parse(Get.parameters['mid']!);
|
||||
currentOrder.value = orderList.first;
|
||||
}
|
||||
|
||||
// 获取用户投稿
|
||||
Future getMemberArchive() async {
|
||||
var res = await MemberHttp.memberArchive(mid: mid, pn: pn);
|
||||
var res = await MemberHttp.memberArchive(
|
||||
mid: mid, pn: pn, order: currentOrder['type']!);
|
||||
if (res['status']) {
|
||||
count = res['data'].page['count'];
|
||||
pn += 1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
toggleSort() async {
|
||||
pn = 1;
|
||||
int index = orderList.indexOf(currentOrder.value);
|
||||
if (index == orderList.length - 1) {
|
||||
currentOrder.value = orderList.first;
|
||||
} else {
|
||||
currentOrder.value = orderList[index + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ class _ArchivePanelState extends State<ArchivePanel>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
DateTime lastRefreshTime = DateTime.now();
|
||||
late final LoadMoreListSource source = LoadMoreListSource();
|
||||
final ArchiveController _archiveController =
|
||||
Get.put(ArchiveController(), tag: Get.arguments['heroTag']);
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
@ -40,14 +42,63 @@ class _ArchivePanelState extends State<ArchivePanel>
|
||||
// return PullToRefreshHeader(info, lastRefreshTime);
|
||||
// },
|
||||
// ),
|
||||
const SizedBox(height: 4),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 14, top: 8, bottom: 8, right: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('排序方式'),
|
||||
SizedBox(
|
||||
height: 35,
|
||||
width: 85,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
// _archiveController.order = 'click';
|
||||
// _archiveController.pn = 1;
|
||||
_archiveController.toggleSort();
|
||||
source.refresh(true);
|
||||
// LoadMoreListSource().loadData();
|
||||
},
|
||||
child: Obx(
|
||||
() => AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 400),
|
||||
transitionBuilder:
|
||||
(Widget child, Animation<double> animation) {
|
||||
return ScaleTransition(
|
||||
scale: animation, child: child);
|
||||
},
|
||||
child: Text(
|
||||
_archiveController.currentOrder['label']!,
|
||||
key: ValueKey<String>(
|
||||
_archiveController.currentOrder['label']!),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: LoadingMoreList<VListItemModel>(
|
||||
ListConfig<VListItemModel>(
|
||||
sourceList: source,
|
||||
itemBuilder:
|
||||
(BuildContext c, VListItemModel item, int index) {
|
||||
return VideoCardH(videoItem: item);
|
||||
if (index == 0) {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 6),
|
||||
VideoCardH(videoItem: item)
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return VideoCardH(videoItem: item);
|
||||
}
|
||||
},
|
||||
indicatorBuilder: _buildIndicator,
|
||||
),
|
||||
@ -144,12 +195,16 @@ class _ArchivePanelState extends State<ArchivePanel>
|
||||
class LoadMoreListSource extends LoadingMoreBase<VListItemModel> {
|
||||
final ArchiveController _archiveController =
|
||||
Get.put(ArchiveController(), tag: Get.arguments['heroTag']);
|
||||
bool forceRefresh = false;
|
||||
|
||||
@override
|
||||
Future<bool> loadData([bool isloadMoreAction = false]) async {
|
||||
bool isSuccess = false;
|
||||
var res = await _archiveController.getMemberArchive();
|
||||
if (res['status']) {
|
||||
if (_archiveController.pn == 2) {
|
||||
clear();
|
||||
}
|
||||
addAll(res['data'].list.vlist);
|
||||
}
|
||||
if (length < res['data'].page['count']) {
|
||||
@ -159,4 +214,17 @@ class LoadMoreListSource extends LoadingMoreBase<VListItemModel> {
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> refresh([bool clearBeforeRequest = false]) async {
|
||||
// _hasMore = true;
|
||||
// pageindex = 1;
|
||||
// //force to refresh list when you don't want clear list before request
|
||||
// //for the case, if your list already has 20 items.
|
||||
forceRefresh = !clearBeforeRequest;
|
||||
var result = await super.refresh(clearBeforeRequest);
|
||||
|
||||
forceRefresh = false;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ class MemberController extends GetxController {
|
||||
late int mid;
|
||||
Rx<MemberInfoModel> memberInfo = MemberInfoModel().obs;
|
||||
Map? userStat;
|
||||
String? face;
|
||||
RxString face = ''.obs;
|
||||
String? heroTag;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
late int ownerMid;
|
||||
@ -30,7 +30,7 @@ class MemberController extends GetxController {
|
||||
mid = int.parse(Get.parameters['mid']!);
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
ownerMid = userInfo != null ? userInfo.mid : -1;
|
||||
face = Get.arguments['face'] ?? '';
|
||||
face.value = Get.arguments['face'] ?? '';
|
||||
heroTag = Get.arguments['heroTag'] ?? '';
|
||||
relationSearch();
|
||||
}
|
||||
@ -41,6 +41,7 @@ class MemberController extends GetxController {
|
||||
var res = await MemberHttp.memberInfo(mid: mid);
|
||||
if (res['status']) {
|
||||
memberInfo.value = res['data'];
|
||||
face.value = res['data'].face;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@ -110,6 +111,7 @@ class MemberController extends GetxController {
|
||||
// 关系查询
|
||||
Future relationSearch() async {
|
||||
if (userInfo == null) return;
|
||||
if (mid == ownerMid) return;
|
||||
var res = await UserHttp.relationSearch(mid);
|
||||
if (res['status']) {
|
||||
attribute.value = res['data']['relation']['attribute'];
|
||||
@ -117,7 +119,7 @@ class MemberController extends GetxController {
|
||||
? '关注'
|
||||
: attribute.value == 2
|
||||
? '已关注'
|
||||
: attribute.value == 2
|
||||
: attribute.value == 6
|
||||
? '已互粉'
|
||||
: '已拉黑';
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/pages/member/archive/view.dart';
|
||||
import 'package:pilipala/pages/member/dynamic/index.dart';
|
||||
import 'package:pilipala/pages/member/index.dart';
|
||||
import 'package:pilipala/utils/utils.dart';
|
||||
|
||||
import 'widgets/profile.dart';
|
||||
|
||||
@ -20,7 +21,8 @@ class MemberPage extends StatefulWidget {
|
||||
|
||||
class _MemberPageState extends State<MemberPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
final MemberController _memberController = Get.put(MemberController());
|
||||
late String heroTag;
|
||||
late MemberController _memberController;
|
||||
Future? _futureBuilderFuture;
|
||||
final ScrollController _extendNestCtr = ScrollController();
|
||||
late TabController _tabController;
|
||||
@ -29,6 +31,9 @@ class _MemberPageState extends State<MemberPage>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
heroTag =
|
||||
Get.arguments['heroTag'] ?? Utils.makeHeroTag(Get.parameters['mid']);
|
||||
_memberController = Get.put(MemberController(), tag: heroTag);
|
||||
_tabController = TabController(length: 3, vsync: this, initialIndex: 2);
|
||||
_futureBuilderFuture = _memberController.getInfo();
|
||||
_extendNestCtr.addListener(
|
||||
@ -77,11 +82,13 @@ class _MemberPageState extends State<MemberPage>
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
width: 35,
|
||||
height: 35,
|
||||
type: 'avatar',
|
||||
src: _memberController.face ?? '',
|
||||
Obx(
|
||||
() => NetworkImgLayer(
|
||||
width: 35,
|
||||
height: 35,
|
||||
type: 'avatar',
|
||||
src: _memberController.face.value,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Obx(
|
||||
@ -102,30 +109,41 @@ class _MemberPageState extends State<MemberPage>
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () => Get.toNamed(
|
||||
'/memberSearch?mid=${Get.parameters['mid']}&uname=${_memberController.memberInfo.value.name!}'),
|
||||
icon: const Icon(Icons.search_outlined),
|
||||
),
|
||||
PopupMenuButton(
|
||||
icon: const Icon(Icons.more_vert),
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
if (_memberController.ownerMid !=
|
||||
_memberController.mid) ...[
|
||||
PopupMenuItem(
|
||||
onTap: () => _memberController.blockUser(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.block, size: 19),
|
||||
const SizedBox(width: 10),
|
||||
Text(_memberController.attribute.value != 128
|
||||
? '加入黑名单'
|
||||
: '移除黑名单'),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
PopupMenuItem(
|
||||
onTap: () => _memberController.blockUser(),
|
||||
onTap: () => _memberController.shareUser(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.block, size: 19),
|
||||
const Icon(Icons.share_outlined, size: 19),
|
||||
const SizedBox(width: 10),
|
||||
Text(_memberController.attribute.value != 128
|
||||
? '加入黑名单'
|
||||
: '移除黑名单'),
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () => _memberController.shareUser(),
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.share_outlined, size: 19),
|
||||
SizedBox(width: 10),
|
||||
Text('分享UP主'),
|
||||
Text(_memberController.ownerMid !=
|
||||
_memberController.mid
|
||||
? '分享UP主'
|
||||
: '分享我的主页'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -136,34 +154,38 @@ class _MemberPageState extends State<MemberPage>
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
background: Stack(
|
||||
children: [
|
||||
if (_memberController.face != null)
|
||||
Positioned.fill(
|
||||
bottom: 10,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fitWidth,
|
||||
image: NetworkImage(_memberController.face!),
|
||||
alignment: Alignment.topCenter,
|
||||
isAntiAlias: true,
|
||||
),
|
||||
),
|
||||
foregroundDecoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Theme.of(context)
|
||||
.colorScheme
|
||||
.background
|
||||
.withOpacity(0.44),
|
||||
Theme.of(context).colorScheme.background,
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
stops: const [0.0, 0.46],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => _memberController.face.value != ''
|
||||
? Positioned.fill(
|
||||
bottom: 10,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fitWidth,
|
||||
image: NetworkImage(
|
||||
_memberController.face.value),
|
||||
alignment: Alignment.topCenter,
|
||||
isAntiAlias: true,
|
||||
),
|
||||
),
|
||||
foregroundDecoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Theme.of(context)
|
||||
.colorScheme
|
||||
.background
|
||||
.withOpacity(0.44),
|
||||
Theme.of(context).colorScheme.background,
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
stops: const [0.0, 0.46],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
|
@ -22,7 +22,7 @@ Widget profile(ctr, {loadingStatus = false}) {
|
||||
width: 90,
|
||||
height: 90,
|
||||
type: 'avatar',
|
||||
src: !loadingStatus ? memberInfo.face : ctr.face,
|
||||
src: !loadingStatus ? memberInfo.face : ctr.face.value,
|
||||
),
|
||||
if (!loadingStatus &&
|
||||
memberInfo.liveRoom != null &&
|
||||
@ -123,12 +123,14 @@ Widget profile(ctr, {loadingStatus = false}) {
|
||||
: '-',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold)),
|
||||
Text('粉丝',
|
||||
style: TextStyle(
|
||||
fontSize: Theme.of(context)
|
||||
.textTheme
|
||||
.labelMedium!
|
||||
.fontSize))
|
||||
Text(
|
||||
'粉丝',
|
||||
style: TextStyle(
|
||||
fontSize: Theme.of(context)
|
||||
.textTheme
|
||||
.labelMedium!
|
||||
.fontSize),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
90
lib/pages/member_search/controller.dart
Normal file
90
lib/pages/member_search/controller.dart
Normal file
@ -0,0 +1,90 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/http/member.dart';
|
||||
import 'package:pilipala/models/member/archive.dart';
|
||||
|
||||
class MemberSearchController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Rx<TextEditingController> controller = TextEditingController().obs;
|
||||
final FocusNode searchFocusNode = FocusNode();
|
||||
RxString searchKeyWord = ''.obs;
|
||||
String hintText = '搜索';
|
||||
RxString loadingStatus = 'init'.obs;
|
||||
RxString loadingText = '加载中...'.obs;
|
||||
bool hasRequest = false;
|
||||
late int mid;
|
||||
RxString uname = ''.obs;
|
||||
int archivePn = 1;
|
||||
int archiveCount = 0;
|
||||
RxList<VListItemModel> archiveList = <VListItemModel>[].obs;
|
||||
int dynamic_pn = 1;
|
||||
RxList<VListItemModel> dynamicList = <VListItemModel>[].obs;
|
||||
|
||||
int ps = 30;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
mid = int.parse(Get.parameters['mid']!);
|
||||
uname.value = Get.parameters['uname']!;
|
||||
}
|
||||
|
||||
// 清空搜索
|
||||
void onClear() {
|
||||
if (searchKeyWord.value.isNotEmpty && controller.value.text != '') {
|
||||
controller.value.clear();
|
||||
searchKeyWord.value = '';
|
||||
} else {
|
||||
Get.back();
|
||||
}
|
||||
}
|
||||
|
||||
void onChange(value) {
|
||||
searchKeyWord.value = value;
|
||||
}
|
||||
|
||||
// 提交搜索内容
|
||||
void submit() {
|
||||
loadingStatus.value = 'loading';
|
||||
if (hasRequest) {
|
||||
archivePn = 1;
|
||||
searchArchives();
|
||||
}
|
||||
}
|
||||
|
||||
// 搜索视频
|
||||
Future searchArchives({type = 'init'}) async {
|
||||
if (type == 'onLoad' && loadingText.value == '没有更多了') {
|
||||
return;
|
||||
}
|
||||
var res = await MemberHttp.memberArchive(
|
||||
mid: mid,
|
||||
pn: archivePn,
|
||||
keyword: controller.value.text,
|
||||
order: 'pubdate',
|
||||
);
|
||||
if (res['status']) {
|
||||
if (type == 'init' || archivePn == 1) {
|
||||
archiveList.value = res['data'].list.vlist;
|
||||
} else {
|
||||
archiveList.addAll(res['data'].list.vlist);
|
||||
}
|
||||
archiveCount = res['data'].page['count'];
|
||||
if (archiveList.length == archiveCount) {
|
||||
loadingText.value = '没有更多了';
|
||||
}
|
||||
archivePn += 1;
|
||||
hasRequest = true;
|
||||
}
|
||||
// loadingStatus.value = 'finish';
|
||||
return res;
|
||||
}
|
||||
|
||||
// 搜索动态
|
||||
Future searchDynamic() async {}
|
||||
|
||||
//
|
||||
onLoad() {
|
||||
searchArchives(type: 'onLoad');
|
||||
}
|
||||
}
|
4
lib/pages/member_search/index.dart
Normal file
4
lib/pages/member_search/index.dart
Normal file
@ -0,0 +1,4 @@
|
||||
library member_search;
|
||||
|
||||
export './controller.dart';
|
||||
export './view.dart';
|
195
lib/pages/member_search/view.dart
Normal file
195
lib/pages/member_search/view.dart
Normal file
@ -0,0 +1,195 @@
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/skeleton/video_card_h.dart';
|
||||
import 'package:pilipala/common/widgets/http_error.dart';
|
||||
import 'package:pilipala/common/widgets/no_data.dart';
|
||||
import 'package:pilipala/common/widgets/video_card_h.dart';
|
||||
|
||||
import 'controller.dart';
|
||||
|
||||
class MemberSearchPage extends StatefulWidget {
|
||||
const MemberSearchPage({super.key});
|
||||
|
||||
@override
|
||||
State<MemberSearchPage> createState() => _MemberSearchPageState();
|
||||
}
|
||||
|
||||
class _MemberSearchPageState extends State<MemberSearchPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
final MemberSearchController _memberSearchCtr =
|
||||
Get.put(MemberSearchController());
|
||||
late ScrollController scrollController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
scrollController = _memberSearchCtr.scrollController;
|
||||
scrollController.addListener(
|
||||
() {
|
||||
if (scrollController.position.pixels >=
|
||||
scrollController.position.maxScrollExtent - 300) {
|
||||
EasyThrottle.throttle('history', const Duration(seconds: 1), () {
|
||||
_memberSearchCtr.onLoad();
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
// _tabController = TabController(length: 2, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// _tabController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () => _memberSearchCtr.submit(),
|
||||
icon: const Icon(CupertinoIcons.search, size: 22)),
|
||||
const SizedBox(width: 10)
|
||||
],
|
||||
title: Obx(
|
||||
() => TextField(
|
||||
autofocus: true,
|
||||
focusNode: _memberSearchCtr.searchFocusNode,
|
||||
controller: _memberSearchCtr.controller.value,
|
||||
textInputAction: TextInputAction.search,
|
||||
onChanged: (value) => _memberSearchCtr.onChange(value),
|
||||
decoration: InputDecoration(
|
||||
hintText: _memberSearchCtr.hintText,
|
||||
border: InputBorder.none,
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
size: 22,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
onPressed: () => _memberSearchCtr.onClear(),
|
||||
),
|
||||
),
|
||||
onSubmitted: (String value) => _memberSearchCtr.submit(),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Obx(
|
||||
() => Column(
|
||||
children: _memberSearchCtr.loadingStatus.value == 'init'
|
||||
? [
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Text('搜索「${_memberSearchCtr.uname.value}」的动态、视频'),
|
||||
),
|
||||
),
|
||||
]
|
||||
: [
|
||||
// TabBar(
|
||||
// controller: _tabController,
|
||||
// tabs: const [
|
||||
// Tab(text: "视频"),
|
||||
// Tab(text: "动态"),
|
||||
// ],
|
||||
// ),
|
||||
Expanded(
|
||||
child:
|
||||
// TabBarView(
|
||||
// controller: _tabController,
|
||||
// children: [
|
||||
FutureBuilder(
|
||||
future: _memberSearchCtr.searchArchives(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
Map data = snapshot.data as Map;
|
||||
if (data['status']) {
|
||||
return Obx(
|
||||
() => _memberSearchCtr.archiveList.isNotEmpty
|
||||
? ListView.builder(
|
||||
controller: scrollController,
|
||||
itemCount:
|
||||
_memberSearchCtr.archiveList.length +
|
||||
1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index ==
|
||||
_memberSearchCtr
|
||||
.archiveList.length) {
|
||||
return Container(
|
||||
height: MediaQuery.of(context)
|
||||
.padding
|
||||
.bottom +
|
||||
60,
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context)
|
||||
.padding
|
||||
.bottom),
|
||||
child: Center(
|
||||
child: Obx(
|
||||
() => Text(
|
||||
_memberSearchCtr
|
||||
.loadingText.value,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.outline,
|
||||
fontSize: 13),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return VideoCardH(
|
||||
videoItem: _memberSearchCtr
|
||||
.archiveList[index]);
|
||||
}
|
||||
},
|
||||
)
|
||||
: _memberSearchCtr.loadingStatus.value ==
|
||||
'loading'
|
||||
? ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (context, index) {
|
||||
return const VideoCardHSkeleton();
|
||||
},
|
||||
)
|
||||
: const CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
NoData(),
|
||||
],
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
HttpError(
|
||||
errMsg: data['msg'],
|
||||
fn: () => setState(() {}),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// 骨架屏
|
||||
return ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (context, index) {
|
||||
return const VideoCardHSkeleton();
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
// ],
|
||||
// ),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/user.dart';
|
||||
@ -111,4 +112,20 @@ class MineController extends GetxController {
|
||||
}
|
||||
Get.forceAppUpdate();
|
||||
}
|
||||
|
||||
pushFollow() {
|
||||
if (!userLogin.value) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
Get.toNamed('/follow?mid=${userInfo.value.mid}');
|
||||
}
|
||||
|
||||
pushFans() {
|
||||
if (!userLogin.value) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
Get.toNamed('/fan?mid=${userInfo.value.mid}');
|
||||
}
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ class _MinePageState extends State<MinePage> {
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => Get.toNamed('/follow'),
|
||||
onTap: () => _mineController.pushFollow(),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -294,7 +294,7 @@ class _MinePageState extends State<MinePage> {
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => Get.toNamed('/fan'),
|
||||
onTap: () => _mineController.pushFans(),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
@ -14,6 +14,7 @@ class RcmdController extends GetxController {
|
||||
Box recVideo = GStrorage.recVideo;
|
||||
Box setting = GStrorage.setting;
|
||||
RxInt crossAxisCount = 2.obs;
|
||||
late bool enableSaveLastData;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@ -28,6 +29,8 @@ class RcmdController extends GetxController {
|
||||
}
|
||||
videoList.value = list;
|
||||
}
|
||||
enableSaveLastData =
|
||||
setting.get(SettingBoxKey.enableSaveLastData, defaultValue: false);
|
||||
}
|
||||
|
||||
// 获取推荐
|
||||
@ -49,7 +52,11 @@ class RcmdController extends GetxController {
|
||||
videoList.value = res['data'];
|
||||
}
|
||||
} else if (type == 'onRefresh') {
|
||||
videoList.value = res['data'];
|
||||
if (enableSaveLastData) {
|
||||
videoList.insertAll(0, res['data']);
|
||||
} else {
|
||||
videoList.value = res['data'];
|
||||
}
|
||||
} else if (type == 'onLoad') {
|
||||
videoList.addAll(res['data']);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ class SSearchController extends GetxController {
|
||||
Future querySearchSuggest(String value) async {
|
||||
var result = await SearchHttp.searchSuggest(term: value);
|
||||
if (result['status']) {
|
||||
if (result['data'].isNotEmpty) {
|
||||
if (result['data'] is SearchSuggestModel) {
|
||||
searchSuggestList.value = result['data'].tag;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/constants.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/utils/utils.dart';
|
||||
@ -12,7 +13,14 @@ Widget searchArticlePanel(BuildContext context, ctr, list) {
|
||||
itemCount: list.length,
|
||||
itemBuilder: (context, index) {
|
||||
return InkWell(
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
Get.toNamed('/htmlRender', parameters: {
|
||||
'url': 'www.bilibili.com/read/cv${list[index].id}',
|
||||
'title': list[index].subTitle,
|
||||
'id': 'cv${list[index].id}',
|
||||
'dynamicType': 'read'
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
StyleString.safeSpace, 5, StyleString.safeSpace, 5),
|
||||
|
@ -79,6 +79,12 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
||||
setKey: SettingBoxKey.enableWordRe,
|
||||
defaultVal: false,
|
||||
),
|
||||
const SetSwitchItem(
|
||||
title: '首页推荐刷新',
|
||||
subTitle: '下拉刷新时保留上次内容',
|
||||
setKey: SettingBoxKey.enableSaveLastData,
|
||||
defaultVal: false,
|
||||
),
|
||||
ListTile(
|
||||
dense: false,
|
||||
title: Text('评论展示', style: titleStyle),
|
||||
|
@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class SetDiaplayMode extends StatefulWidget {
|
||||
const SetDiaplayMode({super.key});
|
||||
@ -14,6 +16,7 @@ class _SetDiaplayModeState extends State<SetDiaplayMode> {
|
||||
List<DisplayMode> modes = <DisplayMode>[];
|
||||
DisplayMode? active;
|
||||
DisplayMode? preferred;
|
||||
Box setting = GStrorage.setting;
|
||||
|
||||
final ValueNotifier<int> page = ValueNotifier<int>(0);
|
||||
late final PageController controller = PageController()
|
||||
@ -29,24 +32,36 @@ class _SetDiaplayModeState extends State<SetDiaplayMode> {
|
||||
});
|
||||
}
|
||||
|
||||
// 获取所有的mode
|
||||
Future<void> fetchAll() async {
|
||||
preferred = await FlutterDisplayMode.preferred;
|
||||
active = await FlutterDisplayMode.active;
|
||||
// GStorage().setDisplayModeType(preferred!);
|
||||
await setting.put(SettingBoxKey.displayMode, preferred.toString());
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
// 初始化mode/手动设置
|
||||
Future<void> init() async {
|
||||
try {
|
||||
modes = await FlutterDisplayMode.supported;
|
||||
} on PlatformException catch (e) {
|
||||
print(e);
|
||||
}
|
||||
// var res = await GStorage().getDisplayModeType();
|
||||
// preferred = modes.toList().firstWhere((el) => el == res);
|
||||
var res = await getDisplayModeType(modes);
|
||||
|
||||
preferred = modes.toList().firstWhere((el) => el == res);
|
||||
FlutterDisplayMode.setPreferredMode(preferred!);
|
||||
}
|
||||
|
||||
Future<DisplayMode> getDisplayModeType(modes) async {
|
||||
var value = setting.get(SettingBoxKey.displayMode);
|
||||
DisplayMode f = DisplayMode.auto;
|
||||
if (value != null) {
|
||||
f = modes.firstWhere((e) => e.toString() == value);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
@ -199,6 +199,9 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
|
||||
// 视频介绍
|
||||
showIntroDetail() {
|
||||
if (loadingStatus) {
|
||||
return;
|
||||
}
|
||||
feedBack();
|
||||
showBottomSheet(
|
||||
context: context,
|
||||
@ -254,22 +257,25 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
SizedBox(
|
||||
width: 34,
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding:
|
||||
MaterialStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor:
|
||||
MaterialStateProperty.resolveWith((states) {
|
||||
return t.highlightColor.withOpacity(0.2);
|
||||
}),
|
||||
),
|
||||
onPressed: showIntroDetail,
|
||||
icon: Icon(
|
||||
Icons.more_horiz,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
Opacity(
|
||||
opacity: loadingStatus ? 0 : 1,
|
||||
child: SizedBox(
|
||||
width: 34,
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding:
|
||||
MaterialStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor:
|
||||
MaterialStateProperty.resolveWith((states) {
|
||||
return t.highlightColor.withOpacity(0.2);
|
||||
}),
|
||||
),
|
||||
onPressed: showIntroDetail,
|
||||
icon: Icon(
|
||||
Icons.more_horiz,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
||||
@ -129,7 +130,50 @@ class IntroDetail extends StatelessWidget {
|
||||
final currentDesc = descV2[index];
|
||||
switch (currentDesc.type) {
|
||||
case 1:
|
||||
return TextSpan(text: currentDesc.rawText);
|
||||
List<InlineSpan> spanChildren = [];
|
||||
RegExp urlRegExp = RegExp(r'https?://\S+\b');
|
||||
Iterable<Match> matches = urlRegExp.allMatches(currentDesc.rawText);
|
||||
|
||||
int previousEndIndex = 0;
|
||||
for (Match match in matches) {
|
||||
if (match.start > previousEndIndex) {
|
||||
spanChildren.add(TextSpan(
|
||||
text: currentDesc.rawText
|
||||
.substring(previousEndIndex, match.start)));
|
||||
}
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: match.group(0),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary), // 设置颜色为蓝色
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// 处理点击事件
|
||||
try {
|
||||
Get.toNamed(
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url': match.group(0)!,
|
||||
'type': 'url',
|
||||
'pageTitle': match.group(0)!,
|
||||
},
|
||||
);
|
||||
} catch (err) {
|
||||
SmartDialog.showToast(err.toString());
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
previousEndIndex = match.end;
|
||||
}
|
||||
|
||||
if (previousEndIndex < currentDesc.rawText.length) {
|
||||
spanChildren.add(TextSpan(
|
||||
text: currentDesc.rawText.substring(previousEndIndex)));
|
||||
}
|
||||
|
||||
TextSpan result = TextSpan(children: spanChildren);
|
||||
return result;
|
||||
case 2:
|
||||
final colorSchemePrimary = Theme.of(context).colorScheme.primary;
|
||||
final heroTag = Utils.makeHeroTag(currentDesc.bizId);
|
||||
|
@ -96,8 +96,8 @@ class VideoReplyController extends GetxController {
|
||||
} else {
|
||||
replyList.addAll(replies);
|
||||
}
|
||||
count.value = res['data'].page.count;
|
||||
}
|
||||
count.value = res['data'].page.count;
|
||||
isLoadingMore = false;
|
||||
return res;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
Future? _futureBuilderFuture;
|
||||
bool _isFabVisible = true;
|
||||
String replyLevel = '1';
|
||||
late String heroTag;
|
||||
|
||||
// 添加页面缓存
|
||||
@override
|
||||
@ -46,16 +47,17 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
int oid = widget.bvid != null ? IdUtils.bv2av(widget.bvid!) : 0;
|
||||
super.initState();
|
||||
int oid = widget.bvid != null ? IdUtils.bv2av(widget.bvid!) : 0;
|
||||
heroTag = Get.arguments['heroTag'];
|
||||
replyLevel = widget.replyLevel ?? '1';
|
||||
if (replyLevel == '2') {
|
||||
_videoReplyController = Get.put(
|
||||
VideoReplyController(oid, widget.rpid.toString(), replyLevel),
|
||||
tag: widget.rpid.toString());
|
||||
} else {
|
||||
_videoReplyController = Get.put(VideoReplyController(oid, '', replyLevel),
|
||||
tag: Get.arguments['heroTag']);
|
||||
_videoReplyController =
|
||||
Get.put(VideoReplyController(oid, '', replyLevel), tag: heroTag);
|
||||
}
|
||||
|
||||
fabAnimationCtr = AnimationController(
|
||||
@ -106,7 +108,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
// 展示二级回复
|
||||
void replyReply(replyItem) {
|
||||
VideoDetailController videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
||||
Get.find<VideoDetailController>(tag: heroTag);
|
||||
if (replyItem != null) {
|
||||
videoDetailCtr.oid = replyItem.oid;
|
||||
videoDetailCtr.fRpid = replyItem.rpid!;
|
||||
@ -193,7 +195,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
future: _futureBuilderFuture,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
Map data = snapshot.data as Map;
|
||||
var data = snapshot.data;
|
||||
if (data['status']) {
|
||||
// 请求成功
|
||||
return Obx(
|
||||
|
@ -26,11 +26,6 @@ class VideoReplyReplyController extends GetxController {
|
||||
currentPage = 0;
|
||||
}
|
||||
|
||||
// 上拉加载
|
||||
Future onLoad() async {
|
||||
queryReplyList(type: 'onLoad');
|
||||
}
|
||||
|
||||
Future queryReplyList({type = 'init'}) async {
|
||||
if (type == 'init') {
|
||||
currentPage = 0;
|
||||
@ -49,11 +44,11 @@ class VideoReplyReplyController extends GetxController {
|
||||
if (replyList.length == res['data'].page.count) {
|
||||
noMore.value = '没有更多了';
|
||||
}
|
||||
currentPage++;
|
||||
} else {
|
||||
// 未登录状态replies可能返回null
|
||||
noMore.value = currentPage == 0 ? '还没有评论' : '没有更多了';
|
||||
}
|
||||
currentPage++;
|
||||
if (type == 'init') {
|
||||
// List<ReplyItemModel> replies = res['data'].replies;
|
||||
// 添加置顶回复
|
||||
@ -72,6 +67,10 @@ class VideoReplyReplyController extends GetxController {
|
||||
// res['data'].replies = replies;
|
||||
replyList.value = replies;
|
||||
} else {
|
||||
// 每次回复之后,翻页请求有且只有相同的一条回复数据
|
||||
if (replies.length == 1 && replies.last.rpid == replyList.last.rpid) {
|
||||
return;
|
||||
}
|
||||
replyList.addAll(replies);
|
||||
// res['data'].replies.addAll(replyList);
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
@ -54,9 +55,9 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
() {
|
||||
if (scrollController.position.pixels >=
|
||||
scrollController.position.maxScrollExtent - 300) {
|
||||
if (!_videoReplyReplyController.isLoadingMore) {
|
||||
_videoReplyReplyController.onLoad();
|
||||
}
|
||||
EasyThrottle.throttle('replylist', const Duration(seconds: 2), () {
|
||||
_videoReplyReplyController.queryReplyList(type: 'onLoad');
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
@ -99,10 +99,13 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
plPlayerController!.triggerFullScreen(status: false);
|
||||
}
|
||||
// 播放完展示控制栏
|
||||
PiPStatus currentStatus = await videoDetailController.floating!.pipStatus;
|
||||
if (currentStatus == PiPStatus.disabled) {
|
||||
plPlayerController!.onLockControl(false);
|
||||
}
|
||||
try {
|
||||
PiPStatus currentStatus =
|
||||
await videoDetailController.floating!.pipStatus;
|
||||
if (currentStatus == PiPStatus.disabled) {
|
||||
plPlayerController!.onLockControl(false);
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,10 +143,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
if (setting.get(SettingBoxKey.enableAutoBrightness, defaultValue: false)) {
|
||||
videoDetailController.brightness = plPlayerController!.brightness.value;
|
||||
}
|
||||
videoDetailController.defaultST = plPlayerController!.position.value;
|
||||
videoIntroController.isPaused = true;
|
||||
plPlayerController!.removeStatusLister(playerListener);
|
||||
plPlayerController!.pause();
|
||||
if (plPlayerController != null) {
|
||||
videoDetailController.defaultST = plPlayerController!.position.value;
|
||||
videoIntroController.isPaused = true;
|
||||
plPlayerController!.removeStatusLister(playerListener);
|
||||
plPlayerController!.pause();
|
||||
}
|
||||
super.didPushNext();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'controller.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
@ -24,11 +25,20 @@ class _WebviewPageState extends State<WebviewPage> {
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
const SizedBox(width: 4),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
_webviewController.controller.reload();
|
||||
},
|
||||
child: const Text('刷新'),
|
||||
icon: Icon(Icons.refresh_outlined,
|
||||
color: Theme.of(context).colorScheme.primary),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
launchUrl(Uri.parse(_webviewController.url));
|
||||
},
|
||||
icon: Icon(Icons.open_in_browser_outlined,
|
||||
color: Theme.of(context).colorScheme.primary),
|
||||
),
|
||||
Obx(
|
||||
() => _webviewController.type.value == 'login'
|
||||
@ -38,7 +48,7 @@ class _WebviewPageState extends State<WebviewPage> {
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
const SizedBox(width: 10)
|
||||
const SizedBox(width: 12)
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
|
@ -449,7 +449,9 @@ class PlPlayerController {
|
||||
for (var element in _statusListeners) {
|
||||
element(event ? PlayerStatus.playing : PlayerStatus.paused);
|
||||
}
|
||||
makeHeartBeat(_position.value.inSeconds, type: 'status');
|
||||
if (videoPlayerController!.state.position.inSeconds != 0) {
|
||||
makeHeartBeat(_position.value.inSeconds, type: 'status');
|
||||
}
|
||||
}),
|
||||
videoPlayerController!.stream.completed.listen((event) {
|
||||
if (event) {
|
||||
@ -510,6 +512,7 @@ class PlPlayerController {
|
||||
position = Duration.zero;
|
||||
}
|
||||
_position.value = position;
|
||||
_heartDuration = position.inSeconds;
|
||||
if (duration.value.inSeconds != 0) {
|
||||
if (type != 'slider') {
|
||||
/// 拖动进度条调节时,不等待第一帧,防止抖动
|
||||
@ -814,6 +817,10 @@ class PlPlayerController {
|
||||
}
|
||||
|
||||
toggleFullScreen(true);
|
||||
bool isValid =
|
||||
direction.value == 'vertical' || mode == FullScreenMode.vertical
|
||||
? true
|
||||
: false;
|
||||
var result = await showDialog(
|
||||
context: Get.context!,
|
||||
useSafeArea: false,
|
||||
@ -821,12 +828,10 @@ class PlPlayerController {
|
||||
backgroundColor: Colors.black,
|
||||
child: SafeArea(
|
||||
// 忽略手机安全区域
|
||||
top: isValid,
|
||||
left: false,
|
||||
right: false,
|
||||
bottom:
|
||||
direction.value == 'vertical' || mode == FullScreenMode.vertical
|
||||
? true
|
||||
: false,
|
||||
bottom: isValid,
|
||||
child: PLVideoPlayer(
|
||||
controller: this,
|
||||
headerControl: headerControl,
|
||||
@ -878,7 +883,7 @@ class PlPlayerController {
|
||||
}
|
||||
|
||||
// 记录播放记录
|
||||
Future makeHeartBeat(progress, {type = 'playing'}) async {
|
||||
Future makeHeartBeat(int progress, {type = 'playing'}) async {
|
||||
if (!_enableHeart) {
|
||||
return false;
|
||||
}
|
||||
|
@ -547,34 +547,38 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
),
|
||||
|
||||
// 头部、底部控制条
|
||||
Obx(
|
||||
() => Column(
|
||||
children: [
|
||||
if (widget.headerControl != null || _.headerControl != null)
|
||||
SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Obx(
|
||||
() => Column(
|
||||
children: [
|
||||
if (widget.headerControl != null || _.headerControl != null)
|
||||
ClipRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: AppBarAni(
|
||||
controller: animationController,
|
||||
visible: !_.controlsLock.value && _.showControls.value,
|
||||
position: 'top',
|
||||
child: widget.headerControl ?? _.headerControl!,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
ClipRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: AppBarAni(
|
||||
controller: animationController,
|
||||
visible: !_.controlsLock.value && _.showControls.value,
|
||||
position: 'top',
|
||||
child: widget.headerControl ?? _.headerControl!,
|
||||
position: 'bottom',
|
||||
child: widget.bottomControl ??
|
||||
BottomControl(
|
||||
controller: widget.controller,
|
||||
triggerFullScreen:
|
||||
widget.controller.triggerFullScreen),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
ClipRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: AppBarAni(
|
||||
controller: animationController,
|
||||
visible: !_.controlsLock.value && _.showControls.value,
|
||||
position: 'bottom',
|
||||
child: widget.bottomControl ??
|
||||
BottomControl(
|
||||
controller: widget.controller,
|
||||
triggerFullScreen:
|
||||
widget.controller.triggerFullScreen),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
@ -18,6 +18,7 @@ import 'package:pilipala/pages/html/index.dart';
|
||||
import 'package:pilipala/pages/later/index.dart';
|
||||
import 'package:pilipala/pages/liveRoom/view.dart';
|
||||
import 'package:pilipala/pages/member/index.dart';
|
||||
import 'package:pilipala/pages/member_search/index.dart';
|
||||
import 'package:pilipala/pages/preview/index.dart';
|
||||
import 'package:pilipala/pages/search/index.dart';
|
||||
import 'package:pilipala/pages/searchResult/index.dart';
|
||||
@ -86,6 +87,7 @@ class Routes {
|
||||
CustomGetPage(name: '/liveRoom', page: () => const LiveRoomPage()),
|
||||
// 用户中心
|
||||
CustomGetPage(name: '/member', page: () => const MemberPage()),
|
||||
CustomGetPage(name: '/memberSearch', page: () => const MemberSearchPage()),
|
||||
// 二级回复
|
||||
CustomGetPage(
|
||||
name: '/replyReply', page: () => const VideoReplyReplyPanel()),
|
||||
|
@ -121,6 +121,7 @@ class SettingBoxKey {
|
||||
static const String enableWordRe = 'enableWordRe';
|
||||
static const String enableSearchWord = 'enableSearchWord';
|
||||
static const String enableRcmdDynamic = 'enableRcmdDynamic';
|
||||
static const String enableSaveLastData = 'enableSaveLastData';
|
||||
|
||||
/// 外观
|
||||
static const String themeMode = 'themeMode';
|
||||
@ -129,6 +130,7 @@ class SettingBoxKey {
|
||||
static const String customColor = 'customColor'; // 自定义主题色
|
||||
static const String iosTransition = 'iosTransition'; // ios路由
|
||||
static const String enableSingleRow = 'enableSingleRow'; // 首页单列
|
||||
static const String displayMode = 'displayMode';
|
||||
}
|
||||
|
||||
class LocalCacheKey {
|
||||
|
@ -721,18 +721,18 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: loading_more_list
|
||||
sha256: aa680edc81cf024c394dccfa7ba1db701a5efb23ec1b8c657308428ce9da11d1
|
||||
sha256: "6b49eb935345d6cf291e0367d3c238ef0a525a08b671ee41e09ee67d41888a7a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.3"
|
||||
version: "6.0.0"
|
||||
loading_more_list_library:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: loading_more_list_library
|
||||
sha256: "31348925a98748ffe04f661e4b47df37103fabad39442064fcf59148a5fee2dd"
|
||||
sha256: de6b57edbab83022180f053ec3f598dd5e1192cfd6a285882b8155e3cb5dc581
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "3.0.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.0.7
|
||||
version: 1.0.8
|
||||
|
||||
environment:
|
||||
sdk: ">=2.19.6 <3.0.0"
|
||||
@ -70,7 +70,7 @@ dependencies:
|
||||
# 解决sliver滑动不同步
|
||||
extended_nested_scroll_view: ^6.1.2
|
||||
# 上拉加载
|
||||
loading_more_list: ^5.0.3
|
||||
loading_more_list: ^6.0.0
|
||||
# 下拉刷新
|
||||
pull_to_refresh_notification: ^3.0.1
|
||||
# 图标
|
||||
|
Reference in New Issue
Block a user