38 lines
931 B
Dart
38 lines
931 B
Dart
import 'dart:ui';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:openmediacentermobile/log/log.dart';
|
|
import 'package:openmediacentermobile/login/login_screen.dart';
|
|
|
|
import 'drawer/drawer_page.dart';
|
|
import 'login/logincontext.dart';
|
|
|
|
class AppScrollBehavior extends MaterialScrollBehavior {
|
|
@override
|
|
Set<PointerDeviceKind> get dragDevices => {
|
|
PointerDeviceKind.touch,
|
|
PointerDeviceKind.mouse,
|
|
};
|
|
}
|
|
|
|
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 MaterialApp(
|
|
scrollBehavior: AppScrollBehavior(),
|
|
home: DrawerPage(
|
|
title: 'OpenMediaCenter',
|
|
));
|
|
}
|
|
}
|
|
}
|