feat: implement chat history, theme customization, and password management
- Added chat history persistence for active rooms with auto-cleanup on stream end. - Overhauled Settings page with user profile, theme color picker, and password change. - Added backend API for user password updates. - Integrated flutter_launcher_icons and updated app icon to 'H' logo. - Fixed 'Duplicate keys' bug in danmaku by using UniqueKey and filtering historical messages. - Updated version to 1.0.0-beta3.5 and author info.
This commit is contained in:
@@ -62,7 +62,7 @@ class _PlayerPageState extends State<PlayerPage> {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_messages.insert(0, msg);
|
||||
if (msg.type == "chat" || msg.type == "danmaku") {
|
||||
if (!msg.isHistory && (msg.type == "chat" || msg.type == "danmaku")) {
|
||||
_addDanmaku(msg.content);
|
||||
}
|
||||
});
|
||||
@@ -71,15 +71,15 @@ class _PlayerPageState extends State<PlayerPage> {
|
||||
}
|
||||
|
||||
void _addDanmaku(String text) {
|
||||
final id = DateTime.now().millisecondsSinceEpoch;
|
||||
final top = 20.0 + (id % 6) * 30.0;
|
||||
final key = UniqueKey();
|
||||
final top = 20.0 + (DateTime.now().millisecondsSinceEpoch % 6) * 30.0;
|
||||
|
||||
final danmaku = _DanmakuItem(
|
||||
key: ValueKey(id),
|
||||
key: key,
|
||||
text: text,
|
||||
top: top,
|
||||
onFinished: () {
|
||||
if (mounted) setState(() => _danmakus.removeWhere((w) => w.key == ValueKey(id)));
|
||||
if (mounted) setState(() => _danmakus.removeWhere((w) => w.key == key));
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user