Compare commits
3 Commits
develop-bl
...
5bc4ba6332
Author | SHA1 | Date | |
---|---|---|---|
5bc4ba6332 | |||
e9739ac2d5 | |||
4d3a33dd9b |
@ -25,7 +25,7 @@ if (flutterVersionName == null) {
|
|||||||
android {
|
android {
|
||||||
namespace "eu.mhsl.marianum.mobile.client"
|
namespace "eu.mhsl.marianum.mobile.client"
|
||||||
compileSdk flutter.compileSdkVersion
|
compileSdk flutter.compileSdkVersion
|
||||||
ndkVersion flutter.ndkVersion
|
ndkVersion "27.0.12077973"
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
@ -41,11 +41,8 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
||||||
applicationId "eu.mhsl.marianum.mobile.client"
|
applicationId "eu.mhsl.marianum.mobile.client"
|
||||||
// You can update the following values to match your application needs.
|
minSdkVersion 26
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
|
||||||
minSdkVersion 21
|
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
@ -66,5 +63,6 @@ flutter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.android.support:multidex:1.0.3'
|
implementation 'com.android.support:multidex:2.0.1'
|
||||||
|
implementation 'com.android.tools:desugar_jdk_libs:2.0.3'
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
org.gradle.jvmargs=-Xmx4G
|
org.gradle.jvmargs=-Xmx4G
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
android.defaults.buildfeatures.buildconfig=true
|
||||||
|
android.nonTransitiveRClass=false
|
||||||
|
android.nonFinalResIds=false
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -19,7 +19,7 @@ pluginManagement {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||||
id "com.android.application" version "7.3.0" apply false
|
id "com.android.application" version '8.1.4' apply false
|
||||||
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
|
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson(
|
|||||||
GetHolidaysResponseObject(
|
GetHolidaysResponseObject(
|
||||||
start: json['start'] as String,
|
start: json['start'] as String,
|
||||||
end: json['end'] as String,
|
end: json['end'] as String,
|
||||||
year: (json['year'] as num).toInt(),
|
year: json['year'] as int,
|
||||||
stateCode: json['stateCode'] as String,
|
stateCode: json['stateCode'] as String,
|
||||||
name: json['name'] as String,
|
name: json['name'] as String,
|
||||||
slug: json['slug'] as String,
|
slug: json['slug'] as String,
|
||||||
|
@ -9,7 +9,7 @@ part of 'fileSharingApiParams.dart';
|
|||||||
FileSharingApiParams _$FileSharingApiParamsFromJson(
|
FileSharingApiParams _$FileSharingApiParamsFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
FileSharingApiParams(
|
FileSharingApiParams(
|
||||||
shareType: (json['shareType'] as num).toInt(),
|
shareType: json['shareType'] as int,
|
||||||
shareWith: json['shareWith'] as String,
|
shareWith: json['shareWith'] as String,
|
||||||
path: json['path'] as String,
|
path: json['path'] as String,
|
||||||
referenceId: json['referenceId'] as String?,
|
referenceId: json['referenceId'] as String?,
|
||||||
|
@ -10,10 +10,10 @@ GetChatParams _$GetChatParamsFromJson(Map<String, dynamic> json) =>
|
|||||||
GetChatParams(
|
GetChatParams(
|
||||||
lookIntoFuture:
|
lookIntoFuture:
|
||||||
$enumDecode(_$GetChatParamsSwitchEnumMap, json['lookIntoFuture']),
|
$enumDecode(_$GetChatParamsSwitchEnumMap, json['lookIntoFuture']),
|
||||||
limit: (json['limit'] as num?)?.toInt(),
|
limit: json['limit'] as int?,
|
||||||
lastKnownMessageId: (json['lastKnownMessageId'] as num?)?.toInt(),
|
lastKnownMessageId: json['lastKnownMessageId'] as int?,
|
||||||
lastCommonReadId: (json['lastCommonReadId'] as num?)?.toInt(),
|
lastCommonReadId: json['lastCommonReadId'] as int?,
|
||||||
timeout: (json['timeout'] as num?)?.toInt(),
|
timeout: json['timeout'] as int?,
|
||||||
setReadMarker: $enumDecodeNullable(
|
setReadMarker: $enumDecodeNullable(
|
||||||
_$GetChatParamsSwitchEnumMap, json['setReadMarker']),
|
_$GetChatParamsSwitchEnumMap, json['setReadMarker']),
|
||||||
includeLastKnown: $enumDecodeNullable(
|
includeLastKnown: $enumDecodeNullable(
|
||||||
|
@ -32,13 +32,13 @@ Map<String, dynamic> _$GetChatResponseToJson(GetChatResponse instance) {
|
|||||||
GetChatResponseObject _$GetChatResponseObjectFromJson(
|
GetChatResponseObject _$GetChatResponseObjectFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetChatResponseObject(
|
GetChatResponseObject(
|
||||||
(json['id'] as num).toInt(),
|
json['id'] as int,
|
||||||
json['token'] as String,
|
json['token'] as String,
|
||||||
$enumDecode(
|
$enumDecode(
|
||||||
_$GetRoomResponseObjectMessageActorTypeEnumMap, json['actorType']),
|
_$GetRoomResponseObjectMessageActorTypeEnumMap, json['actorType']),
|
||||||
json['actorId'] as String,
|
json['actorId'] as String,
|
||||||
json['actorDisplayName'] as String,
|
json['actorDisplayName'] as String,
|
||||||
(json['timestamp'] as num).toInt(),
|
json['timestamp'] as int,
|
||||||
json['systemMessage'] as String,
|
json['systemMessage'] as String,
|
||||||
$enumDecode(
|
$enumDecode(
|
||||||
_$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']),
|
_$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']),
|
||||||
@ -47,7 +47,7 @@ GetChatResponseObject _$GetChatResponseObjectFromJson(
|
|||||||
json['message'] as String,
|
json['message'] as String,
|
||||||
_fromJson(json['messageParameters']),
|
_fromJson(json['messageParameters']),
|
||||||
(json['reactions'] as Map<String, dynamic>?)?.map(
|
(json['reactions'] as Map<String, dynamic>?)?.map(
|
||||||
(k, e) => MapEntry(k, (e as num).toInt()),
|
(k, e) => MapEntry(k, e as int),
|
||||||
),
|
),
|
||||||
(json['reactionsSelf'] as List<dynamic>?)
|
(json['reactionsSelf'] as List<dynamic>?)
|
||||||
?.map((e) => e as String)
|
?.map((e) => e as String)
|
||||||
|
@ -8,7 +8,7 @@ part of 'createRoomParams.dart';
|
|||||||
|
|
||||||
CreateRoomParams _$CreateRoomParamsFromJson(Map<String, dynamic> json) =>
|
CreateRoomParams _$CreateRoomParamsFromJson(Map<String, dynamic> json) =>
|
||||||
CreateRoomParams(
|
CreateRoomParams(
|
||||||
roomType: (json['roomType'] as num).toInt(),
|
roomType: json['roomType'] as int,
|
||||||
invite: json['invite'] as String,
|
invite: json['invite'] as String,
|
||||||
source: json['source'] as String?,
|
source: json['source'] as String?,
|
||||||
roomName: json['roomName'] as String?,
|
roomName: json['roomName'] as String?,
|
||||||
|
@ -35,17 +35,17 @@ Map<String, dynamic> _$GetParticipantsResponseToJson(
|
|||||||
GetParticipantsResponseObject _$GetParticipantsResponseObjectFromJson(
|
GetParticipantsResponseObject _$GetParticipantsResponseObjectFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetParticipantsResponseObject(
|
GetParticipantsResponseObject(
|
||||||
(json['attendeeId'] as num).toInt(),
|
json['attendeeId'] as int,
|
||||||
json['actorType'] as String,
|
json['actorType'] as String,
|
||||||
json['actorId'] as String,
|
json['actorId'] as String,
|
||||||
json['displayName'] as String,
|
json['displayName'] as String,
|
||||||
$enumDecode(_$GetParticipantsResponseObjectParticipantTypeEnumMap,
|
$enumDecode(_$GetParticipantsResponseObjectParticipantTypeEnumMap,
|
||||||
json['participantType']),
|
json['participantType']),
|
||||||
(json['lastPing'] as num).toInt(),
|
json['lastPing'] as int,
|
||||||
$enumDecode(_$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap,
|
$enumDecode(_$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap,
|
||||||
json['inCall']),
|
json['inCall']),
|
||||||
(json['permissions'] as num).toInt(),
|
json['permissions'] as int,
|
||||||
(json['attendeePermissions'] as num).toInt(),
|
json['attendeePermissions'] as int,
|
||||||
json['sessionId'] as String?,
|
json['sessionId'] as String?,
|
||||||
(json['sessionIds'] as List<dynamic>).map((e) => e as String).toList(),
|
(json['sessionIds'] as List<dynamic>).map((e) => e as String).toList(),
|
||||||
json['status'] as String?,
|
json['status'] as String?,
|
||||||
|
@ -44,7 +44,7 @@ GetReactionsResponseObject _$GetReactionsResponseObjectFromJson(
|
|||||||
_$GetReactionsResponseObjectActorTypeEnumMap, json['actorType']),
|
_$GetReactionsResponseObjectActorTypeEnumMap, json['actorType']),
|
||||||
json['actorId'] as String,
|
json['actorId'] as String,
|
||||||
json['actorDisplayName'] as String,
|
json['actorDisplayName'] as String,
|
||||||
(json['timestamp'] as num).toInt(),
|
json['timestamp'] as int,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$GetReactionsResponseObjectToJson(
|
Map<String, dynamic> _$GetReactionsResponseObjectToJson(
|
||||||
|
@ -11,7 +11,7 @@ GetRoomParams _$GetRoomParamsFromJson(Map<String, dynamic> json) =>
|
|||||||
noStatusUpdate: $enumDecodeNullable(
|
noStatusUpdate: $enumDecodeNullable(
|
||||||
_$GetRoomParamsStatusUpdateEnumMap, json['noStatusUpdate']),
|
_$GetRoomParamsStatusUpdateEnumMap, json['noStatusUpdate']),
|
||||||
includeStatus: json['includeStatus'] as bool?,
|
includeStatus: json['includeStatus'] as bool?,
|
||||||
modifiedSince: (json['modifiedSince'] as num?)?.toInt(),
|
modifiedSince: json['modifiedSince'] as int?,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$GetRoomParamsToJson(GetRoomParams instance) =>
|
Map<String, dynamic> _$GetRoomParamsToJson(GetRoomParams instance) =>
|
||||||
|
@ -32,33 +32,33 @@ Map<String, dynamic> _$GetRoomResponseToJson(GetRoomResponse instance) {
|
|||||||
GetRoomResponseObject _$GetRoomResponseObjectFromJson(
|
GetRoomResponseObject _$GetRoomResponseObjectFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetRoomResponseObject(
|
GetRoomResponseObject(
|
||||||
(json['id'] as num).toInt(),
|
json['id'] as int,
|
||||||
json['token'] as String,
|
json['token'] as String,
|
||||||
$enumDecode(_$GetRoomResponseObjectConversationTypeEnumMap, json['type']),
|
$enumDecode(_$GetRoomResponseObjectConversationTypeEnumMap, json['type']),
|
||||||
json['name'] as String,
|
json['name'] as String,
|
||||||
json['displayName'] as String,
|
json['displayName'] as String,
|
||||||
json['description'] as String,
|
json['description'] as String,
|
||||||
(json['participantType'] as num).toInt(),
|
json['participantType'] as int,
|
||||||
(json['participantFlags'] as num).toInt(),
|
json['participantFlags'] as int,
|
||||||
(json['readOnly'] as num).toInt(),
|
json['readOnly'] as int,
|
||||||
(json['listable'] as num).toInt(),
|
json['listable'] as int,
|
||||||
(json['lastPing'] as num).toInt(),
|
json['lastPing'] as int,
|
||||||
json['sessionId'] as String,
|
json['sessionId'] as String,
|
||||||
json['hasPassword'] as bool,
|
json['hasPassword'] as bool,
|
||||||
json['hasCall'] as bool,
|
json['hasCall'] as bool,
|
||||||
(json['callFlag'] as num).toInt(),
|
json['callFlag'] as int,
|
||||||
json['canStartCall'] as bool,
|
json['canStartCall'] as bool,
|
||||||
json['canDeleteConversation'] as bool,
|
json['canDeleteConversation'] as bool,
|
||||||
json['canLeaveConversation'] as bool,
|
json['canLeaveConversation'] as bool,
|
||||||
(json['lastActivity'] as num).toInt(),
|
json['lastActivity'] as int,
|
||||||
json['isFavorite'] as bool,
|
json['isFavorite'] as bool,
|
||||||
$enumDecode(_$GetRoomResponseObjectParticipantNotificationLevelEnumMap,
|
$enumDecode(_$GetRoomResponseObjectParticipantNotificationLevelEnumMap,
|
||||||
json['notificationLevel']),
|
json['notificationLevel']),
|
||||||
(json['unreadMessages'] as num).toInt(),
|
json['unreadMessages'] as int,
|
||||||
json['unreadMention'] as bool,
|
json['unreadMention'] as bool,
|
||||||
json['unreadMentionDirect'] as bool,
|
json['unreadMentionDirect'] as bool,
|
||||||
(json['lastReadMessage'] as num).toInt(),
|
json['lastReadMessage'] as int,
|
||||||
(json['lastCommonReadMessage'] as num).toInt(),
|
json['lastCommonReadMessage'] as int,
|
||||||
GetChatResponseObject.fromJson(
|
GetChatResponseObject.fromJson(
|
||||||
json['lastMessage'] as Map<String, dynamic>),
|
json['lastMessage'] as Map<String, dynamic>),
|
||||||
json['status'] as String?,
|
json['status'] as String?,
|
||||||
|
@ -8,7 +8,7 @@ part of 'setReadMarkerParams.dart';
|
|||||||
|
|
||||||
SetReadMarkerParams _$SetReadMarkerParamsFromJson(Map<String, dynamic> json) =>
|
SetReadMarkerParams _$SetReadMarkerParamsFromJson(Map<String, dynamic> json) =>
|
||||||
SetReadMarkerParams(
|
SetReadMarkerParams(
|
||||||
lastReadMessage: (json['lastReadMessage'] as num?)?.toInt(),
|
lastReadMessage: json['lastReadMessage'] as int?,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$SetReadMarkerParamsToJson(
|
Map<String, dynamic> _$SetReadMarkerParamsToJson(
|
||||||
|
@ -12,7 +12,7 @@ CacheableFile _$CacheableFileFromJson(Map<String, dynamic> json) =>
|
|||||||
isDirectory: json['isDirectory'] as bool,
|
isDirectory: json['isDirectory'] as bool,
|
||||||
name: json['name'] as String,
|
name: json['name'] as String,
|
||||||
mimeType: json['mimeType'] as String?,
|
mimeType: json['mimeType'] as String?,
|
||||||
size: (json['size'] as num?)?.toInt(),
|
size: json['size'] as int?,
|
||||||
eTag: json['eTag'] as String?,
|
eTag: json['eTag'] as String?,
|
||||||
createdAt: json['createdAt'] == null
|
createdAt: json['createdAt'] == null
|
||||||
? null
|
? null
|
||||||
|
@ -11,7 +11,7 @@ AddFeedbackParams _$AddFeedbackParamsFromJson(Map<String, dynamic> json) =>
|
|||||||
user: json['user'] as String,
|
user: json['user'] as String,
|
||||||
feedback: json['feedback'] as String,
|
feedback: json['feedback'] as String,
|
||||||
screenshot: json['screenshot'] as String?,
|
screenshot: json['screenshot'] as String?,
|
||||||
appVersion: (json['appVersion'] as num).toInt(),
|
appVersion: json['appVersion'] as int,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$AddFeedbackParamsToJson(AddFeedbackParams instance) =>
|
Map<String, dynamic> _$AddFeedbackParamsToJson(AddFeedbackParams instance) =>
|
||||||
|
@ -12,7 +12,7 @@ UpdateUserIndexParams _$UpdateUserIndexParamsFromJson(
|
|||||||
user: json['user'] as String,
|
user: json['user'] as String,
|
||||||
username: json['username'] as String,
|
username: json['username'] as String,
|
||||||
device: json['device'] as String,
|
device: json['device'] as String,
|
||||||
appVersion: (json['appVersion'] as num).toInt(),
|
appVersion: json['appVersion'] as int,
|
||||||
deviceInfo: json['deviceInfo'] as String,
|
deviceInfo: json['deviceInfo'] as String,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import 'dart:developer';
|
|||||||
|
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:package_info/package_info.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
|
||||||
import '../../../../../model/accountData.dart';
|
import '../../../../../model/accountData.dart';
|
||||||
import '../../../mhslApi.dart';
|
import '../../../mhslApi.dart';
|
||||||
|
@ -10,9 +10,9 @@ AuthenticateResponse _$AuthenticateResponseFromJson(
|
|||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
AuthenticateResponse(
|
AuthenticateResponse(
|
||||||
json['sessionId'] as String,
|
json['sessionId'] as String,
|
||||||
(json['personType'] as num).toInt(),
|
json['personType'] as int,
|
||||||
(json['personId'] as num).toInt(),
|
json['personId'] as int,
|
||||||
(json['klasseId'] as num).toInt(),
|
json['klasseId'] as int,
|
||||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||||
(k, e) => MapEntry(k, e as String),
|
(k, e) => MapEntry(k, e as String),
|
||||||
);
|
);
|
||||||
|
@ -33,11 +33,11 @@ Map<String, dynamic> _$GetHolidaysResponseToJson(GetHolidaysResponse instance) {
|
|||||||
GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson(
|
GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetHolidaysResponseObject(
|
GetHolidaysResponseObject(
|
||||||
(json['id'] as num).toInt(),
|
json['id'] as int,
|
||||||
json['name'] as String,
|
json['name'] as String,
|
||||||
json['longName'] as String,
|
json['longName'] as String,
|
||||||
(json['startDate'] as num).toInt(),
|
json['startDate'] as int,
|
||||||
(json['endDate'] as num).toInt(),
|
json['endDate'] as int,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$GetHolidaysResponseObjectToJson(
|
Map<String, dynamic> _$GetHolidaysResponseObjectToJson(
|
||||||
|
@ -33,7 +33,7 @@ Map<String, dynamic> _$GetRoomsResponseToJson(GetRoomsResponse instance) {
|
|||||||
GetRoomsResponseObject _$GetRoomsResponseObjectFromJson(
|
GetRoomsResponseObject _$GetRoomsResponseObjectFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetRoomsResponseObject(
|
GetRoomsResponseObject(
|
||||||
(json['id'] as num).toInt(),
|
json['id'] as int,
|
||||||
json['name'] as String,
|
json['name'] as String,
|
||||||
json['longName'] as String,
|
json['longName'] as String,
|
||||||
json['active'] as bool,
|
json['active'] as bool,
|
||||||
|
@ -33,7 +33,7 @@ Map<String, dynamic> _$GetSubjectsResponseToJson(GetSubjectsResponse instance) {
|
|||||||
GetSubjectsResponseObject _$GetSubjectsResponseObjectFromJson(
|
GetSubjectsResponseObject _$GetSubjectsResponseObjectFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetSubjectsResponseObject(
|
GetSubjectsResponseObject(
|
||||||
(json['id'] as num).toInt(),
|
json['id'] as int,
|
||||||
json['name'] as String,
|
json['name'] as String,
|
||||||
json['longName'] as String,
|
json['longName'] as String,
|
||||||
json['alternateName'] as String,
|
json['alternateName'] as String,
|
||||||
|
@ -22,8 +22,8 @@ GetTimetableParamsOptions _$GetTimetableParamsOptionsFromJson(
|
|||||||
GetTimetableParamsOptions(
|
GetTimetableParamsOptions(
|
||||||
element: GetTimetableParamsOptionsElement.fromJson(
|
element: GetTimetableParamsOptionsElement.fromJson(
|
||||||
json['element'] as Map<String, dynamic>),
|
json['element'] as Map<String, dynamic>),
|
||||||
startDate: (json['startDate'] as num?)?.toInt(),
|
startDate: json['startDate'] as int?,
|
||||||
endDate: (json['endDate'] as num?)?.toInt(),
|
endDate: json['endDate'] as int?,
|
||||||
onlyBaseTimetable: json['onlyBaseTimetable'] as bool?,
|
onlyBaseTimetable: json['onlyBaseTimetable'] as bool?,
|
||||||
showBooking: json['showBooking'] as bool?,
|
showBooking: json['showBooking'] as bool?,
|
||||||
showInfo: json['showInfo'] as bool?,
|
showInfo: json['showInfo'] as bool?,
|
||||||
@ -99,8 +99,8 @@ const _$GetTimetableParamsOptionsFieldsEnumMap = {
|
|||||||
GetTimetableParamsOptionsElement _$GetTimetableParamsOptionsElementFromJson(
|
GetTimetableParamsOptionsElement _$GetTimetableParamsOptionsElementFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetTimetableParamsOptionsElement(
|
GetTimetableParamsOptionsElement(
|
||||||
id: (json['id'] as num).toInt(),
|
id: json['id'] as int,
|
||||||
type: (json['type'] as num).toInt(),
|
type: json['type'] as int,
|
||||||
keyType: $enumDecodeNullable(
|
keyType: $enumDecodeNullable(
|
||||||
_$GetTimetableParamsOptionsElementKeyTypeEnumMap, json['keyType']),
|
_$GetTimetableParamsOptionsElementKeyTypeEnumMap, json['keyType']),
|
||||||
);
|
);
|
||||||
|
@ -35,16 +35,16 @@ Map<String, dynamic> _$GetTimetableResponseToJson(
|
|||||||
GetTimetableResponseObject _$GetTimetableResponseObjectFromJson(
|
GetTimetableResponseObject _$GetTimetableResponseObjectFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetTimetableResponseObject(
|
GetTimetableResponseObject(
|
||||||
id: (json['id'] as num).toInt(),
|
id: json['id'] as int,
|
||||||
date: (json['date'] as num).toInt(),
|
date: json['date'] as int,
|
||||||
startTime: (json['startTime'] as num).toInt(),
|
startTime: json['startTime'] as int,
|
||||||
endTime: (json['endTime'] as num).toInt(),
|
endTime: json['endTime'] as int,
|
||||||
lstype: json['lstype'] as String?,
|
lstype: json['lstype'] as String?,
|
||||||
code: json['code'] as String?,
|
code: json['code'] as String?,
|
||||||
info: json['info'] as String?,
|
info: json['info'] as String?,
|
||||||
substText: json['substText'] as String?,
|
substText: json['substText'] as String?,
|
||||||
lstext: json['lstext'] as String?,
|
lstext: json['lstext'] as String?,
|
||||||
lsnumber: (json['lsnumber'] as num?)?.toInt(),
|
lsnumber: json['lsnumber'] as int?,
|
||||||
statflags: json['statflags'] as String?,
|
statflags: json['statflags'] as String?,
|
||||||
activityType: json['activityType'] as String?,
|
activityType: json['activityType'] as String?,
|
||||||
sg: json['sg'] as String?,
|
sg: json['sg'] as String?,
|
||||||
@ -110,7 +110,7 @@ GetTimetableResponseObjectFieldsObject
|
|||||||
_$GetTimetableResponseObjectFieldsObjectFromJson(
|
_$GetTimetableResponseObjectFieldsObjectFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetTimetableResponseObjectFieldsObject(
|
GetTimetableResponseObjectFieldsObject(
|
||||||
id: (json['id'] as num?)?.toInt(),
|
id: json['id'] as int?,
|
||||||
name: json['name'] as String?,
|
name: json['name'] as String?,
|
||||||
longname: json['longname'] as String?,
|
longname: json['longname'] as String?,
|
||||||
externalkey: json['externalkey'] as String?,
|
externalkey: json['externalkey'] as String?,
|
||||||
@ -128,7 +128,7 @@ Map<String, dynamic> _$GetTimetableResponseObjectFieldsObjectToJson(
|
|||||||
GetTimetableResponseObjectClass _$GetTimetableResponseObjectClassFromJson(
|
GetTimetableResponseObjectClass _$GetTimetableResponseObjectClassFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetTimetableResponseObjectClass(
|
GetTimetableResponseObjectClass(
|
||||||
(json['id'] as num).toInt(),
|
json['id'] as int,
|
||||||
json['name'] as String,
|
json['name'] as String,
|
||||||
json['longname'] as String,
|
json['longname'] as String,
|
||||||
json['externalkey'] as String?,
|
json['externalkey'] as String?,
|
||||||
@ -146,10 +146,10 @@ Map<String, dynamic> _$GetTimetableResponseObjectClassToJson(
|
|||||||
GetTimetableResponseObjectTeacher _$GetTimetableResponseObjectTeacherFromJson(
|
GetTimetableResponseObjectTeacher _$GetTimetableResponseObjectTeacherFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetTimetableResponseObjectTeacher(
|
GetTimetableResponseObjectTeacher(
|
||||||
(json['id'] as num).toInt(),
|
json['id'] as int,
|
||||||
json['name'] as String,
|
json['name'] as String,
|
||||||
json['longname'] as String,
|
json['longname'] as String,
|
||||||
(json['orgid'] as num?)?.toInt(),
|
json['orgid'] as int?,
|
||||||
json['orgname'] as String?,
|
json['orgname'] as String?,
|
||||||
json['externalkey'] as String?,
|
json['externalkey'] as String?,
|
||||||
);
|
);
|
||||||
@ -168,7 +168,7 @@ Map<String, dynamic> _$GetTimetableResponseObjectTeacherToJson(
|
|||||||
GetTimetableResponseObjectSubject _$GetTimetableResponseObjectSubjectFromJson(
|
GetTimetableResponseObjectSubject _$GetTimetableResponseObjectSubjectFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetTimetableResponseObjectSubject(
|
GetTimetableResponseObjectSubject(
|
||||||
(json['id'] as num).toInt(),
|
json['id'] as int,
|
||||||
json['name'] as String,
|
json['name'] as String,
|
||||||
json['longname'] as String,
|
json['longname'] as String,
|
||||||
);
|
);
|
||||||
@ -184,7 +184,7 @@ Map<String, dynamic> _$GetTimetableResponseObjectSubjectToJson(
|
|||||||
GetTimetableResponseObjectRoom _$GetTimetableResponseObjectRoomFromJson(
|
GetTimetableResponseObjectRoom _$GetTimetableResponseObjectRoomFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
GetTimetableResponseObjectRoom(
|
GetTimetableResponseObjectRoom(
|
||||||
(json['id'] as num).toInt(),
|
json['id'] as int,
|
||||||
json['name'] as String,
|
json['name'] as String,
|
||||||
json['longname'] as String,
|
json['longname'] as String,
|
||||||
);
|
);
|
||||||
|
93
lib/app.dart
93
lib/app.dart
@ -94,56 +94,55 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => PersistentTabView(
|
Widget build(BuildContext context) => PersistentTabView(
|
||||||
controller: Main.bottomNavigator,
|
controller: Main.bottomNavigator,
|
||||||
navBarOverlap: const NavBarOverlap.none(),
|
navBarOverlap: const NavBarOverlap.none(),
|
||||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||||
handleAndroidBackButtonPress: true,
|
handleAndroidBackButtonPress: false,
|
||||||
|
|
||||||
screenTransitionAnimation: const ScreenTransitionAnimation(curve: Curves.easeOutQuad, duration: Duration(milliseconds: 200)),
|
screenTransitionAnimation: const ScreenTransitionAnimation(curve: Curves.easeOutQuad, duration: Duration(milliseconds: 200)),
|
||||||
tabs: [
|
tabs: [
|
||||||
AppModule.getModule(Modules.timetable).toBottomTab(context),
|
AppModule.getModule(Modules.timetable).toBottomTab(context),
|
||||||
AppModule.getModule(Modules.talk).toBottomTab(
|
AppModule.getModule(Modules.talk).toBottomTab(
|
||||||
context,
|
context,
|
||||||
itemBuilder: (icon) => Consumer<ChatListProps>(
|
itemBuilder: (icon) => Consumer<ChatListProps>(
|
||||||
builder: (context, value, child) {
|
builder: (context, value, child) {
|
||||||
if(value.primaryLoading()) return Icon(icon);
|
if(value.primaryLoading()) return Icon(icon);
|
||||||
var messages = value.getRoomsResponse.data.map((e) => e.unreadMessages).reduce((a, b) => a+b);
|
var messages = value.getRoomsResponse.data.map((e) => e.unreadMessages).reduce((a, b) => a+b);
|
||||||
return badges.Badge(
|
return badges.Badge(
|
||||||
showBadge: messages > 0,
|
showBadge: messages > 0,
|
||||||
position: badges.BadgePosition.topEnd(top: -3, end: -3),
|
position: badges.BadgePosition.topEnd(top: -3, end: -3),
|
||||||
stackFit: StackFit.loose,
|
stackFit: StackFit.loose,
|
||||||
badgeStyle: badges.BadgeStyle(
|
badgeStyle: badges.BadgeStyle(
|
||||||
padding: const EdgeInsets.all(3),
|
padding: const EdgeInsets.all(3),
|
||||||
badgeColor: Theme.of(context).primaryColor,
|
badgeColor: Theme.of(context).primaryColor,
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
),
|
),
|
||||||
badgeContent: Text('$messages', style: const TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.bold)),
|
badgeContent: Text('$messages', style: const TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.bold)),
|
||||||
child: Icon(icon),
|
child: Icon(icon),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AppModule.getModule(Modules.files).toBottomTab(context),
|
||||||
|
|
||||||
|
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,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
AppModule.getModule(Modules.blocFiles).toBottomTab(context),
|
);
|
||||||
AppModule.getModule(Modules.files).toBottomTab(context),
|
|
||||||
|
|
||||||
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
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
@ -7,13 +7,13 @@ import 'package:firebase_messaging/firebase_messaging.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:hydrated_bloc/hydrated_bloc.dart';
|
import 'package:hydrated_bloc/hydrated_bloc.dart';
|
||||||
import 'package:jiffy/jiffy.dart';
|
import 'package:jiffy/jiffy.dart';
|
||||||
import 'package:loader_overlay/loader_overlay.dart';
|
import 'package:loader_overlay/loader_overlay.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
|
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
||||||
|
|
||||||
import 'api/mhsl/breaker/getBreakers/getBreakersResponse.dart';
|
import 'api/mhsl/breaker/getBreakers/getBreakersResponse.dart';
|
||||||
import 'app.dart';
|
import 'app.dart';
|
||||||
@ -42,13 +42,15 @@ Future<void> main() async {
|
|||||||
var initialisationTasks = [
|
var initialisationTasks = [
|
||||||
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform)
|
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform)
|
||||||
.then((value) async => log("Firebase token: ${await FirebaseMessaging.instance.getToken() ?? "Error: no Firebase token!"}"))
|
.then((value) async => log("Firebase token: ${await FirebaseMessaging.instance.getToken() ?? "Error: no Firebase token!"}"))
|
||||||
.onError((error, stackTrace) => log('Error initializing Firebase: $error', stackTrace: stackTrace)),
|
.onError((error, stackTrace) => log('Error initializing Firebase: $error')),
|
||||||
|
|
||||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem').then(addCertificateAsTrusted),
|
PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem').then(addCertificateAsTrusted),
|
||||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r10.pem').then(addCertificateAsTrusted),
|
PlatformAssetBundle().load('assets/ca/lets-encrypt-r10.pem').then(addCertificateAsTrusted),
|
||||||
|
|
||||||
Future(() async {
|
Future(() async {
|
||||||
await HydratedStorage.build(storageDirectory: await getTemporaryDirectory()).then((storage) => HydratedBloc.storage = storage);
|
await HydratedStorage.build(
|
||||||
|
storageDirectory: HydratedStorageDirectory((await getTemporaryDirectory()).path)
|
||||||
|
).then((storage) => HydratedBloc.storage = storage);
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import 'package:package_info/package_info.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
|
||||||
import '../../api/apiResponse.dart';
|
import '../../api/apiResponse.dart';
|
||||||
import '../../api/mhsl/breaker/getBreakers/getBreakersCache.dart';
|
import '../../api/mhsl/breaker/getBreakers/getBreakersCache.dart';
|
||||||
@ -10,7 +10,7 @@ class BreakerProps extends DataHolder {
|
|||||||
GetBreakersResponse get getBreakersResponse => _getBreakersResponse!;
|
GetBreakersResponse get getBreakersResponse => _getBreakersResponse!;
|
||||||
|
|
||||||
PackageInfo? packageInfo;
|
PackageInfo? packageInfo;
|
||||||
|
|
||||||
String? isBlocked(BreakerArea? type) {
|
String? isBlocked(BreakerArea? type) {
|
||||||
if(packageInfo == null) {
|
if(packageInfo == null) {
|
||||||
PackageInfo.fromPlatform().then((value) => packageInfo = value);
|
PackageInfo.fromPlatform().then((value) => packageInfo = value);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import 'package:flutter_app_badger/flutter_app_badger.dart';
|
import 'package:flutter_app_badge/flutter_app_badge.dart';
|
||||||
|
|
||||||
import '../../api/apiResponse.dart';
|
import '../../api/apiResponse.dart';
|
||||||
import '../../api/marianumcloud/talk/room/getRoomCache.dart';
|
import '../../api/marianumcloud/talk/room/getRoomCache.dart';
|
||||||
@ -20,7 +20,7 @@ class ChatListProps extends DataHolder {
|
|||||||
onUpdate: (GetRoomResponse data) => {
|
onUpdate: (GetRoomResponse data) => {
|
||||||
_getRoomResponse = data,
|
_getRoomResponse = data,
|
||||||
notifyListeners(),
|
notifyListeners(),
|
||||||
FlutterAppBadger.updateBadgeCount(data.data.map((e) => e.unreadMessages).reduce((a, b) => a+b))
|
FlutterAppBadge.count(data.data.map((e) => e.unreadMessages).reduce((a, b) => a+b))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,6 @@ class NotificationService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final iosSettings = DarwinInitializationSettings(
|
final iosSettings = DarwinInitializationSettings(
|
||||||
onDidReceiveLocalNotification: (id, title, body, payload) {
|
|
||||||
// TODO Navigate to Talk section (This runs when an Notification is tapped)
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter_app_badger/flutter_app_badger.dart';
|
import 'package:flutter_app_badge/flutter_app_badge.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../main.dart';
|
import '../main.dart';
|
||||||
@ -9,7 +9,7 @@ import '../model/chatList/chatProps.dart';
|
|||||||
|
|
||||||
class NotificationTasks {
|
class NotificationTasks {
|
||||||
static void updateBadgeCount(RemoteMessage notification) {
|
static void updateBadgeCount(RemoteMessage notification) {
|
||||||
FlutterAppBadger.updateBadgeCount(int.parse(notification.data['unreadCount'] ?? 0));
|
FlutterAppBadge.count(int.parse(notification.data['unreadCount'] ?? 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void updateProviders(BuildContext context) {
|
static void updateProviders(BuildContext context) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
import '../../infrastructure/dataLoader/http_data_loader.dart';
|
import '../../infrastructure/dataLoader/data_loader.dart';
|
||||||
|
|
||||||
abstract class HolidayDataLoader<TResult> extends HttpDataLoader<TResult> {
|
abstract class HolidayDataLoader<TResult> extends DataLoader<TResult> {
|
||||||
HolidayDataLoader() : super(Dio(BaseOptions(
|
HolidayDataLoader() : super(Dio(BaseOptions(
|
||||||
baseUrl: 'https://ferien-api.de/api/v1/',
|
baseUrl: 'https://ferien-api.de/api/v1/',
|
||||||
)));
|
)));
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
import '../../infrastructure/dataLoader/http_data_loader.dart';
|
import '../../infrastructure/dataLoader/data_loader.dart';
|
||||||
|
|
||||||
abstract class MhslDataLoader<TResult> extends HttpDataLoader<TResult> {
|
abstract class MhslDataLoader<TResult> extends DataLoader<TResult> {
|
||||||
MhslDataLoader() : super(Dio(BaseOptions(
|
MhslDataLoader() : super(Dio(BaseOptions(
|
||||||
baseUrl: 'https://mhsl.eu/marianum/marianummobile/'
|
baseUrl: 'https://mhsl.eu/marianum/marianummobile/'
|
||||||
)));
|
)));
|
||||||
|
@ -2,21 +2,26 @@ import 'dart:convert';
|
|||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
|
|
||||||
abstract class HttpDataLoader<TResult> {
|
abstract class DataLoader<TResult> {
|
||||||
final Dio dio;
|
final Dio dio;
|
||||||
HttpDataLoader(this.dio) {
|
DataLoader(this.dio) {
|
||||||
dio.options.connectTimeout = const Duration(seconds: 10).inMilliseconds;
|
dio.options.connectTimeout = const Duration(seconds: 10).inMilliseconds;
|
||||||
dio.options.sendTimeout = const Duration(seconds: 30).inMilliseconds;
|
dio.options.sendTimeout = const Duration(seconds: 30).inMilliseconds;
|
||||||
dio.options.receiveTimeout = const Duration(seconds: 30).inMilliseconds;
|
dio.options.receiveTimeout = const Duration(seconds: 30).inMilliseconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<TResult> run() async {
|
Future<TResult> run() async {
|
||||||
var response = await fetch();
|
var fetcher = fetch();
|
||||||
|
await Future.wait([
|
||||||
|
fetcher,
|
||||||
|
Future.delayed(const Duration(milliseconds: 500)) // TODO tune or remove
|
||||||
|
]);
|
||||||
|
|
||||||
|
var response = await fetcher;
|
||||||
try {
|
try {
|
||||||
return assemble(DataLoaderResult(
|
return assemble(DataLoaderResult(
|
||||||
json: await compute(jsonDecode, response.data!),
|
json: jsonDecode(response.data!),
|
||||||
headers: response.headers.map.map((key, value) => MapEntry(key, value.join(';'))),
|
headers: response.headers.map.map((key, value) => MapEntry(key, value.join(';'))),
|
||||||
));
|
));
|
||||||
} catch(trace, e) {
|
} catch(trace, e) {
|
@ -166,22 +166,27 @@ class __$$LoadableStateImplCopyWithImpl<TState, $Res>
|
|||||||
|
|
||||||
class _$LoadableStateImpl<TState> extends _LoadableState<TState> {
|
class _$LoadableStateImpl<TState> extends _LoadableState<TState> {
|
||||||
const _$LoadableStateImpl(
|
const _$LoadableStateImpl(
|
||||||
{required this.isLoading,
|
{this.isLoading = true,
|
||||||
required this.data,
|
this.data = null,
|
||||||
required this.lastFetch,
|
this.lastFetch = null,
|
||||||
required this.reFetch,
|
this.reFetch = null,
|
||||||
required this.error})
|
this.error = null})
|
||||||
: super._();
|
: super._();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@JsonKey()
|
||||||
final bool isLoading;
|
final bool isLoading;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey()
|
||||||
final TState? data;
|
final TState? data;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey()
|
||||||
final int? lastFetch;
|
final int? lastFetch;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey()
|
||||||
final void Function()? reFetch;
|
final void Function()? reFetch;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey()
|
||||||
final LoadingError? error;
|
final LoadingError? error;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -217,11 +222,11 @@ class _$LoadableStateImpl<TState> extends _LoadableState<TState> {
|
|||||||
|
|
||||||
abstract class _LoadableState<TState> extends LoadableState<TState> {
|
abstract class _LoadableState<TState> extends LoadableState<TState> {
|
||||||
const factory _LoadableState(
|
const factory _LoadableState(
|
||||||
{required final bool isLoading,
|
{final bool isLoading,
|
||||||
required final TState? data,
|
final TState? data,
|
||||||
required final int? lastFetch,
|
final int? lastFetch,
|
||||||
required final void Function()? reFetch,
|
final void Function()? reFetch,
|
||||||
required final LoadingError? error}) = _$LoadableStateImpl<TState>;
|
final LoadingError? error}) = _$LoadableStateImpl<TState>;
|
||||||
const _LoadableState._() : super._();
|
const _LoadableState._() : super._();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -17,16 +17,13 @@ class LoadableStateConsumer<TController extends Bloc<LoadableHydratedBlocEvent<T
|
|||||||
final Widget Function(TState state, bool loading) child;
|
final Widget Function(TState state, bool loading) child;
|
||||||
final void Function(TState state)? onLoad;
|
final void Function(TState state)? onLoad;
|
||||||
final bool wrapWithScrollView;
|
final bool wrapWithScrollView;
|
||||||
final TController? controllerByValue;
|
const LoadableStateConsumer({required this.child, this.onLoad, this.wrapWithScrollView = false, super.key});
|
||||||
const LoadableStateConsumer({required this.child, this.onLoad, this.wrapWithScrollView = false, this.controllerByValue = null, super.key});
|
|
||||||
|
|
||||||
static Duration animationDuration = const Duration(milliseconds: 200);
|
static Duration animationDuration = const Duration(milliseconds: 200);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var loadableState = controllerByValue != null
|
var loadableState = context.watch<TController>().state;
|
||||||
? controllerByValue!.state
|
|
||||||
: context.watch<TController>().state;
|
|
||||||
|
|
||||||
if(!loadableState.isLoading && onLoad != null) {
|
if(!loadableState.isLoading && onLoad != null) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) => onLoad!(loadableState.data));
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) => onLoad!(loadableState.data));
|
||||||
|
@ -30,17 +30,16 @@ abstract class LoadableHydratedBloc<
|
|||||||
isLoading: state.isLoading,
|
isLoading: state.isLoading,
|
||||||
data: event.state(innerState ?? fromNothing()),
|
data: event.state(innerState ?? fromNothing()),
|
||||||
lastFetch: state.lastFetch,
|
lastFetch: state.lastFetch,
|
||||||
reFetch: fetch,
|
reFetch: retry,
|
||||||
error: state.error,
|
error: state.error,
|
||||||
));
|
));
|
||||||
if(event.fetch) fetch();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
on<DataGathered<TState>>((event, emit) => emit(LoadableState(
|
on<DataGathered<TState>>((event, emit) => emit(LoadableState(
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
data: event.state(innerState ?? fromNothing()),
|
data: event.state(innerState ?? fromNothing()),
|
||||||
lastFetch: DateTime.now().millisecondsSinceEpoch,
|
lastFetch: DateTime.now().millisecondsSinceEpoch,
|
||||||
reFetch: fetch,
|
reFetch: retry,
|
||||||
error: null,
|
error: null,
|
||||||
)));
|
)));
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ abstract class LoadableHydratedBloc<
|
|||||||
isLoading: false,
|
isLoading: false,
|
||||||
data: innerState,
|
data: innerState,
|
||||||
lastFetch: state.lastFetch,
|
lastFetch: state.lastFetch,
|
||||||
reFetch: fetch,
|
reFetch: retry,
|
||||||
error: event.error
|
error: event.error
|
||||||
)));
|
)));
|
||||||
|
|
||||||
@ -67,14 +66,19 @@ abstract class LoadableHydratedBloc<
|
|||||||
TState? get innerState => state.data;
|
TState? get innerState => state.data;
|
||||||
TRepository get repo => _repository;
|
TRepository get repo => _repository;
|
||||||
|
|
||||||
|
void retry() {
|
||||||
|
log('Fetch retry triggered for ${TState.toString()}');
|
||||||
|
add(RefetchStarted<TState>());
|
||||||
|
fetch();
|
||||||
|
}
|
||||||
|
|
||||||
void fetch() {
|
void fetch() {
|
||||||
log('Fetching data for ${TState.toString()}');
|
log('Fetching data for ${TState.toString()}');
|
||||||
add(RefetchStarted<TState>());
|
|
||||||
gatherData().catchError(
|
gatherData().catchError(
|
||||||
(e) {
|
(e) {
|
||||||
log('Error while fetching ${TState.toString()}: ${e.toString()}');
|
log('Error while fetching ${TState.toString()}: ${e.toString()}');
|
||||||
add(Error(LoadingError(
|
add(Error(LoadingError(
|
||||||
message: e.toString(),
|
message: e.message ?? e.toString(),
|
||||||
allowRetry: true,
|
allowRetry: true,
|
||||||
)));
|
)));
|
||||||
},
|
},
|
||||||
@ -88,7 +92,7 @@ abstract class LoadableHydratedBloc<
|
|||||||
var rawData = LoadableSaveContext.unwrap(json);
|
var rawData = LoadableSaveContext.unwrap(json);
|
||||||
return LoadableState(
|
return LoadableState(
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
data: fromStorage(rawData.data), // TODO fromStorage in isolate
|
data: fromStorage(rawData.data),
|
||||||
lastFetch: rawData.meta.timestamp,
|
lastFetch: rawData.meta.timestamp,
|
||||||
reFetch: null,
|
reFetch: null,
|
||||||
error: null,
|
error: null,
|
||||||
@ -99,7 +103,7 @@ abstract class LoadableHydratedBloc<
|
|||||||
Map<String, dynamic>? toJson(LoadableState<TState> state) {
|
Map<String, dynamic>? toJson(LoadableState<TState> state) {
|
||||||
Map<String, dynamic>? data;
|
Map<String, dynamic>? data;
|
||||||
try {
|
try {
|
||||||
data = state.data == null ? null : toStorage(state.data); // TODO toStorage in isolate
|
data = state.data == null ? null : toStorage(state.data);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
log('Failed to save state ${TState.toString()}: ${e.toString()}');
|
log('Failed to save state ${TState.toString()}: ${e.toString()}');
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,7 @@ import '../../loadableState/loading_error.dart';
|
|||||||
class LoadableHydratedBlocEvent<TState> {}
|
class LoadableHydratedBlocEvent<TState> {}
|
||||||
class Emit<TState> extends LoadableHydratedBlocEvent<TState> {
|
class Emit<TState> extends LoadableHydratedBlocEvent<TState> {
|
||||||
final TState Function(TState state) state;
|
final TState Function(TState state) state;
|
||||||
final bool fetch;
|
Emit(this.state);
|
||||||
Emit(this.state, {this.fetch = false});
|
|
||||||
}
|
}
|
||||||
class DataGathered<TState> extends LoadableHydratedBlocEvent<TState> {
|
class DataGathered<TState> extends LoadableHydratedBlocEvent<TState> {
|
||||||
final TState Function(TState state) state;
|
final TState Function(TState state) state;
|
||||||
|
@ -9,7 +9,7 @@ part of 'loadable_save_context.dart';
|
|||||||
_$LoadableSaveContextImpl _$$LoadableSaveContextImplFromJson(
|
_$LoadableSaveContextImpl _$$LoadableSaveContextImplFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json) =>
|
||||||
_$LoadableSaveContextImpl(
|
_$LoadableSaveContextImpl(
|
||||||
timestamp: (json['timestamp'] as num).toInt(),
|
timestamp: json['timestamp'] as int,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$LoadableSaveContextImplToJson(
|
Map<String, dynamic> _$$LoadableSaveContextImplToJson(
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:bloc/bloc.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'bloc_module.dart';
|
|
||||||
|
|
||||||
class SwappingBloc<TBloc> {
|
|
||||||
final TBloc initialBloc;
|
|
||||||
final StreamController<TBloc> updater = StreamController<TBloc>();
|
|
||||||
|
|
||||||
SwappingBloc(this.initialBloc);
|
|
||||||
|
|
||||||
void swap(TBloc bloc) {
|
|
||||||
updater.add(bloc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SwappingBlocModule<TBloc extends StateStreamableSource<TState>, TState> extends StatefulWidget {
|
|
||||||
final SwappingBloc<TBloc> bloc;
|
|
||||||
final Widget Function(BuildContext context, TBloc bloc, TState state) child;
|
|
||||||
const SwappingBlocModule({super.key, required this.bloc, required this.child});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<SwappingBlocModule<TBloc, TState>> createState() => _SwappingBlocModuleState<TBloc, TState>();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SwappingBlocModuleState<TBloc extends StateStreamableSource<TState>, TState> extends State<SwappingBlocModule<TBloc, TState>> {
|
|
||||||
late TBloc bloc;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
bloc = widget.bloc.initialBloc;
|
|
||||||
widget.bloc.updater.stream.listen((event) {
|
|
||||||
setState(() {
|
|
||||||
bloc = event;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) => BlocModule<TBloc, TState>(
|
|
||||||
autoRebuild: true,
|
|
||||||
create: (context) => bloc,
|
|
||||||
child: (context, bloc, state) => widget.child(context, bloc, state),
|
|
||||||
);
|
|
||||||
}
|
|
@ -8,7 +8,6 @@ import '../../../view/pages/more/roomplan/roomplan.dart';
|
|||||||
import '../../../view/pages/talk/chatList.dart';
|
import '../../../view/pages/talk/chatList.dart';
|
||||||
import '../../../view/pages/timetable/timetable.dart';
|
import '../../../view/pages/timetable/timetable.dart';
|
||||||
import '../../../widget/centeredLeading.dart';
|
import '../../../widget/centeredLeading.dart';
|
||||||
import 'files/view/files_view.dart';
|
|
||||||
import 'gradeAverages/view/grade_averages_view.dart';
|
import 'gradeAverages/view/grade_averages_view.dart';
|
||||||
import 'holidays/view/holidays_view.dart';
|
import 'holidays/view/holidays_view.dart';
|
||||||
import 'marianumMessage/view/marianum_message_list_view.dart';
|
import 'marianumMessage/view/marianum_message_list_view.dart';
|
||||||
@ -24,7 +23,6 @@ class AppModule {
|
|||||||
Modules.timetable: AppModule('Vertretung', Icons.calendar_month, Timetable.new),
|
Modules.timetable: AppModule('Vertretung', Icons.calendar_month, Timetable.new),
|
||||||
Modules.talk: AppModule('Talk', Icons.chat, ChatList.new),
|
Modules.talk: AppModule('Talk', Icons.chat, ChatList.new),
|
||||||
Modules.files: AppModule('Files', Icons.folder, Files.new),
|
Modules.files: AppModule('Files', Icons.folder, Files.new),
|
||||||
Modules.blocFiles: AppModule('BlocFiles', Icons.folder, FilesView.new),
|
|
||||||
Modules.marianumMessage: AppModule('Marianum Message', Icons.newspaper, MarianumMessageListView.new),
|
Modules.marianumMessage: AppModule('Marianum Message', Icons.newspaper, MarianumMessageListView.new),
|
||||||
Modules.roomPlan: AppModule('Raumplan', Icons.location_pin, Roomplan.new),
|
Modules.roomPlan: AppModule('Raumplan', Icons.location_pin, Roomplan.new),
|
||||||
Modules.gradeAveragesCalculator: AppModule('Notendurschnittsrechner', Icons.calculate, GradeAveragesView.new),
|
Modules.gradeAveragesCalculator: AppModule('Notendurschnittsrechner', Icons.calculate, GradeAveragesView.new),
|
||||||
@ -55,7 +53,6 @@ enum Modules {
|
|||||||
timetable,
|
timetable,
|
||||||
talk,
|
talk,
|
||||||
files,
|
files,
|
||||||
blocFiles,
|
|
||||||
marianumMessage,
|
marianumMessage,
|
||||||
roomPlan,
|
roomPlan,
|
||||||
gradeAveragesCalculator,
|
gradeAveragesCalculator,
|
||||||
|
@ -1,71 +0,0 @@
|
|||||||
|
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:sorted/sorted.dart';
|
|
||||||
|
|
||||||
import '../../../infrastructure/utilityWidgets/loadableHydratedBloc/loadable_hydrated_bloc.dart';
|
|
||||||
import '../../../infrastructure/utilityWidgets/loadableHydratedBloc/loadable_hydrated_bloc_event.dart';
|
|
||||||
import '../repository/files_repository.dart';
|
|
||||||
import 'files_event.dart';
|
|
||||||
import 'files_state.dart';
|
|
||||||
|
|
||||||
class FilesBloc extends LoadableHydratedBloc<FilesEvent, FilesState, FilesRepository> {
|
|
||||||
static const String basePath = '/';
|
|
||||||
|
|
||||||
FilesBloc() {
|
|
||||||
add(Emit((state) => state.copyWith(currentFolder: basePath)));
|
|
||||||
on<EnterFolder>((event, emit) {
|
|
||||||
add(Emit((state) {
|
|
||||||
log('setFolder');
|
|
||||||
return state.copyWith(currentFolder: event.absolutePath);
|
|
||||||
}, fetch: true));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
List<File>? getVisibleFiles() => innerState?.files[innerState?.currentFolder];
|
|
||||||
String getCurrentFolder() => innerState?.currentFolder ?? basePath;
|
|
||||||
String getCurrentFolderName() {
|
|
||||||
var folder = innerState?.currentFolder.split('/').reversed.elementAt(1);
|
|
||||||
return folder!.isEmpty ? 'Dateien' : folder;
|
|
||||||
}
|
|
||||||
bool canGoBack() => innerState?.currentFolder != basePath;
|
|
||||||
String goBackLocation() {
|
|
||||||
var pathSegments = innerState?.currentFolder.split(basePath) ?? [];
|
|
||||||
if (pathSegments.isNotEmpty) {
|
|
||||||
pathSegments.removeLast();
|
|
||||||
pathSegments.removeLast();
|
|
||||||
}
|
|
||||||
return pathSegments.join(basePath) + basePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
List currentSortConfiguration() => [
|
|
||||||
SortedComparable<File, DateTime>((file) => file.updatedAt ?? DateTime.now()),
|
|
||||||
];
|
|
||||||
|
|
||||||
@override
|
|
||||||
FilesState fromNothing() => const FilesState(currentFolder: basePath, files: {});
|
|
||||||
|
|
||||||
@override
|
|
||||||
FilesState fromStorage(Map<String, dynamic> json) => FilesState.fromJson(json);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> gatherData() async {
|
|
||||||
var fetchFolder = getCurrentFolder();
|
|
||||||
log(fetchFolder);
|
|
||||||
var files = await repo.getFileList(fetchFolder);
|
|
||||||
var newFileMap = Map.of(innerState?.files ?? <String, List<File>>{});
|
|
||||||
newFileMap[fetchFolder] = files;
|
|
||||||
if(fetchFolder != getCurrentFolder()) {
|
|
||||||
log('Fetch aborted due to folder change (expected "$fetchFolder" got "${getCurrentFolder()}")');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
add(DataGathered((state) => state.copyWith(files: newFileMap)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
FilesRepository repository() => FilesRepository();
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic>? toStorage(FilesState state) => state.toJson();
|
|
||||||
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
import '../../../infrastructure/utilityWidgets/loadableHydratedBloc/loadable_hydrated_bloc_event.dart';
|
|
||||||
import 'files_state.dart';
|
|
||||||
|
|
||||||
sealed class FilesEvent extends LoadableHydratedBlocEvent<FilesState> {}
|
|
||||||
class EnterFolder extends FilesEvent {
|
|
||||||
String absolutePath;
|
|
||||||
EnterFolder(this.absolutePath);
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
||||||
|
|
||||||
part 'files_state.freezed.dart';
|
|
||||||
part 'files_state.g.dart';
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class FilesState with _$FilesState {
|
|
||||||
const factory FilesState({
|
|
||||||
required String currentFolder,
|
|
||||||
required Map<String, List<File>> files,
|
|
||||||
}) = _FilesState;
|
|
||||||
|
|
||||||
factory FilesState.fromJson(Map<String, Object?> json) => _$FilesStateFromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class File with _$File {
|
|
||||||
const factory File({
|
|
||||||
required String path,
|
|
||||||
required bool isFolder,
|
|
||||||
required String name,
|
|
||||||
required DateTime? createdAt,
|
|
||||||
required DateTime? updatedAt,
|
|
||||||
required int? size,
|
|
||||||
required String? mimeType,
|
|
||||||
}) = _File;
|
|
||||||
|
|
||||||
factory File.fromJson(Map<String, Object?> json) => _$FileFromJson(json);
|
|
||||||
}
|
|
@ -1,439 +0,0 @@
|
|||||||
// coverage:ignore-file
|
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
|
||||||
|
|
||||||
part of 'files_state.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// FreezedGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
T _$identity<T>(T value) => value;
|
|
||||||
|
|
||||||
final _privateConstructorUsedError = UnsupportedError(
|
|
||||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
||||||
|
|
||||||
FilesState _$FilesStateFromJson(Map<String, dynamic> json) {
|
|
||||||
return _FilesState.fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
mixin _$FilesState {
|
|
||||||
String get currentFolder => throw _privateConstructorUsedError;
|
|
||||||
Map<String, List<File>> get files => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(ignore: true)
|
|
||||||
$FilesStateCopyWith<FilesState> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class $FilesStateCopyWith<$Res> {
|
|
||||||
factory $FilesStateCopyWith(
|
|
||||||
FilesState value, $Res Function(FilesState) then) =
|
|
||||||
_$FilesStateCopyWithImpl<$Res, FilesState>;
|
|
||||||
@useResult
|
|
||||||
$Res call({String currentFolder, Map<String, List<File>> files});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class _$FilesStateCopyWithImpl<$Res, $Val extends FilesState>
|
|
||||||
implements $FilesStateCopyWith<$Res> {
|
|
||||||
_$FilesStateCopyWithImpl(this._value, this._then);
|
|
||||||
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Val _value;
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? currentFolder = null,
|
|
||||||
Object? files = null,
|
|
||||||
}) {
|
|
||||||
return _then(_value.copyWith(
|
|
||||||
currentFolder: null == currentFolder
|
|
||||||
? _value.currentFolder
|
|
||||||
: currentFolder // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
files: null == files
|
|
||||||
? _value.files
|
|
||||||
: files // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Map<String, List<File>>,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$FilesStateImplCopyWith<$Res>
|
|
||||||
implements $FilesStateCopyWith<$Res> {
|
|
||||||
factory _$$FilesStateImplCopyWith(
|
|
||||||
_$FilesStateImpl value, $Res Function(_$FilesStateImpl) then) =
|
|
||||||
__$$FilesStateImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call({String currentFolder, Map<String, List<File>> files});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$FilesStateImplCopyWithImpl<$Res>
|
|
||||||
extends _$FilesStateCopyWithImpl<$Res, _$FilesStateImpl>
|
|
||||||
implements _$$FilesStateImplCopyWith<$Res> {
|
|
||||||
__$$FilesStateImplCopyWithImpl(
|
|
||||||
_$FilesStateImpl _value, $Res Function(_$FilesStateImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? currentFolder = null,
|
|
||||||
Object? files = null,
|
|
||||||
}) {
|
|
||||||
return _then(_$FilesStateImpl(
|
|
||||||
currentFolder: null == currentFolder
|
|
||||||
? _value.currentFolder
|
|
||||||
: currentFolder // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
files: null == files
|
|
||||||
? _value._files
|
|
||||||
: files // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Map<String, List<File>>,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
@JsonSerializable()
|
|
||||||
class _$FilesStateImpl implements _FilesState {
|
|
||||||
const _$FilesStateImpl(
|
|
||||||
{required this.currentFolder,
|
|
||||||
required final Map<String, List<File>> files})
|
|
||||||
: _files = files;
|
|
||||||
|
|
||||||
factory _$FilesStateImpl.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$$FilesStateImplFromJson(json);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final String currentFolder;
|
|
||||||
final Map<String, List<File>> _files;
|
|
||||||
@override
|
|
||||||
Map<String, List<File>> get files {
|
|
||||||
if (_files is EqualUnmodifiableMapView) return _files;
|
|
||||||
// ignore: implicit_dynamic_type
|
|
||||||
return EqualUnmodifiableMapView(_files);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'FilesState(currentFolder: $currentFolder, files: $files)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$FilesStateImpl &&
|
|
||||||
(identical(other.currentFolder, currentFolder) ||
|
|
||||||
other.currentFolder == currentFolder) &&
|
|
||||||
const DeepCollectionEquality().equals(other._files, _files));
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonKey(ignore: true)
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(
|
|
||||||
runtimeType, currentFolder, const DeepCollectionEquality().hash(_files));
|
|
||||||
|
|
||||||
@JsonKey(ignore: true)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$FilesStateImplCopyWith<_$FilesStateImpl> get copyWith =>
|
|
||||||
__$$FilesStateImplCopyWithImpl<_$FilesStateImpl>(this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
return _$$FilesStateImplToJson(
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _FilesState implements FilesState {
|
|
||||||
const factory _FilesState(
|
|
||||||
{required final String currentFolder,
|
|
||||||
required final Map<String, List<File>> files}) = _$FilesStateImpl;
|
|
||||||
|
|
||||||
factory _FilesState.fromJson(Map<String, dynamic> json) =
|
|
||||||
_$FilesStateImpl.fromJson;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get currentFolder;
|
|
||||||
@override
|
|
||||||
Map<String, List<File>> get files;
|
|
||||||
@override
|
|
||||||
@JsonKey(ignore: true)
|
|
||||||
_$$FilesStateImplCopyWith<_$FilesStateImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
File _$FileFromJson(Map<String, dynamic> json) {
|
|
||||||
return _File.fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
mixin _$File {
|
|
||||||
String get path => throw _privateConstructorUsedError;
|
|
||||||
bool get isFolder => throw _privateConstructorUsedError;
|
|
||||||
String get name => throw _privateConstructorUsedError;
|
|
||||||
DateTime? get createdAt => throw _privateConstructorUsedError;
|
|
||||||
DateTime? get updatedAt => throw _privateConstructorUsedError;
|
|
||||||
int? get size => throw _privateConstructorUsedError;
|
|
||||||
String? get mimeType => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
||||||
@JsonKey(ignore: true)
|
|
||||||
$FileCopyWith<File> get copyWith => throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class $FileCopyWith<$Res> {
|
|
||||||
factory $FileCopyWith(File value, $Res Function(File) then) =
|
|
||||||
_$FileCopyWithImpl<$Res, File>;
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{String path,
|
|
||||||
bool isFolder,
|
|
||||||
String name,
|
|
||||||
DateTime? createdAt,
|
|
||||||
DateTime? updatedAt,
|
|
||||||
int? size,
|
|
||||||
String? mimeType});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class _$FileCopyWithImpl<$Res, $Val extends File>
|
|
||||||
implements $FileCopyWith<$Res> {
|
|
||||||
_$FileCopyWithImpl(this._value, this._then);
|
|
||||||
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Val _value;
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? path = null,
|
|
||||||
Object? isFolder = null,
|
|
||||||
Object? name = null,
|
|
||||||
Object? createdAt = freezed,
|
|
||||||
Object? updatedAt = freezed,
|
|
||||||
Object? size = freezed,
|
|
||||||
Object? mimeType = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_value.copyWith(
|
|
||||||
path: null == path
|
|
||||||
? _value.path
|
|
||||||
: path // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
isFolder: null == isFolder
|
|
||||||
? _value.isFolder
|
|
||||||
: isFolder // ignore: cast_nullable_to_non_nullable
|
|
||||||
as bool,
|
|
||||||
name: null == name
|
|
||||||
? _value.name
|
|
||||||
: name // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
createdAt: freezed == createdAt
|
|
||||||
? _value.createdAt
|
|
||||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
updatedAt: freezed == updatedAt
|
|
||||||
? _value.updatedAt
|
|
||||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
size: freezed == size
|
|
||||||
? _value.size
|
|
||||||
: size // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
mimeType: freezed == mimeType
|
|
||||||
? _value.mimeType
|
|
||||||
: mimeType // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$FileImplCopyWith<$Res> implements $FileCopyWith<$Res> {
|
|
||||||
factory _$$FileImplCopyWith(
|
|
||||||
_$FileImpl value, $Res Function(_$FileImpl) then) =
|
|
||||||
__$$FileImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{String path,
|
|
||||||
bool isFolder,
|
|
||||||
String name,
|
|
||||||
DateTime? createdAt,
|
|
||||||
DateTime? updatedAt,
|
|
||||||
int? size,
|
|
||||||
String? mimeType});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$FileImplCopyWithImpl<$Res>
|
|
||||||
extends _$FileCopyWithImpl<$Res, _$FileImpl>
|
|
||||||
implements _$$FileImplCopyWith<$Res> {
|
|
||||||
__$$FileImplCopyWithImpl(_$FileImpl _value, $Res Function(_$FileImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? path = null,
|
|
||||||
Object? isFolder = null,
|
|
||||||
Object? name = null,
|
|
||||||
Object? createdAt = freezed,
|
|
||||||
Object? updatedAt = freezed,
|
|
||||||
Object? size = freezed,
|
|
||||||
Object? mimeType = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_$FileImpl(
|
|
||||||
path: null == path
|
|
||||||
? _value.path
|
|
||||||
: path // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
isFolder: null == isFolder
|
|
||||||
? _value.isFolder
|
|
||||||
: isFolder // ignore: cast_nullable_to_non_nullable
|
|
||||||
as bool,
|
|
||||||
name: null == name
|
|
||||||
? _value.name
|
|
||||||
: name // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
createdAt: freezed == createdAt
|
|
||||||
? _value.createdAt
|
|
||||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
updatedAt: freezed == updatedAt
|
|
||||||
? _value.updatedAt
|
|
||||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
|
||||||
as DateTime?,
|
|
||||||
size: freezed == size
|
|
||||||
? _value.size
|
|
||||||
: size // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int?,
|
|
||||||
mimeType: freezed == mimeType
|
|
||||||
? _value.mimeType
|
|
||||||
: mimeType // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
@JsonSerializable()
|
|
||||||
class _$FileImpl implements _File {
|
|
||||||
const _$FileImpl(
|
|
||||||
{required this.path,
|
|
||||||
required this.isFolder,
|
|
||||||
required this.name,
|
|
||||||
required this.createdAt,
|
|
||||||
required this.updatedAt,
|
|
||||||
required this.size,
|
|
||||||
required this.mimeType});
|
|
||||||
|
|
||||||
factory _$FileImpl.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$$FileImplFromJson(json);
|
|
||||||
|
|
||||||
@override
|
|
||||||
final String path;
|
|
||||||
@override
|
|
||||||
final bool isFolder;
|
|
||||||
@override
|
|
||||||
final String name;
|
|
||||||
@override
|
|
||||||
final DateTime? createdAt;
|
|
||||||
@override
|
|
||||||
final DateTime? updatedAt;
|
|
||||||
@override
|
|
||||||
final int? size;
|
|
||||||
@override
|
|
||||||
final String? mimeType;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'File(path: $path, isFolder: $isFolder, name: $name, createdAt: $createdAt, updatedAt: $updatedAt, size: $size, mimeType: $mimeType)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$FileImpl &&
|
|
||||||
(identical(other.path, path) || other.path == path) &&
|
|
||||||
(identical(other.isFolder, isFolder) ||
|
|
||||||
other.isFolder == isFolder) &&
|
|
||||||
(identical(other.name, name) || other.name == name) &&
|
|
||||||
(identical(other.createdAt, createdAt) ||
|
|
||||||
other.createdAt == createdAt) &&
|
|
||||||
(identical(other.updatedAt, updatedAt) ||
|
|
||||||
other.updatedAt == updatedAt) &&
|
|
||||||
(identical(other.size, size) || other.size == size) &&
|
|
||||||
(identical(other.mimeType, mimeType) ||
|
|
||||||
other.mimeType == mimeType));
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonKey(ignore: true)
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(
|
|
||||||
runtimeType, path, isFolder, name, createdAt, updatedAt, size, mimeType);
|
|
||||||
|
|
||||||
@JsonKey(ignore: true)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$FileImplCopyWith<_$FileImpl> get copyWith =>
|
|
||||||
__$$FileImplCopyWithImpl<_$FileImpl>(this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
return _$$FileImplToJson(
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _File implements File {
|
|
||||||
const factory _File(
|
|
||||||
{required final String path,
|
|
||||||
required final bool isFolder,
|
|
||||||
required final String name,
|
|
||||||
required final DateTime? createdAt,
|
|
||||||
required final DateTime? updatedAt,
|
|
||||||
required final int? size,
|
|
||||||
required final String? mimeType}) = _$FileImpl;
|
|
||||||
|
|
||||||
factory _File.fromJson(Map<String, dynamic> json) = _$FileImpl.fromJson;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get path;
|
|
||||||
@override
|
|
||||||
bool get isFolder;
|
|
||||||
@override
|
|
||||||
String get name;
|
|
||||||
@override
|
|
||||||
DateTime? get createdAt;
|
|
||||||
@override
|
|
||||||
DateTime? get updatedAt;
|
|
||||||
@override
|
|
||||||
int? get size;
|
|
||||||
@override
|
|
||||||
String? get mimeType;
|
|
||||||
@override
|
|
||||||
@JsonKey(ignore: true)
|
|
||||||
_$$FileImplCopyWith<_$FileImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'files_state.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// JsonSerializableGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
_$FilesStateImpl _$$FilesStateImplFromJson(Map<String, dynamic> json) =>
|
|
||||||
_$FilesStateImpl(
|
|
||||||
currentFolder: json['currentFolder'] as String,
|
|
||||||
files: (json['files'] as Map<String, dynamic>).map(
|
|
||||||
(k, e) => MapEntry(
|
|
||||||
k,
|
|
||||||
(e as List<dynamic>)
|
|
||||||
.map((e) => File.fromJson(e as Map<String, dynamic>))
|
|
||||||
.toList()),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$FilesStateImplToJson(_$FilesStateImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'currentFolder': instance.currentFolder,
|
|
||||||
'files': instance.files,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$FileImpl _$$FileImplFromJson(Map<String, dynamic> json) => _$FileImpl(
|
|
||||||
path: json['path'] as String,
|
|
||||||
isFolder: json['isFolder'] as bool,
|
|
||||||
name: json['name'] as String,
|
|
||||||
createdAt: json['createdAt'] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json['createdAt'] as String),
|
|
||||||
updatedAt: json['updatedAt'] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json['updatedAt'] as String),
|
|
||||||
size: (json['size'] as num?)?.toInt(),
|
|
||||||
mimeType: json['mimeType'] as String?,
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$FileImplToJson(_$FileImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'path': instance.path,
|
|
||||||
'isFolder': instance.isFolder,
|
|
||||||
'name': instance.name,
|
|
||||||
'createdAt': instance.createdAt?.toIso8601String(),
|
|
||||||
'updatedAt': instance.updatedAt?.toIso8601String(),
|
|
||||||
'size': instance.size,
|
|
||||||
'mimeType': instance.mimeType,
|
|
||||||
};
|
|
@ -1,31 +0,0 @@
|
|||||||
|
|
||||||
import 'package:nextcloud/nextcloud.dart';
|
|
||||||
|
|
||||||
import '../../../../../api/marianumcloud/webdav/webdavApi.dart';
|
|
||||||
import '../../../infrastructure/repository/repository.dart';
|
|
||||||
import '../bloc/files_state.dart';
|
|
||||||
|
|
||||||
class FilesRepository extends Repository<FilesState> {
|
|
||||||
Future<List<File>> getFileList(String path) async {
|
|
||||||
var webdav = await WebdavApi.webdav;
|
|
||||||
var response = await webdav.propfind(PathUri.parse(path)); // TODO move to custom data loader
|
|
||||||
var davFiles = response.toWebDavFiles();
|
|
||||||
|
|
||||||
davFiles.removeWhere((file) {
|
|
||||||
var filePath = file.path.path;
|
|
||||||
return filePath.isEmpty || filePath == path;
|
|
||||||
});
|
|
||||||
|
|
||||||
var files = davFiles.map((davFile) => File(
|
|
||||||
path: davFile.path.path,
|
|
||||||
isFolder: davFile.isDirectory,
|
|
||||||
name: davFile.name,
|
|
||||||
createdAt: davFile.createdDate,
|
|
||||||
updatedAt: davFile.lastModified,
|
|
||||||
size: davFile.size,
|
|
||||||
mimeType: davFile.mimeType
|
|
||||||
));
|
|
||||||
|
|
||||||
return files.toList();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import '../../../infrastructure/loadableState/loadable_state.dart';
|
|
||||||
import '../../../infrastructure/utilityWidgets/bloc_module.dart';
|
|
||||||
import '../bloc/files_bloc.dart';
|
|
||||||
import '../bloc/files_state.dart';
|
|
||||||
import 'folder_view.dart';
|
|
||||||
|
|
||||||
class FilesView extends StatelessWidget {
|
|
||||||
const FilesView({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) => BlocModule<FilesBloc, LoadableState<FilesState>>(
|
|
||||||
create: (context) => FilesBloc(),
|
|
||||||
autoRebuild: true,
|
|
||||||
child: (context, bloc, state) => FolderView(bloc),
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:filesize/filesize.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:jiffy/jiffy.dart';
|
|
||||||
|
|
||||||
import '../../../../../widget/centeredLeading.dart';
|
|
||||||
import '../../../../../widget/list_view_util.dart';
|
|
||||||
import '../../../infrastructure/loadableState/view/loadable_state_consumer.dart';
|
|
||||||
import '../bloc/files_bloc.dart';
|
|
||||||
import '../bloc/files_event.dart';
|
|
||||||
import '../bloc/files_state.dart';
|
|
||||||
|
|
||||||
class FolderView extends StatelessWidget {
|
|
||||||
final FilesBloc bloc;
|
|
||||||
const FolderView(this.bloc, {super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) => Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
leading: !bloc.canGoBack() ? null : IconButton(
|
|
||||||
icon: const Icon(Icons.arrow_back),
|
|
||||||
onPressed: () {
|
|
||||||
bloc.add(EnterFolder(bloc.goBackLocation()));
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
title: Text(bloc.getCurrentFolderName()),
|
|
||||||
|
|
||||||
actions: [
|
|
||||||
IconButton(onPressed: () {
|
|
||||||
log(bloc.innerState?.toJson().toString() ?? 'leer');
|
|
||||||
}, icon: const Icon(Icons.bug_report)),
|
|
||||||
IconButton(onPressed: () {
|
|
||||||
bloc.add(EnterFolder('/'));
|
|
||||||
}, icon: const Icon(Icons.home)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
body: LoadableStateConsumer<FilesBloc, FilesState>(
|
|
||||||
controllerByValue: bloc,
|
|
||||||
child: (state, loading) => ListViewUtil.fromList<File>(bloc.getVisibleFiles(), (file) => ListTile(
|
|
||||||
leading: CenteredLeading(Icon(file.isFolder ? Icons.folder : Icons.description_outlined)),
|
|
||||||
title: Text(file.name),
|
|
||||||
subtitle: file.isFolder
|
|
||||||
? Text('geändert ${Jiffy.parseFromDateTime(file.updatedAt ?? DateTime.now()).fromNow()}')
|
|
||||||
: Text('${filesize(file.size)}, ${Jiffy.parseFromDateTime(file.updatedAt ?? DateTime.now()).fromNow()}'),
|
|
||||||
trailing: Icon(file.isFolder ? Icons.arrow_right : null),
|
|
||||||
onTap: () {
|
|
||||||
log(file.path);
|
|
||||||
if(!file.isFolder) return;
|
|
||||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => FolderView(bloc)));
|
|
||||||
bloc.add(EnterFolder(file.path));
|
|
||||||
},
|
|
||||||
))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
@ -11,9 +11,7 @@ _$GradeAveragesStateImpl _$$GradeAveragesStateImplFromJson(
|
|||||||
_$GradeAveragesStateImpl(
|
_$GradeAveragesStateImpl(
|
||||||
gradingSystem: $enumDecode(
|
gradingSystem: $enumDecode(
|
||||||
_$GradeAveragesGradingSystemEnumMap, json['gradingSystem']),
|
_$GradeAveragesGradingSystemEnumMap, json['gradingSystem']),
|
||||||
grades: (json['grades'] as List<dynamic>)
|
grades: (json['grades'] as List<dynamic>).map((e) => e as int).toList(),
|
||||||
.map((e) => (e as num).toInt())
|
|
||||||
.toList(),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$GradeAveragesStateImplToJson(
|
Map<String, dynamic> _$$GradeAveragesStateImplToJson(
|
||||||
|
@ -26,7 +26,7 @@ _$HolidayImpl _$$HolidayImplFromJson(Map<String, dynamic> json) =>
|
|||||||
_$HolidayImpl(
|
_$HolidayImpl(
|
||||||
start: json['start'] as String,
|
start: json['start'] as String,
|
||||||
end: json['end'] as String,
|
end: json['end'] as String,
|
||||||
year: (json['year'] as num).toInt(),
|
year: json['year'] as int,
|
||||||
stateCode: json['stateCode'] as String,
|
stateCode: json['stateCode'] as String,
|
||||||
name: json['name'] as String,
|
name: json['name'] as String,
|
||||||
slug: json['slug'] as String,
|
slug: json['slug'] as String,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
import '../../../basis/dataloader/holiday_data_loader.dart';
|
import '../../../basis/dataloader/holiday_data_loader.dart';
|
||||||
import '../../../infrastructure/dataLoader/http_data_loader.dart';
|
import '../../../infrastructure/dataLoader/data_loader.dart';
|
||||||
import '../bloc/holidays_state.dart';
|
import '../bloc/holidays_state.dart';
|
||||||
|
|
||||||
class HolidaysGetHolidays extends HolidayDataLoader<List<Holiday>> {
|
class HolidaysGetHolidays extends HolidayDataLoader<List<Holiday>> {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
import '../../../infrastructure/dataLoader/http_data_loader.dart';
|
import '../../../infrastructure/dataLoader/data_loader.dart';
|
||||||
import '../../../basis/dataloader/mhsl_data_loader.dart';
|
import '../../../basis/dataloader/mhsl_data_loader.dart';
|
||||||
import '../bloc/marianum_message_state.dart';
|
import '../bloc/marianum_message_state.dart';
|
||||||
|
|
||||||
|
@ -8,6 +8,6 @@ class LightAppTheme {
|
|||||||
colorScheme: ColorScheme.fromSeed(seedColor: marianumRed),
|
colorScheme: ColorScheme.fromSeed(seedColor: marianumRed),
|
||||||
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
||||||
foregroundColor: Colors.white
|
foregroundColor: Colors.white
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import 'dart:typed_data';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:loader_overlay/loader_overlay.dart';
|
import 'package:loader_overlay/loader_overlay.dart';
|
||||||
import 'package:package_info/package_info.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:badges/badges.dart' as badges;
|
import 'package:badges/badges.dart' as badges;
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ class _ChatBubbleState extends State<ChatBubble> with SingleTickerProviderStateM
|
|||||||
emojis.EmojiPicker(
|
emojis.EmojiPicker(
|
||||||
config: emojis.Config(
|
config: emojis.Config(
|
||||||
height: 256,
|
height: 256,
|
||||||
swapCategoryAndBottomBar: true,
|
// swapCategoryAndBottomBar: true, // TODO this property is no longer supported, need to find an replacement
|
||||||
emojiViewConfig: emojis.EmojiViewConfig(
|
emojiViewConfig: emojis.EmojiViewConfig(
|
||||||
backgroundColor: Theme.of(context).canvasColor,
|
backgroundColor: Theme.of(context).canvasColor,
|
||||||
recentsLimit: 67,
|
recentsLimit: 67,
|
||||||
@ -148,7 +148,7 @@ class _ChatBubbleState extends State<ChatBubble> with SingleTickerProviderStateM
|
|||||||
),
|
),
|
||||||
searchViewConfig: emojis.SearchViewConfig(
|
searchViewConfig: emojis.SearchViewConfig(
|
||||||
backgroundColor: Theme.of(context).dividerColor,
|
backgroundColor: Theme.of(context).dividerColor,
|
||||||
buttonColor: Theme.of(context).dividerColor,
|
// buttonColor: Theme.of(context).dividerColor, // TODO property no longer supported
|
||||||
hintText: 'Suchen',
|
hintText: 'Suchen',
|
||||||
buttonIconColor: Colors.white,
|
buttonIconColor: Colors.white,
|
||||||
),
|
),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:jiffy/jiffy.dart';
|
import 'package:jiffy/jiffy.dart';
|
||||||
import 'package:package_info/package_info.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
124
pubspec.yaml
124
pubspec.yaml
@ -30,7 +30,7 @@ environment:
|
|||||||
# versions available, run `flutter pub outdated`.
|
# versions available, run `flutter pub outdated`.
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
#xml: ^6.2.2
|
intl: any
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
@ -39,86 +39,82 @@ dependencies:
|
|||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
animated_digit: ^3.2.3
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
async: ^2.11.0
|
||||||
cupertino_icons: ^1.0.2
|
badges: ^3.1.2
|
||||||
flutter_native_splash: ^2.2.14
|
better_open_file: ^3.6.5
|
||||||
flutter_login: ^5.0.0
|
bloc: ^9.0.0
|
||||||
|
bottom_sheet: ^4.0.4
|
||||||
bubble: ^1.2.1
|
bubble: ^1.2.1
|
||||||
http: ^1.1.0
|
cached_network_image: ^3.4.1
|
||||||
shared_preferences: ^2.0.15
|
connectivity_plus: ^6.1.2
|
||||||
provider: ^6.0.4
|
crypto: ^3.0.6
|
||||||
jiffy: ^6.1.0
|
cupertino_icons: ^1.0.8
|
||||||
json_annotation: ^4.8.1
|
device_info_plus: ^11.2.1
|
||||||
localstore: ^1.2.3
|
dio: ^4.0.6
|
||||||
intl: ^0.18.0
|
easy_debounce: ^2.0.3
|
||||||
nextcloud:
|
emoji_picker_flutter: ^4.3.0
|
||||||
git:
|
fast_rsa: ^3.7.1
|
||||||
url: https://github.com/provokateurin/nextcloud-neon
|
file_picker: ^8.1.7
|
||||||
path: packages/nextcloud
|
|
||||||
ref: 3683491a94670393e46cbc83ad85b994f7df7481
|
|
||||||
flutter_launcher_icons: ^0.13.1
|
|
||||||
pretty_json: ^2.0.0
|
|
||||||
cached_network_image: ^3.2.3
|
|
||||||
url_launcher: ^6.1.10
|
|
||||||
flutter_linkify: ^6.0.0
|
|
||||||
filesize: ^2.0.1
|
filesize: ^2.0.1
|
||||||
path_provider: ^2.0.13
|
firebase_core: ^3.10.1
|
||||||
better_open_file: ^3.6.4
|
firebase_in_app_messaging: ^0.8.1+1
|
||||||
|
firebase_messaging: ^15.2.1
|
||||||
flowder:
|
flowder:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/Harsh223/flowder.git
|
url: https://github.com/Harsh223/flowder.git
|
||||||
persistent_bottom_nav_bar_v2: ^5.0.0
|
flutter_app_badge: ^2.0.2
|
||||||
badges: ^3.0.2
|
flutter_bloc: ^9.0.0
|
||||||
image_picker: ^1.0.0
|
flutter_launcher_icons: ^0.14.3
|
||||||
file_picker: ^8.0.0+1
|
flutter_linkify: ^6.0.0
|
||||||
loader_overlay: ^4.0.0
|
flutter_local_notifications: ^18.0.1
|
||||||
crypto: ^3.0.3
|
flutter_login: ^5.0.0
|
||||||
package_info: ^2.0.2
|
flutter_native_splash: ^2.4.4
|
||||||
syncfusion_flutter_calendar: ^24.1.44
|
|
||||||
async: ^2.11.0
|
|
||||||
animated_digit: ^3.2.1
|
|
||||||
syncfusion_flutter_pdfviewer: ^24.1.44
|
|
||||||
photo_view: ^0.14.0
|
|
||||||
uuid: ^4.2.2
|
|
||||||
firebase_messaging: ^14.6.5
|
|
||||||
firebase_core: ^2.15.0
|
|
||||||
firebase_in_app_messaging: ^0.7.3+4
|
|
||||||
flutter_local_notifications: ^17.0.0
|
|
||||||
fast_rsa: ^3.6.1
|
|
||||||
share_plus: ^8.0.2
|
|
||||||
flutter_split_view: ^0.1.2
|
flutter_split_view: ^0.1.2
|
||||||
bottom_sheet: ^4.0.0
|
freezed_annotation: ^2.4.4
|
||||||
device_info_plus: ^9.0.3
|
http: ^1.3.0
|
||||||
flutter_app_badger: ^1.5.0
|
hydrated_bloc: ^10.0.0
|
||||||
|
image_picker: ^1.1.2
|
||||||
|
in_app_review: ^2.0.10
|
||||||
|
jiffy: ^6.2.1
|
||||||
|
json_annotation: ^4.9.0
|
||||||
|
loader_overlay: ^5.0.0
|
||||||
|
localstore: ^1.4.0
|
||||||
|
nextcloud:
|
||||||
|
git:
|
||||||
|
path: packages/nextcloud
|
||||||
|
ref: 3683491a94670393e46cbc83ad85b994f7df7481
|
||||||
|
url: https://github.com/provokateurin/nextcloud-neon
|
||||||
|
package_info_plus: ^8.1.3
|
||||||
|
path_provider: ^2.1.5
|
||||||
|
persistent_bottom_nav_bar_v2: ^5.3.1
|
||||||
|
photo_view: ^0.15.0
|
||||||
|
pretty_json: ^2.0.0
|
||||||
|
provider: ^6.1.2
|
||||||
qr_flutter: ^4.1.0
|
qr_flutter: ^4.1.0
|
||||||
easy_debounce: ^2.0.3
|
rrule: ^0.2.17
|
||||||
rrule_generator: ^0.7.0+1
|
rrule_generator: ^0.9.0
|
||||||
rrule: ^0.2.16
|
share_plus: ^10.1.4
|
||||||
time_range_picker: ^2.2.0
|
shared_preferences: ^2.3.5
|
||||||
in_app_review: ^2.0.8
|
syncfusion_flutter_calendar: ^28.1.41
|
||||||
emoji_picker_flutter: ^2.1.1
|
syncfusion_flutter_pdfviewer: ^28.1.41
|
||||||
bloc: ^8.1.4
|
time_range_picker: ^2.3.0
|
||||||
flutter_bloc: ^8.1.5
|
url_launcher: ^6.3.1
|
||||||
freezed_annotation: ^2.4.1
|
uuid: ^4.5.1
|
||||||
connectivity_plus: ^6.0.3
|
|
||||||
hydrated_bloc: ^9.1.5
|
|
||||||
dio: ^4.0.6
|
|
||||||
sorted: ^2.1.0
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
json_serializable: ^6.7.1
|
json_serializable: any
|
||||||
build_runner: ^2.4.9
|
build_runner: any
|
||||||
|
|
||||||
# The "flutter_lints" package below contains a set of recommended lints to
|
# The "flutter_lints" package below contains a set of recommended lints to
|
||||||
# encourage good coding practices. The lint set provided by the package is
|
# encourage good coding practices. The lint set provided by the package is
|
||||||
# activated in the `analysis_options.yaml` file located at the root of your
|
# activated in the `analysis_options.yaml` file located at the root of your
|
||||||
# package. See that file for information about deactivating specific lint
|
# package. See that file for information about deactivating specific lint
|
||||||
# rules and activating additional ones.
|
# rules and activating additional ones.
|
||||||
flutter_lints: ^3.0.1
|
flutter_lints: any
|
||||||
freezed: ^2.5.2
|
freezed: any
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
Reference in New Issue
Block a user