mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-04-21 01:17:55 +02:00
feat: Handle activeClients in matrix
This commit is contained in:
parent
3590b3a58a
commit
d1236c510d
@ -57,12 +57,24 @@ class Matrix extends StatefulWidget {
|
||||
}
|
||||
|
||||
class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
Client get client => widget.clients.first;
|
||||
int _activeClient = 0;
|
||||
Store store = Store();
|
||||
BuildContext navigatorContext;
|
||||
|
||||
BackgroundPush _backgroundPush;
|
||||
|
||||
Client get client => widget.clients[_safeActiveClient];
|
||||
|
||||
set activeClient(int newActiveClient) =>
|
||||
setState(() => _activeClient = newActiveClient);
|
||||
|
||||
int get _safeActiveClient {
|
||||
if (_activeClient < 0 || _activeClient >= widget.clients.length) {
|
||||
return 0;
|
||||
}
|
||||
return _activeClient;
|
||||
}
|
||||
|
||||
Map<String, dynamic> get shareContent => _shareContent;
|
||||
set shareContent(Map<String, dynamic> content) {
|
||||
_shareContent = content;
|
||||
|
Loading…
x
Reference in New Issue
Block a user