Merge branch 'develop' into feature-highEduGraduationCalculator

# Conflicts:
#	lib/view/pages/overhang.dart
This commit is contained in:
Elias Müller 2024-03-24 14:21:01 +01:00
commit 6237a2e9cf
11 changed files with 113 additions and 95 deletions

View File

@ -1,7 +1,6 @@
import 'package:nextcloud/nextcloud.dart';
import '../../../../../model/endpointData.dart';
import '../../webdavApi.dart';
import 'cacheableFile.dart';
import 'listFilesParams.dart';
@ -18,12 +17,13 @@ class ListFiles extends WebdavApi<ListFilesParams> {
Set<CacheableFile> files = davFiles.map((e) => CacheableFile.fromDavFile(e)).toSet();
// webdav handles subdirectories wrong, this is a fix
if(EndpointData().getEndpointMode() == EndpointMode.stage) {
files = files.map((e) { // somehow
e.path = e.path.split("mobile/cloud/remote.php/webdav")[1];
return e;
}).toSet();
}
// currently this fix is not needed anymore
// if(EndpointData().getEndpointMode() == EndpointMode.stage) {
// files = files.map((e) { // somehow
// e.path = e.path.split("mobile/cloud/remote.php/webdav")[1];
// return e;
// }).toSet();
// }
// somehow the current working folder is also listed, it is filtered here.
files.removeWhere((element) => element.path == "/${params.path}/" || element.path == "/");

View File

@ -5,7 +5,7 @@ import 'dart:developer';
import 'package:easy_debounce/easy_throttle.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
import 'package:provider/provider.dart';
import 'package:badges/badges.dart' as badges;
@ -93,67 +93,75 @@ class _AppState extends State<App> with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
return PersistentTabView(
context,
controller: App.bottomNavigator,
navBarStyle: NavBarStyle.style6,
hideNavigationBarWhenKeyboardShows: true,
navBarHeight: MediaQuery.of(context).viewInsets.bottom > 0 ? 0.0 : kBottomNavigationBarHeight,
backgroundColor: Theme.of(context).colorScheme.surface,
decoration: const NavBarDecoration(
border: Border(top: BorderSide(width: 1, color: Colors.grey)),
),
screenTransitionAnimation: const ScreenTransitionAnimation(animateTabTransition: true, curve: Curves.ease, duration: Duration(milliseconds: 200)),
screens: const [
Breaker(breaker: BreakerArea.timetable, child: Timetable()),
Breaker(breaker: BreakerArea.talk, child: ChatList()),
Breaker(breaker: BreakerArea.files, child: Files([])),
Breaker(breaker: BreakerArea.more, child: Overhang()),
],
items: [
PersistentBottomNavBarItem(
activeColorPrimary: Theme.of(context).primaryColor,
inactiveColorPrimary: Theme.of(context).colorScheme.secondary,
icon: const Icon(Icons.calendar_month),
title: "Vertretung"
),
PersistentBottomNavBarItem(
activeColorPrimary: Theme.of(context).primaryColor,
inactiveColorPrimary: Theme.of(context).colorScheme.secondary,
icon: Consumer<ChatListProps>(
builder: (context, value, child) {
if(value.primaryLoading()) return const Icon(Icons.chat);
int messages = value.getRoomsResponse.data.map((e) => e.unreadMessages).reduce((a, b) => a+b);
return badges.Badge(
showBadge: messages > 0,
position: badges.BadgePosition.topEnd(top: -3, end: -3),
stackFit: StackFit.loose,
badgeStyle: badges.BadgeStyle(
padding: const EdgeInsets.all(3),
badgeColor: Theme.of(context).primaryColor,
elevation: 1,
),
badgeContent: Text("$messages", style: const TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.bold)),
child: const Icon(Icons.chat),
);
},
),
title: "Talk",
),
PersistentBottomNavBarItem(
activeColorPrimary: Theme.of(context).primaryColor,
inactiveColorPrimary: Theme.of(context).colorScheme.secondary,
icon: const Icon(Icons.folder),
title: "Dateien"
),
PersistentBottomNavBarItem(
activeColorPrimary: Theme.of(context).primaryColor,
inactiveColorPrimary: Theme.of(context).colorScheme.secondary,
icon: const Icon(Icons.apps),
title: "Mehr"
),
],
);
gestureNavigationEnabled: true,
navBarOverlap: const NavBarOverlap.none(),
backgroundColor: Theme.of(context).colorScheme.primary,
screenTransitionAnimation: const ScreenTransitionAnimation(curve: Curves.easeOutQuad, duration: Duration(milliseconds: 200)),
tabs: [
PersistentTabConfig(
screen: const Breaker(breaker: BreakerArea.timetable, child: Timetable()),
item: ItemConfig(
activeForegroundColor: Theme.of(context).primaryColor,
inactiveForegroundColor: Theme.of(context).colorScheme.secondary,
icon: const Icon(Icons.calendar_month),
title: "Vertretung"
),
),
PersistentTabConfig(
screen: const Breaker(breaker: BreakerArea.talk, child: ChatList()),
item: ItemConfig(
activeForegroundColor: Theme.of(context).primaryColor,
inactiveForegroundColor: Theme.of(context).colorScheme.secondary,
icon: Consumer<ChatListProps>(
builder: (context, value, child) {
if(value.primaryLoading()) return const Icon(Icons.chat);
int messages = value.getRoomsResponse.data.map((e) => e.unreadMessages).reduce((a, b) => a+b);
return badges.Badge(
showBadge: messages > 0,
position: badges.BadgePosition.topEnd(top: -3, end: -3),
stackFit: StackFit.loose,
badgeStyle: badges.BadgeStyle(
padding: const EdgeInsets.all(3),
badgeColor: Theme.of(context).primaryColor,
elevation: 1,
),
badgeContent: Text("$messages", style: const TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.bold)),
child: const Icon(Icons.chat),
);
},
),
title: "Talk",
),
),
PersistentTabConfig(
screen: const Breaker(breaker: BreakerArea.files, child: Files([])),
item: ItemConfig(
activeForegroundColor: Theme.of(context).primaryColor,
inactiveForegroundColor: Theme.of(context).colorScheme.secondary,
icon: const Icon(Icons.folder),
title: "Dateien"
),
),
PersistentTabConfig(
screen: const Breaker(breaker: BreakerArea.more, child: Overhang()),
item: ItemConfig(
activeForegroundColor: Theme.of(context).primaryColor,
inactiveForegroundColor: Theme.of(context).colorScheme.secondary,
icon: const Icon(Icons.apps),
title: "Mehr"
),
),
],
navBarBuilder: (config) => Style6BottomNavBar(
navBarConfig: config,
navBarDecoration: NavBarDecoration(
border: const Border(top: BorderSide(width: 1, color: Colors.grey)),
color: Theme.of(context).colorScheme.surface,
),
),
);
}
@override

