feat: Pass clients through until matrix.dart

This commit is contained in:
Christian Pauly 2021-09-18 11:26:57 +02:00
parent fdb5345412
commit 3590b3a58a
2 changed files with 8 additions and 9 deletions

View File

@ -50,25 +50,24 @@ void main() async {
() => runApp(PlatformInfos.isMobile () => runApp(PlatformInfos.isMobile
? AppLock( ? AppLock(
builder: (args) => FluffyChatApp( builder: (args) => FluffyChatApp(
client: clients.first, clients: clients,
queryParameters: queryParameters, queryParameters: queryParameters,
), ),
lockScreen: LockScreen(), lockScreen: LockScreen(),
enabled: false, enabled: false,
) )
: FluffyChatApp( : FluffyChatApp(clients: clients, queryParameters: queryParameters)),
client: clients.first, queryParameters: queryParameters)),
SentryController.captureException, SentryController.captureException,
); );
} }
class FluffyChatApp extends StatefulWidget { class FluffyChatApp extends StatefulWidget {
final Widget testWidget; final Widget testWidget;
final Client client; final List<Client> clients;
final Map<String, String> queryParameters; final Map<String, String> queryParameters;
const FluffyChatApp( const FluffyChatApp(
{Key key, this.testWidget, @required this.client, this.queryParameters}) {Key key, this.testWidget, @required this.clients, this.queryParameters})
: super(key: key); : super(key: key);
/// getInitialLink may rereturn the value multiple times if this view is /// getInitialLink may rereturn the value multiple times if this view is
@ -142,7 +141,7 @@ class _FluffyChatAppState extends State<FluffyChatApp> {
key: _matrix, key: _matrix,
context: context, context: context,
router: _router, router: _router,
client: widget.client, clients: widget.clients,
child: WaitForInitPage(child), child: WaitForInitPage(child),
); );
}, },

View File

@ -35,7 +35,7 @@ class Matrix extends StatefulWidget {
final BuildContext context; final BuildContext context;
final Client client; final List<Client> clients;
final Map<String, String> queryParameters; final Map<String, String> queryParameters;
@ -43,7 +43,7 @@ class Matrix extends StatefulWidget {
this.child, this.child,
@required this.router, @required this.router,
@required this.context, @required this.context,
@required this.client, @required this.clients,
this.queryParameters, this.queryParameters,
Key key, Key key,
}) : super(key: key); }) : super(key: key);
@ -57,7 +57,7 @@ class Matrix extends StatefulWidget {
} }
class MatrixState extends State<Matrix> with WidgetsBindingObserver { class MatrixState extends State<Matrix> with WidgetsBindingObserver {
Client get client => widget.client; Client get client => widget.clients.first;
Store store = Store(); Store store = Store();
BuildContext navigatorContext; BuildContext navigatorContext;