OpenMediacenterMobileFlutter/lib/app.dart
2022-04-15 21:57:15 +02:00

35 lines
882 B
Dart

import 'package:flutter/material.dart';
import 'package:openmediacentermobile/log/log.dart';
import 'package:openmediacentermobile/login/login_screen.dart';
import 'DrawerPage.dart';
import 'api/token.dart';
import 'login/logincontext.dart';
import 'video_feed.dart';
// class App extends StatefulWidget {
// const App({Key? key}) : super(key: key);
// @override
// State<StatefulWidget> createState() => AppState();
// }
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@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());
} else {
return const MaterialApp(
home: DrawerPage(
title: 'OpenMediaCenter',
));
}
}
}