Skip to content

Commit

Permalink
[timetable] try immersive timetable wallpaper
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Sep 23, 2024
1 parent f882621 commit f0da1ac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import 'package:mimir/school/i18n.dart' as $school;
import 'package:mimir/life/i18n.dart' as $life;
import 'package:mimir/game/i18n.dart' as $game;
import 'package:mimir/me/i18n.dart' as $me;
import 'package:mimir/timetable/p13n/entity/background.dart';
import 'package:mimir/timetable/widget/timetable/background.dart';

// import 'package:mimir/backend/forum/i18n.dart' as $forum;
import 'package:rettulf/rettulf.dart';
Expand Down Expand Up @@ -110,14 +112,30 @@ class _MainStagePageState extends ConsumerState<MainStagePage> {

@override
Widget build(BuildContext context) {
return buildBody();
return [
Positioned.fill(
child: ColoredBox(color: context.colorScheme.surface),
),
Positioned.fill(
child: TimetableBackground(
background: Settings.timetable.backgroundImage ?? BackgroundImage.disabled(),
),
),
buildBody(),
].stack();
}
Widget buildBody() {
final items = buildItems();
if (context.isPortrait) {
return Scaffold(
// backgroundColor: Colors.transparent,
body: widget.navigationShell,
bottomNavigationBar: buildNavigationBar(items),
);
} else {
return Scaffold(
// backgroundColor: Colors.transparent,
body: [
buildNavigationRail(items),
const VerticalDivider(),
Expand All @@ -129,6 +147,7 @@ class _MainStagePageState extends ConsumerState<MainStagePage> {

Widget buildNavigationBar(NavigationItems items) {
return NavigationBar(
// backgroundColor: context.colorScheme.surfaceContainer.withOpacity(0.6),
selectedIndex: getSelectedIndex(items),
onDestinationSelected: (index) => onItemTapped(index, items),
destinations: items.map((e) => e.item.toBarItem()).toList(),
Expand All @@ -137,6 +156,7 @@ class _MainStagePageState extends ConsumerState<MainStagePage> {

Widget buildNavigationRail(NavigationItems items) {
return NavigationRail(
// backgroundColor: context.colorScheme.surfaceContainer.withOpacity(0.6),
labelType: NavigationRailLabelType.all,
selectedIndex: getSelectedIndex(items),
onDestinationSelected: (index) => onItemTapped(index, items),
Expand Down
2 changes: 2 additions & 0 deletions lib/timetable/page/timetable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ class _TimetableBoardPageState extends ConsumerState<TimetableBoardPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
// backgroundColor: Colors.transparent,
resizeToAvoidBottomInset: false,
appBar: AppBar(
// backgroundColor: context.colorScheme.surface.withOpacity(0.6),
title: $currentPos >> (ctx, pos) => i18n.weekOrderedName(number: pos.weekIndex + 1).text(),
actions: [
buildSwitchViewButton(),
Expand Down

0 comments on commit f0da1ac

Please sign in to comment.