Added Nextcloud base
This commit is contained in:
@ -2,7 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:marianum_mobile/data/timetable/timetable.dart';
|
||||
import 'package:marianum_mobile/data/timetable/timetableProps.dart';
|
||||
import 'package:marianum_mobile/screen/login/login.dart';
|
||||
import 'package:marianum_mobile/widget/loadingSpinner.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@ -10,6 +10,8 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:web_socket_channel/web_socket_channel.dart';
|
||||
|
||||
import 'app.dart';
|
||||
import 'data/chatList/chatListProps.dart';
|
||||
import 'data/chatList/chatProps.dart';
|
||||
import 'dataOld/accountModel.dart';
|
||||
import 'dataOld/incommingPackets/authenticatePacket.dart';
|
||||
import 'dataOld/incommingPackets/errorPacket.dart';
|
||||
@ -39,7 +41,9 @@ Future<void> main() async {
|
||||
// ChangeNotifierProvider(create: (context) => FileListPacket()),
|
||||
// ChangeNotifierProvider(create: (context) => TalkChatPacket()),
|
||||
// ChangeNotifierProvider(create: (context) => TimetablePacket()),
|
||||
ChangeNotifierProvider(create: (context) => Timetable()),
|
||||
ChangeNotifierProvider(create: (context) => TimetableProps()),
|
||||
ChangeNotifierProvider(create: (context) => ChatListProps()),
|
||||
ChangeNotifierProvider(create: (context) => ChatProps()),
|
||||
],
|
||||
child: const Main(),
|
||||
)
|
||||
@ -54,7 +58,7 @@ class Main extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MainState extends State<Main> {
|
||||
static const Color red = Color.fromARGB(255, 153, 51, 51);
|
||||
static const Color marianumRed = Color.fromARGB(255, 153, 51, 51);
|
||||
|
||||
final Future<SharedPreferences> _storage = SharedPreferences.getInstance();
|
||||
|
||||
@ -79,12 +83,16 @@ class _MainState extends State<Main> {
|
||||
title: 'Marianum Fulda',
|
||||
theme: ThemeData(
|
||||
brightness: Brightness.light,
|
||||
primaryColor: red,
|
||||
primaryColor: marianumRed,
|
||||
hintColor: marianumRed,
|
||||
inputDecorationTheme: const InputDecorationTheme(
|
||||
border: UnderlineInputBorder(borderSide: BorderSide(color: marianumRed)),
|
||||
),
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: red,
|
||||
backgroundColor: marianumRed,
|
||||
),
|
||||
progressIndicatorTheme: const ProgressIndicatorThemeData(
|
||||
color: red,
|
||||
color: marianumRed,
|
||||
),
|
||||
),
|
||||
|
||||
@ -93,30 +101,16 @@ class _MainState extends State<Main> {
|
||||
builder: (BuildContext context, AsyncSnapshot<SharedPreferences> snapshot) {
|
||||
|
||||
if(snapshot.hasData) {
|
||||
|
||||
return Consumer2<AccountModel, ErrorPacket>(
|
||||
builder: (context, accountModel, errorPacket, child) {
|
||||
if(errorPacket.errorDismissed) {
|
||||
return accountModel.isLoggedIn ? const App() : const Login();
|
||||
} else {
|
||||
return AlertDialog(title: const Text("Serverseitige Fehlermeldung"), content: Text(errorPacket.errorText), actions: [
|
||||
TextButton(onPressed: () {
|
||||
Provider.of<ErrorPacket>(context, listen: false).errorDismissed = true;
|
||||
}, child: const Text("Weiter"))
|
||||
]);
|
||||
}
|
||||
return Consumer<AccountModel>(
|
||||
builder: (context, accountModel, child) {
|
||||
return accountModel.isLoggedIn ? const App() : const Login();
|
||||
},
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
return const LoadingSpinner();
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
)
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user