52 lines
1.9 KiB
Dart
52 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
import '../../../../state/app/modules/settings/bloc/settings_cubit.dart';
|
|
import '../../../../view/pages/timetable/data/timetable_name_mode.dart';
|
|
|
|
class TimetableSection extends StatelessWidget {
|
|
const TimetableSection({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final settings = context.watch<SettingsCubit>();
|
|
final timetableSettings = settings.val().timetableSettings;
|
|
return Column(
|
|
children: [
|
|
ListTile(
|
|
leading: const Icon(Icons.abc_outlined),
|
|
title: const Text('Fachbezeichnung'),
|
|
trailing: DropdownButton<TimetableNameMode>(
|
|
value: timetableSettings.timetableNameMode,
|
|
icon: const Icon(Icons.arrow_drop_down),
|
|
items: TimetableNameMode.values
|
|
.map((e) => DropdownMenuItem(
|
|
value: e,
|
|
enabled: e != timetableSettings.timetableNameMode,
|
|
child: Row(
|
|
children: [
|
|
Icon(TimetableNameModes.getDisplayOptions(e).icon),
|
|
const SizedBox(width: 10),
|
|
Text(TimetableNameModes.getDisplayOptions(e).displayName),
|
|
],
|
|
),
|
|
))
|
|
.toList(),
|
|
onChanged: (value) =>
|
|
settings.val(write: true).timetableSettings.timetableNameMode = value!,
|
|
),
|
|
),
|
|
ListTile(
|
|
leading: const Icon(Icons.calendar_view_day_outlined),
|
|
title: const Text('Doppelstunden zusammenhängend anzeigen'),
|
|
trailing: Checkbox(
|
|
value: timetableSettings.connectDoubleLessons,
|
|
onChanged: (e) =>
|
|
settings.val(write: true).timetableSettings.connectDoubleLessons = e!,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|