3 Commits

Author SHA1 Message Date
4c479676d2 Added properties
Some checks failed
Pull Request Pipeline / test (pull_request) Successful in 39s
Pull Request Pipeline / lint (pull_request) Failing after 44s
2026-03-07 17:38:32 +01:00
4bcb10df81 Fix: Winner gets resetted, if player gets removed from the game 2026-03-07 17:03:52 +01:00
664af7ffee Updated dependencies 2026-03-07 16:51:37 +01:00
8 changed files with 42 additions and 22 deletions

View File

@@ -20,7 +20,5 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>13.0</string>
</dict>
</plist>

View File

@@ -2,12 +2,15 @@ import Flutter
import UIKit
@main
@objc class AppDelegate: FlutterAppDelegate {
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
}
}

View File

@@ -31,6 +31,27 @@
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneClassName</key>
<string>UIWindowScene</string>
<key>UISceneConfigurationName</key>
<string>flutter</string>
<key>UISceneDelegateClassName</key>
<string>FlutterSceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>

View File

@@ -141,7 +141,7 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
}
/// Returns the title of the current tab based on [currentIndex].
String _currentTabTitle(context) {
String _currentTabTitle(BuildContext context) {
final loc = AppLocalizations.of(context);
switch (currentIndex) {
case 0:

View File

@@ -282,6 +282,10 @@ class _CreateMatchViewState extends State<CreateMatchView> {
group: selectedGroup,
players: selectedPlayers,
game: tempGame,
winner: widget.match!.winner,
createdAt: widget.match!.createdAt,
endedAt: widget.match!.endedAt,
notes: widget.match!.notes,
);
if (widget.match!.name != updatedMatch.name) {
@@ -315,6 +319,9 @@ class _CreateMatchViewState extends State<CreateMatchView> {
matchId: widget.match!.id,
playerId: player.id,
);
if (widget.match!.winner?.id == player.id) {
updatedMatch.winner = null;
}
}
}

View File

@@ -40,15 +40,12 @@ class MatchDetailView extends StatefulWidget {
class _MatchDetailViewState extends State<MatchDetailView> {
late final AppDatabase db;
late Player? currentWinner;
late Match match;
@override
void initState() {
super.initState();
db = Provider.of<AppDatabase>(context, listen: false);
currentWinner = widget.match.winner;
match = widget.match;
}
@@ -184,7 +181,7 @@ class _MatchDetailViewState extends State<MatchDetailView> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
/// TODO: Implement different ruleset results display
if (currentWinner != null) ...[
if (match.winner != null) ...[
Text(
loc.winner,
style: const TextStyle(
@@ -193,13 +190,11 @@ class _MatchDetailViewState extends State<MatchDetailView> {
),
),
Text(
currentWinner!.name,
style: TextStyle(
match.winner!.name,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: match.winner != null
? CustomTheme.primaryColor
: CustomTheme.textColor,
color: CustomTheme.primaryColor,
),
),
] else ...[
@@ -239,7 +234,7 @@ class _MatchDetailViewState extends State<MatchDetailView> {
text: loc.enter_results,
icon: Icons.emoji_events,
onPressed: () async {
currentWinner = await Navigator.push(
match.winner = await Navigator.push(
context,
adaptivePageRoute(
fullscreenDialog: true,
@@ -252,7 +247,6 @@ class _MatchDetailViewState extends State<MatchDetailView> {
),
),
);
match.winner = currentWinner;
},
),
],
@@ -266,7 +260,7 @@ class _MatchDetailViewState extends State<MatchDetailView> {
/// Callback for when the match is updated in the edit view,
/// updates the match in this view
onMatchUpdated(editedMatch) {
void onMatchUpdated(Match editedMatch) {
setState(() {
match = editedMatch;
});

View File

@@ -47,10 +47,7 @@ class _AppSkeletonState extends State<AppSkeleton> {
: (Widget? currentChild, List<Widget> previousChildren) {
return Stack(
alignment: Alignment.topCenter,
children: [
...previousChildren,
if (currentChild != null) currentChild,
],
children: [...previousChildren, ?currentChild],
);
},
),

View File

@@ -34,7 +34,7 @@ dev_dependencies:
build_runner: ^2.5.4
dart_pubspec_licenses: ^3.0.14
drift_dev: ^2.27.0
flutter_lints: ^5.0.0
flutter_lints: ^6.0.0
flutter:
uses-material-design: true