Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-06 14:29:51 +08:00
parent 9f33488248
commit b723529d7f
6 changed files with 38 additions and 30 deletions

View File

@@ -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);
}); });
} }

View File

@@ -256,5 +256,5 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
enablePublish.value = value.trim().isNotEmpty; enablePublish.value = value.trim().isNotEmpty;
} }
void onSave() {} void onSave();
} }

View File

@@ -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(

View File

@@ -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();
} }

View File

@@ -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);
}); });
} }

View File

@@ -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();
} }
}, },