Added Timetable gesturedetection, removed Timetable "next" and "previous" buttons

This commit is contained in:
Elias Müller 2023-02-21 13:55:46 +01:00
parent 29dd96940b
commit 8357b07c7b
3 changed files with 51 additions and 85 deletions

View File

@ -1,31 +0,0 @@
// // GENERATED CODE - DO NOT MODIFY BY HAND
//
// part of 'cacheableFile.dart';
//
// // **************************************************************************
// // JsonSerializableGenerator
// // **************************************************************************
//
// CacheableFile _$CacheableFileFromJson(Map<String, dynamic> json) =>
// CacheableFile(
// json['path'] as String?,
// json['isDir'] as bool?,
// json['name'] as String?,
// json['mimeType'] as String?,
// json['size'] as int?,
// json['eTag'] as String?,
// json['cTime'] == null ? null : DateTime.parse(json['cTime'] as String),
// json['mTime'] == null ? null : DateTime.parse(json['mTime'] as String),
// );
//
// Map<String, dynamic> _$CacheableFileToJson(CacheableFile instance) =>
// <String, dynamic>{
// 'path': instance.path,
// 'isDir': instance.isDir,
// 'name': instance.name,
// 'mimeType': instance.mimeType,
// 'size': instance.size,
// 'eTag': instance.eTag,
// 'cTime': instance.cTime?.toIso8601String(),
// 'mTime': instance.mTime?.toIso8601String(),
// };

View File

@ -1,19 +0,0 @@
// // GENERATED CODE - DO NOT MODIFY BY HAND
//
// part of 'listFilesResponse.dart';
//
// // **************************************************************************
// // JsonSerializableGenerator
// // **************************************************************************
//
// ListFilesResponse _$ListFilesResponseFromJson(Map<String, dynamic> json) =>
// ListFilesResponse(
// (json['files'] as List<dynamic>)
// .map((e) => CacheableFile.fromJson(e as Map<String, dynamic>))
// .toSet(),
// );
//
// Map<String, dynamic> _$ListFilesResponseToJson(ListFilesResponse instance) =>
// <String, dynamic>{
// 'files': instance.files.map((e) => e.toJson()).toList(),
// };

View File

@ -33,11 +33,26 @@ class _TimetableState extends State<Timetable> {
TimetableProps timetable = Provider.of<TimetableProps>(context, listen: false); TimetableProps timetable = Provider.of<TimetableProps>(context, listen: false);
return Column( return Column(
children: [ children: [
Flexible( Expanded(
child: GestureDetector(
child: WeekView(value), child: WeekView(value),
onHorizontalDragEnd: (details) {
if(details.primaryVelocity! < 0) {
timetable.switchWeek();
} else {
timetable.switchWeek(previous: true);
}
},
),
), ),
Container( // Flexible(
// child:
// ),
Visibility(
visible: false,
child: Container(
padding: const EdgeInsets.only(top: 5, bottom: 5), padding: const EdgeInsets.only(top: 5, bottom: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
@ -72,6 +87,7 @@ class _TimetableState extends State<Timetable> {
) )
], ],
), ),
),
) )
], ],
); );