Compare commits
3 Commits
a8ade294b5
...
2bd5c30094
| Author | SHA1 | Date | |
|---|---|---|---|
| 2bd5c30094 | |||
| e909f347e3 | |||
| 8e4fe26ad9 |
@@ -27,6 +27,9 @@ class CustomTheme {
|
|||||||
/// Text color used throughout the app
|
/// Text color used throughout the app
|
||||||
static const Color textColor = Color(0xFFFFFFFF);
|
static const Color textColor = Color(0xFFFFFFFF);
|
||||||
|
|
||||||
|
/// Text color used throughout the app
|
||||||
|
static const Color hintColor = Color(0xFF888888);
|
||||||
|
|
||||||
/// Background color for the navigation bar
|
/// Background color for the navigation bar
|
||||||
static const Color navBarBackgroundColor = Color(0xFF131313);
|
static const Color navBarBackgroundColor = Color(0xFF131313);
|
||||||
|
|
||||||
@@ -65,7 +68,7 @@ class CustomTheme {
|
|||||||
boxShadow: [BoxShadow(color: primaryColor.withAlpha(120), blurRadius: 12)],
|
boxShadow: [BoxShadow(color: primaryColor.withAlpha(120), blurRadius: 12)],
|
||||||
);
|
);
|
||||||
|
|
||||||
// ==================== App Bar Theme ====================
|
// ==================== Component Themes ====================
|
||||||
static const AppBarTheme appBarTheme = AppBarTheme(
|
static const AppBarTheme appBarTheme = AppBarTheme(
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
foregroundColor: textColor,
|
foregroundColor: textColor,
|
||||||
@@ -80,4 +83,23 @@ class CustomTheme {
|
|||||||
),
|
),
|
||||||
iconTheme: IconThemeData(color: textColor),
|
iconTheme: IconThemeData(color: textColor),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static const SearchBarThemeData searchBarTheme = SearchBarThemeData(
|
||||||
|
textStyle: WidgetStatePropertyAll(TextStyle(color: CustomTheme.textColor)),
|
||||||
|
hintStyle: WidgetStatePropertyAll(TextStyle(color: CustomTheme.hintColor)),
|
||||||
|
);
|
||||||
|
|
||||||
|
static final RadioThemeData radioTheme = RadioThemeData(
|
||||||
|
fillColor: WidgetStateProperty.resolveWith<Color>((states) {
|
||||||
|
if (states.contains(WidgetState.selected)) {
|
||||||
|
return CustomTheme.primaryColor;
|
||||||
|
}
|
||||||
|
return CustomTheme.textColor;
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
static const InputDecorationTheme inputDecorationTheme = InputDecorationTheme(
|
||||||
|
labelStyle: TextStyle(color: CustomTheme.textColor),
|
||||||
|
hintStyle: TextStyle(color: CustomTheme.hintColor),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,25 +29,25 @@ class GameTracker extends StatelessWidget {
|
|||||||
return supportedLocale;
|
return supportedLocale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return supportedLocales.firstWhere((locale) => locale.languageCode == 'en');
|
return supportedLocales.firstWhere(
|
||||||
|
(locale) => locale.languageCode == 'en',
|
||||||
|
);
|
||||||
},
|
},
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
onGenerateTitle: (context) => AppLocalizations.of(context).app_name,
|
onGenerateTitle: (context) => AppLocalizations.of(context).app_name,
|
||||||
themeMode: ThemeMode.dark, // forces dark mode
|
themeMode: ThemeMode.dark,
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
|
// main colors
|
||||||
primaryColor: CustomTheme.primaryColor,
|
primaryColor: CustomTheme.primaryColor,
|
||||||
scaffoldBackgroundColor: CustomTheme.backgroundColor,
|
scaffoldBackgroundColor: CustomTheme.backgroundColor,
|
||||||
|
// themes
|
||||||
appBarTheme: CustomTheme.appBarTheme,
|
appBarTheme: CustomTheme.appBarTheme,
|
||||||
radioTheme: RadioThemeData(
|
inputDecorationTheme: CustomTheme.inputDecorationTheme,
|
||||||
fillColor: WidgetStateProperty.resolveWith<Color>((states) {
|
searchBarTheme: CustomTheme.searchBarTheme,
|
||||||
if (states.contains(WidgetState.selected)) {
|
radioTheme: CustomTheme.radioTheme,
|
||||||
return CustomTheme.primaryColor;
|
// color scheme
|
||||||
}
|
|
||||||
return CustomTheme.textColor;
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
colorScheme: ColorScheme.fromSeed(
|
colorScheme: ColorScheme.fromSeed(
|
||||||
seedColor: CustomTheme.primaryColor,
|
seedColor: CustomTheme.textColor,
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
primary: CustomTheme.primaryColor,
|
primary: CustomTheme.primaryColor,
|
||||||
onPrimary: CustomTheme.textColor,
|
onPrimary: CustomTheme.textColor,
|
||||||
|
|||||||
@@ -252,6 +252,7 @@ class _MatchDetailViewState extends State<MatchDetailView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
match.winner = currentWinner;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -148,21 +148,4 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
}
|
}
|
||||||
widget.onWinnerChanged?.call();
|
widget.onWinnerChanged?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Retrieves all players associated with the given [match].
|
|
||||||
/// This includes players directly assigned to the match
|
|
||||||
/// as well as members of the group (if any).
|
|
||||||
/// The returned list is sorted alphabetically by player name.
|
|
||||||
List<Player> getAllPlayers(Match match) {
|
|
||||||
List<Player> players = [];
|
|
||||||
|
|
||||||
if (match.group == null) {
|
|
||||||
players = [...match.players];
|
|
||||||
} else {
|
|
||||||
players = [...match.players, ...match.group!.members];
|
|
||||||
}
|
|
||||||
|
|
||||||
players.sort((a, b) => a.name.compareTo(b.name));
|
|
||||||
return players;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ class CustomSearchBar extends StatelessWidget {
|
|||||||
constraints ?? const BoxConstraints(maxHeight: 45, minHeight: 45),
|
constraints ?? const BoxConstraints(maxHeight: 45, minHeight: 45),
|
||||||
hintText: hintText,
|
hintText: hintText,
|
||||||
onChanged: onChanged,
|
onChanged: onChanged,
|
||||||
hintStyle: WidgetStateProperty.all(const TextStyle(fontSize: 16)),
|
|
||||||
leading: const Icon(Icons.search),
|
leading: const Icon(Icons.search),
|
||||||
trailing: [
|
trailing: [
|
||||||
Visibility(
|
Visibility(
|
||||||
|
|||||||
Reference in New Issue
Block a user