OpenMediacenterMobileFlutter/lib/app.dart
lukas-heiligenbrunner 6f6fbb3897 add page for tv shows
only showing up if enabled in backend
2022-10-15 23:15:21 +02:00

43 lines
1.1 KiB
Dart

import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:openmediacentermobile/log/log.dart';
import 'package:openmediacentermobile/login/login_screen.dart';
import 'package:openmediacentermobile/utils/feature_context.dart';
import 'drawer/drawer_page.dart';
import 'login/login_context.dart';
class AppScrollBehavior extends MaterialScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices => {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.trackpad
};
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final loginCtx = LoginContext.of(context);
Log.d("We are logged in: ${loginCtx.loggedIn}");
if (!loginCtx.loggedIn) {
return const MaterialApp(home: LoginScreen());
} else {
return FeatureContainer(
child: MaterialApp(
scrollBehavior: AppScrollBehavior(),
home: DrawerPage(
title: 'OpenMediaCenter',
),
),
);
}
}
}