mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-01-13 11:40:27 +00:00
fix: room logic
This commit is contained in:
parent
4718b4627b
commit
f9c06c0980
@ -228,8 +228,9 @@ class CreateRoomDialog extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
final socialLinks = socialLinksController.text.split('\n');
|
||||
|
||||
final socialLinks = socialLinksController.text.split('\n').map((e) => e.trim()).toList();
|
||||
// 移除空链接
|
||||
socialLinks.removeWhere((link) => link.trim().isEmpty);
|
||||
// 检查是否为 https 开头的链接
|
||||
final invalidLinks = socialLinks.where((link) => !link.startsWith('https://')).toList();
|
||||
if (invalidLinks.isNotEmpty) {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:starcitizen_doctor/common/utils/base_utils.dart';
|
||||
import 'package:starcitizen_doctor/provider/party_room.dart';
|
||||
import 'package:starcitizen_doctor/ui/party_room/party_room_ui_model.dart';
|
||||
import 'package:starcitizen_doctor/ui/party_room/widgets/create_room_dialog.dart';
|
||||
@ -114,14 +115,16 @@ class PartyRoomHeader extends ConsumerWidget {
|
||||
width: double.infinity,
|
||||
child: Button(
|
||||
onPressed: () async {
|
||||
final userOK = await showConfirmDialogs(context, "提示", Text("确认离开房间吗?"));
|
||||
if (!userOK) return;
|
||||
await partyRoom.leaveRoom();
|
||||
},
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.resolveWith((state) {
|
||||
if (state.isHovered || state.isPressed) {
|
||||
return const Color(0xFFDA373C);
|
||||
return const Color(0xFF404249);
|
||||
}
|
||||
return const Color(0xFF404249);
|
||||
return const Color(0xFF404249).withValues(alpha: .6);
|
||||
}),
|
||||
foregroundColor: WidgetStateProperty.resolveWith((state) {
|
||||
if (state.isHovered || state.isPressed) {
|
||||
|
||||
@ -540,7 +540,10 @@ class PartyRoomListPage extends HookConsumerWidget {
|
||||
final passwordController = TextEditingController();
|
||||
return ContentDialog(
|
||||
title: const Text('输入房间密码'),
|
||||
content: TextBox(controller: passwordController, placeholder: '请输入密码', obscureText: true),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [TextBox(controller: passwordController, placeholder: '请输入密码', obscureText: true)],
|
||||
),
|
||||
actions: [
|
||||
Button(child: const Text('取消'), onPressed: () => Navigator.pop(context)),
|
||||
FilledButton(child: const Text('加入'), onPressed: () => Navigator.pop(context, passwordController.text)),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user