mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -145,15 +145,14 @@ class MyApp extends StatelessWidget {
|
|||||||
FlutterDisplayMode.supported.then((value) {
|
FlutterDisplayMode.supported.then((value) {
|
||||||
modes = value;
|
modes = value;
|
||||||
var storageDisplay = GStorage.setting.get(SettingBoxKey.displayMode);
|
var storageDisplay = GStorage.setting.get(SettingBoxKey.displayMode);
|
||||||
DisplayMode f = DisplayMode.auto;
|
DisplayMode? displayMode;
|
||||||
if (storageDisplay != null) {
|
if (storageDisplay != null) {
|
||||||
f = modes.firstWhere(
|
displayMode = modes.firstWhereOrNull(
|
||||||
(e) => e.toString() == storageDisplay,
|
(e) => e.toString() == storageDisplay,
|
||||||
orElse: () => f,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
DisplayMode preferred = modes.toList().firstWhere((el) => el == f);
|
displayMode ??= DisplayMode.auto;
|
||||||
FlutterDisplayMode.setPreferredMode(preferred);
|
FlutterDisplayMode.setPreferredMode(displayMode);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -256,5 +256,5 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
|||||||
enablePublish.value = value.trim().isNotEmpty;
|
enablePublish.value = value.trim().isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void onSave() {}
|
void onSave();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,22 +228,23 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
|
|||||||
"biz_id": "",
|
"biz_id": "",
|
||||||
});
|
});
|
||||||
case RichTextType.vote:
|
case RichTextType.vote:
|
||||||
list.add({
|
list
|
||||||
"raw_text": e.rawText,
|
..add({
|
||||||
"type": 4,
|
"raw_text": e.rawText,
|
||||||
"biz_id": e.id,
|
"type": 4,
|
||||||
});
|
"biz_id": e.id,
|
||||||
list.add({
|
})
|
||||||
"raw_text": ' ',
|
..add({
|
||||||
"type": 1,
|
"raw_text": ' ',
|
||||||
"biz_id": "",
|
"type": 1,
|
||||||
});
|
"biz_id": "",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
double _mentionOffset = 0;
|
late double _mentionOffset = 0;
|
||||||
Future<void> onMention([bool fromClick = false]) async {
|
Future<void> onMention([bool fromClick = false]) async {
|
||||||
controller.keepChatPanel();
|
controller.keepChatPanel();
|
||||||
final res = await DynMentionPanel.onDynMention(
|
final res = await DynMentionPanel.onDynMention(
|
||||||
|
|||||||
@@ -113,14 +113,18 @@ class LiveRoomController extends GetxController {
|
|||||||
acceptQnList = item.acceptQn!.map((e) {
|
acceptQnList = item.acceptQn!.map((e) {
|
||||||
return (
|
return (
|
||||||
code: e,
|
code: e,
|
||||||
desc: LiveQuality.values
|
desc:
|
||||||
.firstWhere((element) => element.code == e)
|
LiveQuality.values
|
||||||
.description,
|
.firstWhereOrNull((element) => element.code == e)
|
||||||
|
?.description ??
|
||||||
|
e.toString(),
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
currentQnDesc.value = LiveQuality.values
|
currentQnDesc.value =
|
||||||
.firstWhere((element) => element.code == currentQn)
|
LiveQuality.values
|
||||||
.description;
|
.firstWhereOrNull((element) => element.code == currentQn)
|
||||||
|
?.description ??
|
||||||
|
currentQn.toString();
|
||||||
String videoUrl = VideoUtils.getCdnUrl(item);
|
String videoUrl = VideoUtils.getCdnUrl(item);
|
||||||
await playerInit(videoUrl);
|
await playerInit(videoUrl);
|
||||||
isLoaded.value = true;
|
isLoaded.value = true;
|
||||||
@@ -251,9 +255,11 @@ class LiveRoomController extends GetxController {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
currentQn = qn;
|
currentQn = qn;
|
||||||
currentQnDesc.value = LiveQuality.values
|
currentQnDesc.value =
|
||||||
.firstWhere((element) => element.code == currentQn)
|
LiveQuality.values
|
||||||
.description;
|
.firstWhereOrNull((element) => element.code == currentQn)
|
||||||
|
?.description ??
|
||||||
|
currentQn.toString();
|
||||||
return queryLiveUrl();
|
return queryLiveUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class _SetDisplayModeState extends State<SetDisplayMode> {
|
|||||||
preferred ??= DisplayMode.auto;
|
preferred ??= DisplayMode.auto;
|
||||||
|
|
||||||
FlutterDisplayMode.setPreferredMode(preferred!).whenComplete(() {
|
FlutterDisplayMode.setPreferredMode(preferred!).whenComplete(() {
|
||||||
Future.delayed(const Duration(milliseconds: 100)).whenComplete(fetchAll);
|
Future.delayed(const Duration(milliseconds: 100), fetchAll);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -551,13 +551,15 @@ class PageUtils {
|
|||||||
initIndex: index,
|
initIndex: index,
|
||||||
setStatusBar: false,
|
setStatusBar: false,
|
||||||
onClose: (value) async {
|
onClose: (value) async {
|
||||||
if (value == false) {
|
if (!value) {
|
||||||
await ctr.reverse();
|
try {
|
||||||
|
await ctr.reverse();
|
||||||
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
ctr.dispose();
|
ctr.dispose();
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
if (value == false) {
|
if (!value) {
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user