Better notifications
This commit is contained in:
parent
2c6a37d37a
commit
c4353bbea6
14 changed files with 296 additions and 25 deletions
|
|
@ -4,7 +4,9 @@ import 'package:famedlysdk/famedlysdk.dart';
|
|||
import 'package:fluffychat/components/adaptive_page_layout.dart';
|
||||
import 'package:fluffychat/components/content_banner.dart';
|
||||
import 'package:fluffychat/components/matrix.dart';
|
||||
import 'package:fluffychat/utils/app_route.dart';
|
||||
import 'package:fluffychat/views/chat_list.dart';
|
||||
import 'package:fluffychat/views/login.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
|
@ -31,10 +33,11 @@ class _SettingsState extends State<Settings> {
|
|||
Future<dynamic> profileFuture;
|
||||
dynamic profile;
|
||||
void logoutAction(BuildContext context) async {
|
||||
await Navigator.of(context).popUntil((r) => r.isFirst);
|
||||
MatrixState matrix = Matrix.of(context);
|
||||
await matrix.tryRequestWithErrorToast(matrix.client.logout());
|
||||
await matrix.tryRequestWithLoadingDialog(matrix.client.logout());
|
||||
matrix.clean();
|
||||
await Navigator.of(context).pushAndRemoveUntil(
|
||||
AppRoute.defaultRoute(context, LoginPage()), (r) => false);
|
||||
}
|
||||
|
||||
void setDisplaynameAction(BuildContext context, String displayname) async {
|
||||
|
|
@ -94,7 +97,9 @@ class _SettingsState extends State<Settings> {
|
|||
Widget build(BuildContext context) {
|
||||
final Client client = Matrix.of(context).client;
|
||||
profileFuture ??= client.getProfileFromUserId(client.userID);
|
||||
profileFuture.then((p) => setState(() => profile = p));
|
||||
profileFuture.then((p) {
|
||||
if (mounted) setState(() => profile = p);
|
||||
});
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Settings"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue