Added flexibleBottomSheet for timetable details
This commit is contained in:
parent
ab2bead0b5
commit
35df3a50be
@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:bottom_sheet/bottom_sheet.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
@ -19,10 +20,10 @@ class AppointmentDetails {
|
||||
if(code == "irregular") return "Änderung: ";
|
||||
return code ?? "";
|
||||
}
|
||||
|
||||
static void show(BuildContext context, TimetableProps webuntisData, Appointment appointment) {
|
||||
GetTimetableResponseObject timetableData = appointment.id as GetTimetableResponseObject;
|
||||
|
||||
//GetTimetableResponseObject timetableData = webuntisData.getTimetableResponse.result.firstWhere((element) => element.id == timetableObject.id);
|
||||
GetSubjectsResponseObject subject;
|
||||
GetRoomsResponseObject room;
|
||||
|
||||
@ -38,25 +39,30 @@ class AppointmentDetails {
|
||||
room = GetRoomsResponseObject(0, "?", "Unbekannt", true, "?");
|
||||
}
|
||||
|
||||
showModalBottomSheet(context: context, builder: (context) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
showStickyFlexibleBottomSheet(
|
||||
minHeight: 0,
|
||||
initHeight: 0.4,
|
||||
maxHeight: 0.7,
|
||||
anchors: [0, 0.4, 0.7],
|
||||
isSafeArea: true,
|
||||
|
||||
maxHeaderHeight: 150,
|
||||
|
||||
context: context,
|
||||
headerBuilder: (context, bottomSheetOffset) => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 30),
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.info, color: appointment.color),
|
||||
const SizedBox(height: 10),
|
||||
Text("${_getEventPrefix(timetableData.code)}${subject.alternateName} - (${subject.longName})", style: const TextStyle(fontSize: 30)),
|
||||
Text("${Jiffy.parseFromDateTime(appointment.startTime).format(pattern: "HH:mm")} - ${Jiffy.parseFromDateTime(appointment.endTime).format(pattern: "HH:mm")}", style: const TextStyle(fontSize: 15)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: [
|
||||
bodyBuilder: (context, bottomSheetOffset) => SliverChildListDelegate(
|
||||
[
|
||||
ListTile(
|
||||
leading: const Icon(Icons.notifications_active),
|
||||
title: Text("Status: ${timetableData.code != null ? "Geändert" : "Regulär"}"),
|
||||
@ -95,8 +101,6 @@ class AppointmentDetails {
|
||||
DebugTile(context).jsonData(timetableData.toJson()),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
);
|
||||
}
|
||||
}
|
@ -56,7 +56,7 @@ dependencies:
|
||||
git:
|
||||
url: https://github.com/provokateurin/nextcloud-neon
|
||||
path: packages/nextcloud
|
||||
ref: ba151505ab7f9d4c356345625482e2b61ce460cb
|
||||
ref: 1d2f4703046f3bb4e5566758ed1ae5499c9006aa
|
||||
flutter_launcher_icons: ^0.13.1
|
||||
pretty_json: ^2.0.0
|
||||
cached_network_image: ^3.2.3
|
||||
@ -89,6 +89,7 @@ dependencies:
|
||||
fast_rsa: ^3.6.1
|
||||
share_plus: ^7.1.0
|
||||
flutter_split_view: ^0.1.2
|
||||
bottom_sheet: ^4.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
Loading…
x
Reference in New Issue
Block a user