Fixed some coloring issues, respect color theme on file-viewer background, make file-viewer images rotatable
This commit is contained in:
parent
5f163fcffc
commit
731820d480
@ -10,10 +10,10 @@ class DarkAppTheme {
|
|||||||
colorScheme: const ColorScheme(
|
colorScheme: const ColorScheme(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
|
|
||||||
surface: Colors.black,
|
surface: Colors.black54,
|
||||||
onSurface: Colors.white,
|
onSurface: Colors.white,
|
||||||
|
|
||||||
primary: Colors.white,
|
primary: marianumRed,
|
||||||
onPrimary: Colors.white,
|
onPrimary: Colors.white,
|
||||||
|
|
||||||
secondary: Colors.grey,
|
secondary: Colors.grey,
|
||||||
|
@ -16,7 +16,7 @@ class Roomplan extends StatelessWidget {
|
|||||||
imageProvider: Image.asset("assets/img/raumplan.jpg").image,
|
imageProvider: Image.asset("assets/img/raumplan.jpg").image,
|
||||||
minScale: 0.5,
|
minScale: 0.5,
|
||||||
maxScale: 2.0,
|
maxScale: 2.0,
|
||||||
backgroundDecoration: const BoxDecoration(color: Colors.white60),
|
backgroundDecoration: BoxDecoration(color: Theme.of(context).colorScheme.surface),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
|
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||||
@ -102,7 +100,6 @@ class _TimetableState extends State<Timetable> {
|
|||||||
controller: controller,
|
controller: controller,
|
||||||
|
|
||||||
onViewChanged: (ViewChangedDetails details) {
|
onViewChanged: (ViewChangedDetails details) {
|
||||||
log(details.visibleDates.toString());
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||||
Provider.of<TimetableProps>(context, listen: false).updateWeek(details.visibleDates.first, details.visibleDates.last);
|
Provider.of<TimetableProps>(context, listen: false).updateWeek(details.visibleDates.first, details.visibleDates.last);
|
||||||
});
|
});
|
||||||
@ -112,7 +109,6 @@ class _TimetableState extends State<Timetable> {
|
|||||||
if(calendarTapDetails.appointments == null) return;
|
if(calendarTapDetails.appointments == null) return;
|
||||||
Appointment tapped = calendarTapDetails.appointments!.first;
|
Appointment tapped = calendarTapDetails.appointments!.first;
|
||||||
AppointmentDetails.show(context, value, tapped);
|
AppointmentDetails.show(context, value, tapped);
|
||||||
log(tapped.id.toString());
|
|
||||||
},
|
},
|
||||||
|
|
||||||
firstDayOfWeek: DateTime.monday,
|
firstDayOfWeek: DateTime.monday,
|
||||||
|
@ -11,7 +11,8 @@ import 'placeholderView.dart';
|
|||||||
class FileViewer extends StatelessWidget {
|
class FileViewer extends StatelessWidget {
|
||||||
final String path;
|
final String path;
|
||||||
final bool openExternal;
|
final bool openExternal;
|
||||||
const FileViewer({super.key, required this.path, this.openExternal = false});
|
final bool allowExternal;
|
||||||
|
const FileViewer({super.key, required this.path, this.openExternal = false, this.allowExternal = true});
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -19,15 +20,18 @@ class FileViewer extends StatelessWidget {
|
|||||||
AppBar appbar = AppBar(
|
AppBar appbar = AppBar(
|
||||||
title: Text(path.split("/").last),
|
title: Text(path.split("/").last),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(onPressed: () => ConfirmDialog(
|
Visibility(
|
||||||
|
visible: allowExternal,
|
||||||
|
child: IconButton(onPressed: () => ConfirmDialog(
|
||||||
title: "Extern öffnen",
|
title: "Extern öffnen",
|
||||||
content: "Möchtest du die Datei mit dem Systemdialog öffnen?",
|
content: "Möchtest du die Datei mit dem Systemdialog öffnen?",
|
||||||
onConfirm: () => Navigator.of(context).push(MaterialPageRoute(builder: (context) => FileViewer(path: path, openExternal: true))),
|
onConfirm: () => Navigator.of(context).push(MaterialPageRoute(builder: (context) => FileViewer(path: path, openExternal: true))),
|
||||||
confirmButton: "Öffnen",
|
confirmButton: "Öffnen",
|
||||||
).asDialog(context), icon: const Icon(Icons.open_in_new))
|
).asDialog(context), icon: const Icon(Icons.open_in_new)),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
switch(openExternal ? "x" : path.split(".").last) {
|
switch(openExternal ? "" : path.split(".").last) {
|
||||||
case "png":
|
case "png":
|
||||||
case "jpg":
|
case "jpg":
|
||||||
case "jpeg":
|
case "jpeg":
|
||||||
@ -36,7 +40,8 @@ class FileViewer extends StatelessWidget {
|
|||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
body: PhotoView(
|
body: PhotoView(
|
||||||
imageProvider: Image.file(File(path)).image,
|
imageProvider: Image.file(File(path)).image,
|
||||||
backgroundDecoration: const BoxDecoration(color: Colors.white60),
|
backgroundDecoration: BoxDecoration(color: Theme.of(context).colorScheme.surface),
|
||||||
|
enableRotation: true,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user