From 7e4fa47d00d64f216025a195d8a45051db4c8361 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 2 May 2024 20:45:24 +0800 Subject: [PATCH] :bug: Bug fixes --- lib/screens/account/personalize.dart | 4 ++-- lib/screens/chat/chat.dart | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/screens/account/personalize.dart b/lib/screens/account/personalize.dart index cef1416..445d9dc 100644 --- a/lib/screens/account/personalize.dart +++ b/lib/screens/account/personalize.dart @@ -84,7 +84,6 @@ class _PersonalizeScreenWidgetState extends State { getRequestUri('passport', '/api/users/me'), headers: {'Content-Type': 'application/json'}, body: jsonEncode({ - 'name': _usernameController.value.text, 'nick': _nicknameController.value.text, 'description': _descriptionController.value.text, 'first_name': _firstNameController.value.text, @@ -117,7 +116,7 @@ class _PersonalizeScreenWidgetState extends State { @override Widget build(BuildContext context) { return Container( - padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 32), + padding: const EdgeInsets.symmetric(vertical: 28, horizontal: 32), child: Column( children: [ _isSubmitting ? const LinearProgressIndicator().animate().scaleX() : Container(), @@ -126,6 +125,7 @@ class _PersonalizeScreenWidgetState extends State { Flexible( flex: 1, child: TextField( + readOnly: true, controller: _usernameController, decoration: InputDecoration( border: const OutlineInputBorder(), diff --git a/lib/screens/chat/chat.dart b/lib/screens/chat/chat.dart index fc62458..b074b1a 100644 --- a/lib/screens/chat/chat.dart +++ b/lib/screens/chat/chat.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart'; import 'package:provider/provider.dart'; +import 'package:solian/models/channel.dart'; import 'package:solian/models/message.dart'; import 'package:solian/models/pagination.dart'; import 'package:solian/providers/auth.dart'; @@ -200,7 +201,13 @@ class _ChatScreenWidgetState extends State { ); return FutureBuilder( - future: _chat.fetchChannel(widget.alias), + future: (() async { + final res = await Future.wait([ + _chat.fetchOngoingCall(widget.alias), + _chat.fetchChannel(widget.alias), + ]); + return res[0] as Channel; + })(), builder: (context, snapshot) { if (!snapshot.hasData || snapshot.data == null) { return const Center(child: CircularProgressIndicator());