View File

@ -6,11 +6,13 @@ import 'package:flowder/flowder.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:jiffy/jiffy.dart';
import 'package:marianum_mobile/widget/infoDialog.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:path_provider/path_provider.dart';
import '../../../api/marianumcloud/webdav/queries/listFiles/cacheableFile.dart';
import '../../../api/marianumcloud/webdav/webdavApi.dart';
import '../../../model/endpointData.dart';
import '../../../widget/centeredLeading.dart';
import '../../../widget/confirmDialog.dart';
import '../../../widget/fileViewer.dart';
@ -103,6 +105,10 @@ class _FileElementState extends State<FileElement> {
},
));
} else {
if(EndpointData().getEndpointMode() == EndpointMode.stage) {
InfoDialog.show(context, "Virtuelle Dateien im Staging Prozess können nicht heruntergeladen werden!");
return;
}
if(widget.file.currentlyDownloading) {
showDialog(
context: context,

View File

@ -238,6 +238,7 @@ class _FilesState extends State<Files> {
return Future.delayed(const Duration(seconds: 3));
},
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: files.length,
itemBuilder: (context, index) {
CacheableFile file = files.toList()[index];

View File

@ -28,7 +28,7 @@ class Overhang extends StatelessWidget {
appBar: AppBar(
title: const Text("Mehr"),
actions: [
IconButton(onPressed: () => pushNewScreen(context, screen: const Settings(), withNavBar: false), icon: const Icon(Icons.settings))
IconButton(onPressed: () => pushScreen(context, screen: const Settings(), withNavBar: false), icon: const Icon(Icons.settings))
],
),
body: ListView(
@ -57,20 +57,17 @@ class Overhang extends StatelessWidget {
return null;
}
return Visibility(
visible: snapshot.requireData,
child: ListTile(
leading: const CenteredLeading(Icon(Icons.star_rate_outlined)),
title: const Text("App Bewerten"),
subtitle: getPlatformStoreName().wrapNullable((data) => Text("Im $data")),
trailing: const Icon(Icons.arrow_right),
onTap: () {
InAppReview.instance.openStoreListing(appStoreId: "6458789560").then(
(value) => InfoDialog.show(context, "Vielen Dank!"),
return ListTile(
leading: const CenteredLeading(Icon(Icons.star_rate_outlined)),
title: const Text("App Bewerten"),
subtitle: getPlatformStoreName().wrapNullable((data) => Text("Im $data")),
trailing: const Icon(Icons.arrow_right),
onTap: () {
InAppReview.instance.openStoreListing(appStoreId: "6458789560").then(
(value) => InfoDialog.show(context, "Vielen Dank!"),
onError: (error) => InfoDialog.show(context, error.toString())
);
},
),
);
},
);
},
),

View File

@ -136,7 +136,10 @@ class _ChatListState extends State<ChatList> {
_query(renew: true);
return Future.delayed(const Duration(seconds: 3));
},
child: ListView(children: chats),
child: ListView(
padding: EdgeInsets.zero,
children: chats
),
);
},
),

View File

@ -129,7 +129,10 @@ class _ChatViewState extends State<ChatView> {
),
Container(
color: Theme.of(context).colorScheme.background,
child: SafeArea(child: ChatTextfield(widget.room.token)),
child: TalkNavigator.isSecondaryVisible(context)
? ChatTextfield(widget.room.token)
: SafeArea(child: ChatTextfield(widget.room.token)
),
)
],
),

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_split_view/flutter_split_view.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
class TalkNavigator {
static bool hasSplitViewState(BuildContext context) => context.findAncestorStateOfType<SplitViewState>() != null;
@ -12,7 +12,7 @@ class TalkNavigator {
SplitViewState splitView = SplitView.of(context);
overrideToSingleSubScreen ? splitView.setSecondary(view) : splitView.push(view);
} else {
pushNewScreen(context, screen: view, withNavBar: false);
pushScreen(context, screen: view, withNavBar: false);
}
}
}

