mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
a9819577d6
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
30 lines
924 B
Dart
30 lines
924 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:matrix/matrix.dart';
|
|
import 'package:vrouter/vrouter.dart';
|
|
|
|
import 'package:fluffychat/utils/update_checker_no_store.dart';
|
|
import 'package:fluffychat/widgets/layouts/empty_page.dart';
|
|
import 'package:fluffychat/widgets/matrix.dart';
|
|
|
|
class LoadingView extends StatelessWidget {
|
|
const LoadingView({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
WidgetsBinding.instance.addPostFrameCallback(
|
|
(_) async {
|
|
await UpdateCheckerNoStore(context).checkUpdate();
|
|
VRouter.of(context).to(
|
|
Matrix.of(context).widget.clients.any((client) =>
|
|
client.onLoginStateChanged.value == LoginState.loggedIn)
|
|
? '/rooms'
|
|
: '/home',
|
|
queryParameters: VRouter.of(context).queryParameters,
|
|
);
|
|
},
|
|
);
|
|
return const EmptyPage(loading: true);
|
|
}
|
|
}
|