Theme changes & settings navigation

This commit is contained in:
2025-06-23 23:55:25 +02:00
committed by mathiskirchner
parent c78a3ed171
commit 348b812f9c
4 changed files with 33 additions and 12 deletions

View File

@@ -14,9 +14,20 @@ class MyApp extends StatelessWidget {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Game Tracker',
themeMode: ThemeMode.dark,
darkTheme: ThemeData.dark(),
theme: ThemeData(appBarTheme: CustomTheme.appBarTheme),
themeMode: ThemeMode.dark, // forces light mode
theme: ThemeData(
primaryColor: CustomTheme.primaryColor,
scaffoldBackgroundColor: CustomTheme.backgroundColor,
appBarTheme: CustomTheme.appBarTheme,
colorScheme: ColorScheme.fromSeed(
seedColor: CustomTheme.primaryColor,
brightness: Brightness.dark,
).copyWith(surface: CustomTheme.backgroundColor),
),
home: const CustomNavigationBar(),
);
}

View File

@@ -3,6 +3,7 @@ import 'package:game_tracker/core/custom_theme.dart';
import 'package:game_tracker/presentation/views/main_menu/game_history_view.dart';
import 'package:game_tracker/presentation/views/main_menu/groups_view.dart';
import 'package:game_tracker/presentation/views/main_menu/home_view.dart';
import 'package:game_tracker/presentation/views/main_menu/settings_view.dart';
import 'package:game_tracker/presentation/views/main_menu/statistics_view.dart';
class CustomNavigationBar extends StatefulWidget {
@@ -22,12 +23,6 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
const StatisticsView(),
];
void onTabTapped(int index) {
setState(() {
currentIndex = index;
});
}
@override
void initState() {
super.initState();
@@ -39,7 +34,13 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
appBar: AppBar(
backgroundColor: CustomTheme.backgroundColor,
actions: [
IconButton(onPressed: () {}, icon: const Icon(Icons.settings)),
IconButton(
onPressed: () => Navigator.push(
context,
MaterialPageRoute(builder: (_) => const SettingsView()),
),
icon: const Icon(Icons.settings),
),
],
elevation: 0,
),
@@ -98,4 +99,10 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
),
);
}
void onTabTapped(int index) {
setState(() {
currentIndex = index;
});
}
}

View File

@@ -1,10 +1,13 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SettingsView extends StatelessWidget {
const SettingsView({super.key});
@override
Widget build(BuildContext context) {
return const Center(child: Text('Settings View'));
return Scaffold(
appBar: AppBar(title: const Text('Einstellungen')),
body: const Center(child: Text('Settings View')),
);
}
}

View File

@@ -1,7 +1,7 @@
name: game_tracker
description: "Game Tracking App for Card Games"
publish_to: 'none'
version: 0.0.1+18
version: 0.0.1+21
environment:
sdk: ^3.8.1