View File

@ -5,7 +5,7 @@ import 'package:bottom_sheet/bottom_sheet.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:jiffy/jiffy.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
import 'package:provider/provider.dart';
import 'package:rrule/rrule.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
@ -103,7 +103,7 @@ class AppointmentDetails {
trailing: IconButton(
icon: const Icon(Icons.house_outlined),
onPressed: () {
pushNewScreen(context, withNavBar: false, screen: const Roomplan());
pushScreen(context, withNavBar: false, screen: const Roomplan());
},
),
),

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
class ListItemNavigator extends StatelessWidget {
const ListItemNavigator({super.key, required this.icon, required this.text, required this.target, this.onLongPress, this.arrow = true});
@ -15,7 +15,7 @@ class ListItemNavigator extends StatelessWidget {
@override
Widget build(BuildContext context) {
onTabAction() => pushNewScreen(context, withNavBar: false, screen: target); //Navigator.push(context, MaterialPageRoute(builder: (context) => target));
onTabAction() => pushScreen(context, withNavBar: false, screen: target); //Navigator.push(context, MaterialPageRoute(builder: (context) => target));
onLongPressAction() => onLongPress;
return ListTile(

View File

@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.0.7+31
version: 0.0.7+33
environment:
sdk: '>3.0.0'
@ -68,10 +68,10 @@ dependencies:
flowder:
git:
url: https://github.com/Harsh223/flowder.git
persistent_bottom_nav_bar_v2: ^4.2.8
persistent_bottom_nav_bar_v2: ^5.0.0
badges: ^3.0.2
image_picker: ^1.0.0
file_picker: ^6.1.1
file_picker: ^8.0.0+1
loader_overlay: ^4.0.0
crypto: ^3.0.3
package_info: ^2.0.2
@ -84,16 +84,16 @@ dependencies:
firebase_messaging: ^14.6.5
firebase_core: ^2.15.0
firebase_in_app_messaging: ^0.7.3+4
flutter_local_notifications: ^16.3.0
flutter_local_notifications: ^17.0.0
fast_rsa: ^3.6.1
share_plus: ^7.1.0
share_plus: ^8.0.2
flutter_split_view: ^0.1.2
bottom_sheet: ^4.0.0
device_info_plus: ^9.0.3
flutter_app_badger: ^1.5.0
qr_flutter: ^4.1.0
easy_debounce: ^2.0.3
rrule_generator: ^0.5.6
rrule_generator: ^0.7.0+1
rrule: ^0.2.16
time_range_picker: ^2.2.0
in_app_review: ^2.0.8