OpenMediacenterMobileFlutter/lib/app.dart

27 lines
670 B
Dart
Raw Normal View History

2021-12-10 10:40:20 +00:00
import 'package:flutter/material.dart';
import 'package:openmediacentermobile/log/log.dart';
import 'package:openmediacentermobile/login/login_screen.dart';
2021-12-10 10:40:20 +00:00
import 'DrawerPage.dart';
import 'login/logincontext.dart';
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
2021-12-10 10:40:20 +00:00
@override
Widget build(BuildContext context) {
var loginCtx = LoginContext.of(context);
Log.d("We are logged in: ${loginCtx.loggedIn}");
if (!loginCtx.loggedIn) {
return const MaterialApp(home: LoginScreen());
2021-12-10 10:40:20 +00:00
} else {
return const MaterialApp(
home: DrawerPage(
title: 'OpenMediaCenter',
));
2021-12-10 10:40:20 +00:00
}
}
}