Merge branch 'design'
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||
import 'package:floating/floating.dart';
|
||||
@ -76,7 +77,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
getStatusHeight();
|
||||
heroTag = Get.arguments['heroTag'];
|
||||
vdCtr = Get.put(VideoDetailController(), tag: heroTag);
|
||||
vdCtr.sheetHeight.value = localCache.get('sheetHeight');
|
||||
vdCtr.sheetHeight.value = GlobalDataCache.sheetHeight;
|
||||
videoIntroController = Get.put(
|
||||
VideoIntroController(bvid: Get.parameters['bvid']!),
|
||||
tag: heroTag);
|
||||
@ -223,8 +224,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
void _extendNestCtrListener() {
|
||||
final double offset = _extendNestCtr.position.pixels;
|
||||
if (vdCtr.videoDirection.value == 'horizontal') {
|
||||
vdCtr.sheetHeight.value =
|
||||
Get.size.height - videoHeight - statusBarHeight + offset;
|
||||
vdCtr.sheetHeight.value = max(GlobalDataCache.sheetHeight,
|
||||
Get.size.height - videoHeight - statusBarHeight + offset);
|
||||
appbarStream.add(offset);
|
||||
} else {
|
||||
if (offset > (Get.size.width * 22 / 16 - videoHeight)) {
|
||||
|
||||
@ -45,6 +45,7 @@ class WhisperController extends GetxController {
|
||||
if (isLoading) return;
|
||||
var res = await MsgHttp.sessionList(
|
||||
endTs: type == 'onLoad' ? sessionList.last.sessionTs : null);
|
||||
try {
|
||||
if (res['status'] &&
|
||||
res['data'].sessionList != null &&
|
||||
res['data'].sessionList.isNotEmpty) {
|
||||
@ -75,6 +76,13 @@ class WhisperController extends GetxController {
|
||||
sessionList.value = res['data'].sessionList;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
res = {
|
||||
'status': false,
|
||||
'message': err.toString(),
|
||||
};
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -44,7 +44,24 @@ class _WhisperPageState extends State<WhisperPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('消息')),
|
||||
appBar: AppBar(
|
||||
title: const Text('消息'),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.open_in_browser_rounded,
|
||||
color: Theme.of(context).colorScheme.primary),
|
||||
tooltip: '用浏览器打开',
|
||||
onPressed: () {
|
||||
Get.toNamed('/webview', parameters: {
|
||||
'url': 'https://message.bilibili.com',
|
||||
'type': 'whisper',
|
||||
'pageTitle': '消息中心',
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 12)
|
||||
],
|
||||
),
|
||||
body: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
_whisperController.unread();
|
||||
|
||||
Reference in New Issue
Block a user