move to new sdk
This commit is contained in:
parent
7e3d330a68
commit
6868f38c7c
26 changed files with 172 additions and 201 deletions
|
|
@ -33,7 +33,7 @@ class AppInfo extends StatelessWidget {
|
|||
),
|
||||
ListTile(
|
||||
title: Text('Homeserver:'),
|
||||
subtitle: Text(client.homeserver),
|
||||
subtitle: Text(client.api.homeserver.toString()),
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Device name:'),
|
||||
|
|
|
|||
|
|
@ -14,9 +14,8 @@ class AuthWebView extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final url =
|
||||
'/_matrix/client/r0/auth/$authType/fallback/web?session=$session' +
|
||||
Matrix.of(context).client.homeserver;
|
||||
final url = Matrix.of(context).client.api.homeserver.toString() +
|
||||
'/_matrix/client/r0/auth/$authType/fallback/web?session=$session';
|
||||
if (kIsWeb) launch(url);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ class _ChatState extends State<_Chat> {
|
|||
.client
|
||||
.onPresence
|
||||
.stream
|
||||
.where((p) => p.sender == room.directChatMatrixID),
|
||||
.where((p) => p.senderId == room.directChatMatrixID),
|
||||
builder: (context, snapshot) {
|
||||
return ListTile(
|
||||
leading: Avatar(room.avatar, room.displayname),
|
||||
|
|
@ -557,7 +557,8 @@ class _ChatState extends State<_Chat> {
|
|||
);
|
||||
}
|
||||
selectedEvents.sort(
|
||||
(a, b) => a.time.compareTo(b.time),
|
||||
(a, b) => a.originServerTs
|
||||
.compareTo(b.originServerTs),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:famedlysdk/matrix_api.dart';
|
||||
import 'package:fluffychat/components/adaptive_page_layout.dart';
|
||||
import 'package:fluffychat/components/chat_settings_popup_menu.dart';
|
||||
import 'package:fluffychat/components/content_banner.dart';
|
||||
|
|
@ -61,28 +62,22 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
var newAliases = List<String>.from(aliases);
|
||||
newAliases.add(canonicalAlias);
|
||||
final response = await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
widget.room.client.jsonRequest(
|
||||
type: HTTPType.GET,
|
||||
action: '/client/r0/directory/room/$canonicalAlias',
|
||||
),
|
||||
widget.room.client.api.requestRoomAliasInformations(canonicalAlias),
|
||||
);
|
||||
if (response == false) {
|
||||
final success =
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
widget.room.client.jsonRequest(
|
||||
type: HTTPType.PUT,
|
||||
action: '/client/r0/directory/room/$canonicalAlias',
|
||||
data: {'room_id': widget.room.id}),
|
||||
widget.room.client.api
|
||||
.createRoomAlias(canonicalAlias, widget.room.id),
|
||||
);
|
||||
if (success == false) return;
|
||||
}
|
||||
}
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
widget.room.client.jsonRequest(
|
||||
type: HTTPType.PUT,
|
||||
action:
|
||||
'/client/r0/rooms/${widget.room.id}/state/m.room.canonical_alias',
|
||||
data: {'alias': '#$s:$domain'}),
|
||||
widget.room.client.api
|
||||
.sendState(widget.room.id, 'm.room.canonical_alias', {
|
||||
'alias': '#$s:$domain',
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:famedlysdk/matrix_api.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
import 'package:fluffychat/components/list_items/presence_list_item.dart';
|
||||
import 'package:fluffychat/components/list_items/public_room_list_item.dart';
|
||||
|
|
@ -93,7 +94,7 @@ class _ChatListState extends State<ChatList> {
|
|||
setState(() => loadingPublicRooms = true);
|
||||
final newPublicRoomsResponse =
|
||||
await SimpleDialogs(context).tryRequestWithErrorToast(
|
||||
Matrix.of(context).client.requestPublicRooms(
|
||||
Matrix.of(context).client.api.searchPublicRooms(
|
||||
limit: 30,
|
||||
includeAllNetworks: true,
|
||||
genericSearchTerm: searchController.text,
|
||||
|
|
@ -107,13 +108,12 @@ class _ChatListState extends State<ChatList> {
|
|||
if (searchController.text.isNotEmpty &&
|
||||
searchController.text.isValidMatrixId &&
|
||||
searchController.text.sigil == '#') {
|
||||
publicRoomsResponse.publicRooms.add(
|
||||
PublicRoomEntry(
|
||||
aliases: [searchController.text],
|
||||
name: searchController.text,
|
||||
roomId: searchController.text,
|
||||
client: Matrix.of(context).client,
|
||||
),
|
||||
publicRoomsResponse.chunk.add(
|
||||
PublicRoom.fromJson({
|
||||
'aliases': [searchController.text],
|
||||
'name': searchController.text,
|
||||
'room_id': searchController.text,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -199,15 +199,9 @@ class _ChatListState extends State<ChatList> {
|
|||
);
|
||||
if (status?.isEmpty ?? true) return;
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
Matrix.of(context).client.jsonRequest(
|
||||
type: HTTPType.PUT,
|
||||
action:
|
||||
'/client/r0/presence/${Matrix.of(context).client.userID}/status',
|
||||
data: {
|
||||
'presence': 'online',
|
||||
'status_msg': status,
|
||||
},
|
||||
),
|
||||
Matrix.of(context).client.api.sendPresence(
|
||||
Matrix.of(context).client.userID, PresenceType.online,
|
||||
statusMsg: status),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -412,8 +406,7 @@ class _ChatListState extends State<ChatList> {
|
|||
);
|
||||
}
|
||||
final publicRoomsCount =
|
||||
(publicRoomsResponse?.publicRooms?.length ??
|
||||
0);
|
||||
(publicRoomsResponse?.chunk?.length ?? 0);
|
||||
final totalCount =
|
||||
rooms.length + publicRoomsCount;
|
||||
return ListView.separated(
|
||||
|
|
@ -469,7 +462,7 @@ class _ChatListState extends State<ChatList> {
|
|||
rooms[i].id,
|
||||
)
|
||||
: PublicRoomListItem(publicRoomsResponse
|
||||
.publicRooms[i - rooms.length]);
|
||||
.chunk[i - rooms.length]);
|
||||
});
|
||||
} else {
|
||||
return Center(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:famedlysdk/matrix_api.dart';
|
||||
import 'package:fluffychat/components/adaptive_page_layout.dart';
|
||||
import 'package:fluffychat/components/avatar.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
|
|
@ -23,7 +24,7 @@ class _InvitationSelectionState extends State<InvitationSelection> {
|
|||
TextEditingController controller = TextEditingController();
|
||||
String currentSearchTerm;
|
||||
bool loading = false;
|
||||
List<Map<String, dynamic>> foundProfiles = [];
|
||||
List<Profile> foundProfiles = [];
|
||||
Timer coolDown;
|
||||
|
||||
Future<List<User>> getContacts(BuildContext context) async {
|
||||
|
|
@ -84,32 +85,23 @@ class _InvitationSelectionState extends State<InvitationSelection> {
|
|||
setState(() => loading = true);
|
||||
final matrix = Matrix.of(context);
|
||||
final response = await SimpleDialogs(context).tryRequestWithErrorToast(
|
||||
matrix.client.jsonRequest(
|
||||
type: HTTPType.POST,
|
||||
action: '/client/r0/user_directory/search',
|
||||
data: {
|
||||
'search_term': text,
|
||||
'limit': 10,
|
||||
}),
|
||||
matrix.client.api.searchUser(text, limit: 10),
|
||||
);
|
||||
setState(() => loading = false);
|
||||
if (response == false ||
|
||||
!(response is Map) ||
|
||||
(response['results'] == null)) return;
|
||||
if (response == false || (response?.results == null)) return;
|
||||
setState(() {
|
||||
foundProfiles = List<Map<String, dynamic>>.from(response['results']);
|
||||
foundProfiles = List<Profile>.from(response.results);
|
||||
if ('@$text'.isValidMatrixId &&
|
||||
foundProfiles
|
||||
.indexWhere((profile) => '@$text' == profile['user_id']) ==
|
||||
foundProfiles.indexWhere((profile) => '@$text' == profile.userId) ==
|
||||
-1) {
|
||||
setState(() => foundProfiles = [
|
||||
{'user_id': '@$text'}
|
||||
Profile.fromJson({'user_id': '@$text'}),
|
||||
]);
|
||||
}
|
||||
foundProfiles.removeWhere((profile) =>
|
||||
widget.room
|
||||
.getParticipants()
|
||||
.indexWhere((u) => u.id == profile['user_id']) !=
|
||||
.indexWhere((u) => u.id == profile.userId) !=
|
||||
-1);
|
||||
});
|
||||
}
|
||||
|
|
@ -160,19 +152,15 @@ class _InvitationSelectionState extends State<InvitationSelection> {
|
|||
itemCount: foundProfiles.length,
|
||||
itemBuilder: (BuildContext context, int i) => ListTile(
|
||||
leading: Avatar(
|
||||
foundProfiles[i]['avatar_url'] == null
|
||||
? null
|
||||
: Uri.parse(foundProfiles[i]['avatar_url']),
|
||||
foundProfiles[i]['display_name'] ??
|
||||
foundProfiles[i]['user_id'],
|
||||
foundProfiles[i].avatarUrl,
|
||||
foundProfiles[i].displayname ?? foundProfiles[i].userId,
|
||||
),
|
||||
title: Text(
|
||||
foundProfiles[i]['display_name'] ??
|
||||
(foundProfiles[i]['user_id'] as String).localpart,
|
||||
foundProfiles[i].displayname ??
|
||||
foundProfiles[i].userId.localpart,
|
||||
),
|
||||
subtitle: Text(foundProfiles[i]['user_id']),
|
||||
onTap: () =>
|
||||
inviteAction(context, foundProfiles[i]['user_id']),
|
||||
subtitle: Text(foundProfiles[i].userId),
|
||||
onTap: () => inviteAction(context, foundProfiles[i].userId),
|
||||
),
|
||||
)
|
||||
: FutureBuilder<List<User>>(
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class _LoginState extends State<Login> {
|
|||
.getWellKnownInformationsByUserId(userId);
|
||||
final newDomain = wellKnownInformations.mHomeserver?.baseUrl;
|
||||
if ((newDomain?.isNotEmpty ?? false) &&
|
||||
newDomain != Matrix.of(context).client.homeserver) {
|
||||
newDomain != Matrix.of(context).client.api.homeserver.toString()) {
|
||||
await SimpleDialogs(context).tryRequestWithErrorToast(
|
||||
Matrix.of(context).client.checkServer(newDomain));
|
||||
setState(() => usernameError = null);
|
||||
|
|
@ -110,7 +110,9 @@ class _LoginState extends State<Login> {
|
|||
title: Text(
|
||||
L10n.of(context).logInTo(Matrix.of(context)
|
||||
.client
|
||||
.api
|
||||
.homeserver
|
||||
.toString()
|
||||
.replaceFirst('https://', '')),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:famedlysdk/matrix_api.dart' as api;
|
||||
import 'package:fluffychat/components/adaptive_page_layout.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
import 'package:fluffychat/components/matrix.dart';
|
||||
|
|
@ -32,20 +33,17 @@ class _NewGroupState extends State<_NewGroup> {
|
|||
|
||||
void submitAction(BuildContext context) async {
|
||||
final matrix = Matrix.of(context);
|
||||
var params = <String, dynamic>{};
|
||||
if (publicGroup) {
|
||||
params['preset'] = 'public_chat';
|
||||
params['visibility'] = 'public';
|
||||
if (controller.text.isNotEmpty) {
|
||||
params['room_alias_name'] = controller.text;
|
||||
}
|
||||
} else {
|
||||
params['preset'] = 'private_chat';
|
||||
}
|
||||
if (controller.text.isNotEmpty) params['name'] = controller.text;
|
||||
final String roomID =
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
matrix.client.createRoom(params: params),
|
||||
matrix.client.api.createRoom(
|
||||
preset: publicGroup
|
||||
? api.CreateRoomPreset.public_chat
|
||||
: api.CreateRoomPreset.private_chat,
|
||||
visibility: publicGroup ? api.Visibility.public : null,
|
||||
roomAliasName:
|
||||
publicGroup && controller.text.isNotEmpty ? controller.text : null,
|
||||
name: controller.text.isNotEmpty ? controller.text : null,
|
||||
),
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
if (roomID != null) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:famedlysdk/matrix_api.dart';
|
||||
import 'package:fluffychat/components/adaptive_page_layout.dart';
|
||||
import 'package:fluffychat/components/avatar.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
|
|
@ -34,14 +35,14 @@ class _NewPrivateChatState extends State<_NewPrivateChat> {
|
|||
final _formKey = GlobalKey<FormState>();
|
||||
bool loading = false;
|
||||
String currentSearchTerm;
|
||||
List<Map<String, dynamic>> foundProfiles = [];
|
||||
List<Profile> foundProfiles = [];
|
||||
Timer coolDown;
|
||||
Map<String, dynamic> get foundProfile => foundProfiles.firstWhere(
|
||||
(user) => user['user_id'] == '@$currentSearchTerm',
|
||||
orElse: () => null);
|
||||
Profile get foundProfile =>
|
||||
foundProfiles.firstWhere((user) => user.userId == '@$currentSearchTerm',
|
||||
orElse: () => null);
|
||||
bool get correctMxId =>
|
||||
foundProfiles
|
||||
.indexWhere((user) => user['user_id'] == '@$currentSearchTerm') !=
|
||||
.indexWhere((user) => user.userId == '@$currentSearchTerm') !=
|
||||
-1;
|
||||
|
||||
void submitAction(BuildContext context) async {
|
||||
|
|
@ -89,20 +90,12 @@ class _NewPrivateChatState extends State<_NewPrivateChat> {
|
|||
setState(() => loading = true);
|
||||
final matrix = Matrix.of(context);
|
||||
final response = await SimpleDialogs(context).tryRequestWithErrorToast(
|
||||
matrix.client.jsonRequest(
|
||||
type: HTTPType.POST,
|
||||
action: '/client/r0/user_directory/search',
|
||||
data: {
|
||||
'search_term': text,
|
||||
'limit': 10,
|
||||
}),
|
||||
matrix.client.api.searchUser(text, limit: 10),
|
||||
);
|
||||
setState(() => loading = false);
|
||||
if (response == false ||
|
||||
!(response is Map) ||
|
||||
(response['results']?.isEmpty ?? true)) return;
|
||||
if (response == false || (response?.results?.isEmpty ?? true)) return;
|
||||
setState(() {
|
||||
foundProfiles = List<Map<String, dynamic>>.from(response['results']);
|
||||
foundProfiles = List<Profile>.from(response.results);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +151,8 @@ class _NewPrivateChatState extends State<_NewPrivateChat> {
|
|||
? Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Avatar(
|
||||
foundProfile['avatar_url'] == null
|
||||
? null
|
||||
: Uri.parse(foundProfile['avatar_url']),
|
||||
foundProfile['display_name'] ??
|
||||
foundProfile['user_id'],
|
||||
foundProfile.avatarUrl,
|
||||
foundProfile.displayname ?? foundProfile.userId,
|
||||
size: 12,
|
||||
),
|
||||
)
|
||||
|
|
@ -184,24 +174,21 @@ class _NewPrivateChatState extends State<_NewPrivateChat> {
|
|||
onTap: () {
|
||||
setState(() {
|
||||
controller.text = currentSearchTerm =
|
||||
foundProfile['user_id'].substring(1);
|
||||
foundProfile.userId.substring(1);
|
||||
});
|
||||
},
|
||||
leading: Avatar(
|
||||
foundProfile['avatar_url'] == null
|
||||
? null
|
||||
: Uri.parse(foundProfile['avatar_url']),
|
||||
foundProfile['display_name'] ?? foundProfile['user_id'],
|
||||
foundProfile.avatarUrl,
|
||||
foundProfile.displayname ?? foundProfile.userId,
|
||||
//size: 24,
|
||||
),
|
||||
title: Text(
|
||||
foundProfile['display_name'] ??
|
||||
(foundProfile['user_id'] as String).localpart,
|
||||
foundProfile.displayname ?? foundProfile.userId.localpart,
|
||||
style: TextStyle(),
|
||||
maxLines: 1,
|
||||
),
|
||||
subtitle: Text(
|
||||
foundProfile['user_id'],
|
||||
foundProfile.userId,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
|
|
|
|||
|
|
@ -25,36 +25,32 @@ class DevicesSettings extends StatefulWidget {
|
|||
}
|
||||
|
||||
class DevicesSettingsState extends State<DevicesSettings> {
|
||||
List<UserDevice> devices;
|
||||
List<Device> devices;
|
||||
Future<bool> _loadUserDevices(BuildContext context) async {
|
||||
if (devices != null) return true;
|
||||
devices = await Matrix.of(context).client.requestUserDevices();
|
||||
devices = await Matrix.of(context).client.api.requestDevices();
|
||||
return true;
|
||||
}
|
||||
|
||||
void reload() => setState(() => devices = null);
|
||||
|
||||
void _removeDevicesAction(
|
||||
BuildContext context, List<UserDevice> devices) async {
|
||||
void _removeDevicesAction(BuildContext context, List<Device> devices) async {
|
||||
if (await SimpleDialogs(context).askConfirmation() == false) return;
|
||||
var matrix = Matrix.of(context);
|
||||
var deviceIds = <String>[];
|
||||
for (var userDevice in devices) {
|
||||
deviceIds.add(userDevice.deviceId);
|
||||
}
|
||||
final success = await SimpleDialogs(context)
|
||||
.tryRequestWithLoadingDialog(matrix.client.deleteDevices(deviceIds),
|
||||
onAdditionalAuth: (MatrixException exception) async {
|
||||
final password = await SimpleDialogs(context).enterText(
|
||||
titleText: L10n.of(context).pleaseEnterYourPassword,
|
||||
labelText: L10n.of(context).pleaseEnterYourPassword,
|
||||
hintText: '******',
|
||||
password: true);
|
||||
if (password == null) return;
|
||||
await matrix.client.deleteDevices(deviceIds,
|
||||
auth: matrix.getAuthByPassword(password, exception.session));
|
||||
return;
|
||||
});
|
||||
final password = await SimpleDialogs(context).enterText(
|
||||
titleText: L10n.of(context).pleaseEnterYourPassword,
|
||||
labelText: L10n.of(context).pleaseEnterYourPassword,
|
||||
hintText: '******',
|
||||
password: true);
|
||||
if (password == null) return;
|
||||
|
||||
final success = await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
matrix.client.api.deleteDevices(deviceIds,
|
||||
auth: matrix.getAuthByPassword(password)));
|
||||
if (success != false) {
|
||||
reload();
|
||||
}
|
||||
|
|
@ -81,9 +77,9 @@ class DevicesSettingsState extends State<DevicesSettings> {
|
|||
if (!snapshot.hasData || this.devices == null) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
}
|
||||
Function isOwnDevice = (UserDevice userDevice) =>
|
||||
Function isOwnDevice = (Device userDevice) =>
|
||||
userDevice.deviceId == Matrix.of(context).client.deviceID;
|
||||
final devices = List<UserDevice>.from(this.devices);
|
||||
final devices = List<Device>.from(this.devices);
|
||||
var thisDevice = devices.firstWhere(isOwnDevice, orElse: () => null);
|
||||
devices.removeWhere(isOwnDevice);
|
||||
devices.sort((a, b) => b.lastSeenTs.compareTo(a.lastSeenTs));
|
||||
|
|
@ -134,7 +130,7 @@ class DevicesSettingsState extends State<DevicesSettings> {
|
|||
}
|
||||
|
||||
class UserDeviceListItem extends StatelessWidget {
|
||||
final UserDevice userDevice;
|
||||
final Device userDevice;
|
||||
final Function remove;
|
||||
|
||||
const UserDeviceListItem(this.userDevice, {this.remove, Key key})
|
||||
|
|
|
|||
|
|
@ -70,21 +70,16 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||
content['short'][emote.emote] = emote.mxc;
|
||||
}
|
||||
debugPrint(content.toString());
|
||||
var path = '';
|
||||
if (widget.room != null) {
|
||||
path = '/client/r0/rooms/${widget.room.id}/state/im.ponies.room_emotes/';
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
client.api.sendState(widget.room.id, 'im.ponies.room_emotes', content),
|
||||
);
|
||||
} else {
|
||||
path =
|
||||
'/client/r0/user/${client.userID}/account_data/im.ponies.user_emotes';
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
client.api
|
||||
.setAccountData(client.userID, 'im.ponies.user_emotes', content),
|
||||
);
|
||||
}
|
||||
debugPrint(path);
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
client.jsonRequest(
|
||||
type: HTTPType.PUT,
|
||||
action: path,
|
||||
data: content,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
bool get readonly => widget.room == null
|
||||
|
|
@ -378,11 +373,14 @@ class _EmoteImagePickerState extends State<_EmoteImagePicker> {
|
|||
maxWidth: 128,
|
||||
maxHeight: 128);
|
||||
if (file == null) return;
|
||||
final matrixFile =
|
||||
MatrixFile(bytes: await file.readAsBytes(), path: file.path);
|
||||
final uploadResp =
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
Matrix.of(context).client.upload(
|
||||
MatrixFile(bytes: await file.readAsBytes(), path: file.path),
|
||||
),
|
||||
Matrix.of(context)
|
||||
.client
|
||||
.api
|
||||
.upload(matrixFile.bytes, matrixFile.path),
|
||||
);
|
||||
setState(() {
|
||||
widget.controller.text = uploadResp;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class _SignUpState extends State<SignUp> {
|
|||
usernameController.text.toLowerCase().replaceAll(' ', '-');
|
||||
|
||||
try {
|
||||
await matrix.client.usernameAvailable(preferredUsername);
|
||||
await matrix.client.api.usernameAvailable(preferredUsername);
|
||||
} on MatrixException catch (exception) {
|
||||
setState(() => usernameError = exception.errorMessage);
|
||||
return setState(() => loading = false);
|
||||
|
|
@ -73,7 +73,12 @@ class _SignUpState extends State<SignUp> {
|
|||
elevation: 0,
|
||||
leading: loading ? Container() : null,
|
||||
title: Text(
|
||||
Matrix.of(context).client.homeserver.replaceFirst('https://', ''),
|
||||
Matrix.of(context)
|
||||
.client
|
||||
.api
|
||||
.homeserver
|
||||
.toString()
|
||||
.replaceFirst('https://', ''),
|
||||
),
|
||||
),
|
||||
body: ListView(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue