Konstanten für Länge von Namen #170
@@ -3,7 +3,7 @@ class Constants {
|
|||||||
Constants._(); // Private constructor to prevent instantiation
|
Constants._(); // Private constructor to prevent instantiation
|
||||||
|
|
||||||
/// Minimum duration of all app skeletons
|
/// Minimum duration of all app skeletons
|
||||||
static const Duration minimumSkeletonDuration = Duration(milliseconds: 250);
|
static const Duration MINIMUM_SKELETON_DURATION = Duration(milliseconds: 250);
|
||||||
|
|
||||||
/// Maximum length for player names
|
/// Maximum length for player names
|
||||||
static const int MAX_PLAYER_NAME_LENGTH = 32;
|
static const int MAX_PLAYER_NAME_LENGTH = 32;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class _GroupsViewState extends State<GroupsView> {
|
|||||||
void loadGroups() {
|
void loadGroups() {
|
||||||
Future.wait([
|
Future.wait([
|
||||||
db.groupDao.getAllGroups(),
|
db.groupDao.getAllGroups(),
|
||||||
Future.delayed(Constants.minimumSkeletonDuration),
|
Future.delayed(Constants.MINIMUM_SKELETON_DURATION),
|
||||||
]).then((results) {
|
]).then((results) {
|
||||||
loadedGroups = results[0] as List<Group>;
|
loadedGroups = results[0] as List<Group>;
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class _HomeViewState extends State<HomeView> {
|
|||||||
db.matchDao.getMatchCount(),
|
db.matchDao.getMatchCount(),
|
||||||
db.groupDao.getGroupCount(),
|
db.groupDao.getGroupCount(),
|
||||||
db.matchDao.getAllMatches(),
|
db.matchDao.getAllMatches(),
|
||||||
Future.delayed(Constants.minimumSkeletonDuration),
|
Future.delayed(Constants.MINIMUM_SKELETON_DURATION),
|
||||||
]).then((results) {
|
]).then((results) {
|
||||||
matchCount = results[0] as int;
|
matchCount = results[0] as int;
|
||||||
groupCount = results[1] as int;
|
groupCount = results[1] as int;
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class _MatchViewState extends State<MatchView> {
|
|||||||
void loadGames() {
|
void loadGames() {
|
||||||
Future.wait([
|
Future.wait([
|
||||||
db.matchDao.getAllMatches(),
|
db.matchDao.getAllMatches(),
|
||||||
Future.delayed(Constants.minimumSkeletonDuration),
|
Future.delayed(Constants.MINIMUM_SKELETON_DURATION),
|
||||||
]).then((results) {
|
]).then((results) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class _StatisticsViewState extends State<StatisticsView> {
|
|||||||
Future.wait([
|
Future.wait([
|
||||||
db.matchDao.getAllMatches(),
|
db.matchDao.getAllMatches(),
|
||||||
db.playerDao.getAllPlayers(),
|
db.playerDao.getAllPlayers(),
|
||||||
Future.delayed(Constants.minimumSkeletonDuration),
|
Future.delayed(Constants.MINIMUM_SKELETON_DURATION),
|
||||||
]).then((results) async {
|
]).then((results) async {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
final matches = results[0] as List<Match>;
|
final matches = results[0] as List<Match>;
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ class _PlayerSelectionState extends State<PlayerSelection> {
|
|||||||
void loadPlayerList() {
|
void loadPlayerList() {
|
||||||
_allPlayersFuture = Future.wait([
|
_allPlayersFuture = Future.wait([
|
||||||
db.playerDao.getAllPlayers(),
|
db.playerDao.getAllPlayers(),
|
||||||
Future.delayed(Constants.minimumSkeletonDuration),
|
Future.delayed(Constants.MINIMUM_SKELETON_DURATION),
|
||||||
]).then((results) => results[0] as List<Player>);
|
]).then((results) => results[0] as List<Player>);
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_allPlayersFuture.then((loadedPlayers) {
|
_allPlayersFuture.then((loadedPlayers) {
|
||||||
|
|||||||
Reference in New Issue
Block a user