OpenMediacenterMobileFlutter/lib/app.dart

41 lines
1.0 KiB
Dart
Raw Normal View History

import 'dart:ui';
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 'drawer/drawer_page.dart';
2022-09-02 16:42:38 +00:00
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);
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 MaterialApp(
2022-11-01 23:36:21 +00:00
theme: ThemeData(
appBarTheme: AppBarTheme(backgroundColor: Color(0xff0d0d0d))),
scrollBehavior: AppScrollBehavior(),
home: DrawerPage(
title: 'OpenMediaCenter',
));
2021-12-10 10:40:20 +00:00
}
}
}