🐛 Bug fixes

This commit is contained in:
LittleSheep 2024-05-02 20:45:24 +08:00
parent 7633619edd
commit 7e4fa47d00
2 changed files with 10 additions and 3 deletions

View File

@ -84,7 +84,6 @@ class _PersonalizeScreenWidgetState extends State<PersonalizeScreenWidget> {
getRequestUri('passport', '/api/users/me'), getRequestUri('passport', '/api/users/me'),
headers: {'Content-Type': 'application/json'}, headers: {'Content-Type': 'application/json'},
body: jsonEncode({ body: jsonEncode({
'name': _usernameController.value.text,
'nick': _nicknameController.value.text, 'nick': _nicknameController.value.text,
'description': _descriptionController.value.text, 'description': _descriptionController.value.text,
'first_name': _firstNameController.value.text, 'first_name': _firstNameController.value.text,
@ -117,7 +116,7 @@ class _PersonalizeScreenWidgetState extends State<PersonalizeScreenWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 32), padding: const EdgeInsets.symmetric(vertical: 28, horizontal: 32),
child: Column( child: Column(
children: [ children: [
_isSubmitting ? const LinearProgressIndicator().animate().scaleX() : Container(), _isSubmitting ? const LinearProgressIndicator().animate().scaleX() : Container(),
@ -126,6 +125,7 @@ class _PersonalizeScreenWidgetState extends State<PersonalizeScreenWidget> {
Flexible( Flexible(
flex: 1, flex: 1,
child: TextField( child: TextField(
readOnly: true,
controller: _usernameController, controller: _usernameController,
decoration: InputDecoration( decoration: InputDecoration(
border: const OutlineInputBorder(), border: const OutlineInputBorder(),

View File

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_animate/flutter_animate.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart'; import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:solian/models/channel.dart';
import 'package:solian/models/message.dart'; import 'package:solian/models/message.dart';
import 'package:solian/models/pagination.dart'; import 'package:solian/models/pagination.dart';
import 'package:solian/providers/auth.dart'; import 'package:solian/providers/auth.dart';
@ -200,7 +201,13 @@ class _ChatScreenWidgetState extends State<ChatScreenWidget> {
); );
return FutureBuilder( 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) { builder: (context, snapshot) {
if (!snapshot.hasData || snapshot.data == null) { if (!snapshot.hasData || snapshot.data == null) {
return const Center(child: CircularProgressIndicator()); return const Center(child: CircularProgressIndicator());