Skip to content

Commit

Permalink
1.6.0 - Moving settings tab into the drawer (#101)
Browse files Browse the repository at this point in the history
* Moving settings page to the drawer

* Updating colors etc.

* showing a snackbar if there's no games to import from BGG

* Fixing styleing and text

* fixing an edge case when filtering

* switching colors for sorting games when selected/deselected

* updating bgg retry delay

* fixing spacing between players in stats
  • Loading branch information
mkieres authored Jun 26, 2022
1 parent b2d869e commit dfd829e
Show file tree
Hide file tree
Showing 26 changed files with 546 additions and 489 deletions.
8 changes: 6 additions & 2 deletions board_games_companion/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ import 'models/navigation/board_game_details_page_arguments.dart';
import 'models/navigation/edit_playthrough_page_arguments.dart';
import 'models/navigation/player_page_arguments.dart';
import 'models/navigation/playthroughs_page_arguments.dart';
import 'pages/about_page.dart';
import 'pages/about/about_page.dart';
import 'pages/board_game_details/board_game_details_page.dart';
import 'pages/board_game_details/board_game_details_view_model.dart';
import 'pages/edit_playthrough/edit_playthrough_page.dart';
import 'pages/edit_playthrough/edit_playthrouhg_view_model.dart';
import 'pages/home_page.dart';
import 'pages/home/home_page.dart';
import 'pages/players/player_page.dart';
import 'pages/players/players_view_model.dart';
import 'pages/playthroughs/playthroughs_page.dart';
import 'pages/playthroughs/playthroughs_view_model.dart';
import 'pages/settings/settings_page.dart';
import 'services/analytics_service.dart';
import 'services/board_games_geek_service.dart';
import 'services/preferences_service.dart';
Expand Down Expand Up @@ -124,6 +125,9 @@ class _BoardGamesCompanionAppState extends State<BoardGamesCompanionApp> {
AboutPage.pageRoute: (BuildContext _) {
return const AboutPage();
},
SettingsPage.pageRoute: (BuildContext _) {
return const SettingsPage();
},
},
);
}
Expand Down
30 changes: 19 additions & 11 deletions board_games_companion/lib/common/app_text.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
class AppText {
static const AddBoardGameTooltip = 'Add a board game';
static const AppTitle = 'Board Games Companion';
static const addBoardGameTooltip = 'Add a board game';
static const appTitle = 'Board Games Companion';

static const RateAndReview = 'Rate & Review';
static const Rate = 'Rate';
static const AskMeLater = 'Ask me later';
static const DontAskAgain = "Don't ask again";
static const rateAndReview = 'Rate & Review';
static const rate = 'Rate';
static const askMeLater = 'Ask me later';
static const aontAskAgain = "Don't ask again";

static const Cancel = 'Cancel';
static const Stop = 'Stop';
static const Delete = 'Delete';
static const Edit = 'Edit';
static const cancel = 'Cancel';
static const stop = 'Stop';
static const delete = 'Delete';
static const edit = 'Edit';
static const ok = 'OK';

static const playthroughsStatisticsPageLastWinnerSectionTitle = 'Last winner';
static const playthroughsStatisticsPageTopFiveSectionTitle = 'Top 5';
Expand Down Expand Up @@ -54,7 +55,7 @@ class AppText {
static const importCollectionsSucceeded = 'Your collection has been imported from BGG!';
static const importCollectionsButtonText = 'Import';
static const importCollectionsFailureMessage =
"Sorry, we've run into some problems with importing your collections from BGG. Please try again.";
"Sorry, we've run into some problems with importing your collections from BGG. Please try again later.";

static const importPlaysLoadingIndicator = 'Importing games from BGG...';
static const importPlaysSendReportViaEmailButtonText = 'Email Report';
Expand All @@ -63,6 +64,7 @@ class AppText {
static const importPlaysReportImportReportTitle = 'Import Report';
static const importPlaysReportImportedPlayersSectionTitle = 'Created players';
static const importPlaysReportImportErrorsSectionTitle = 'Import errors';
static const importPlaysReportNoPlaysToImportError = 'There were no plays to import';

static const logGameSuccessConfirmationSnackbarText = 'Your game has been logged!';
static const logGameFailureConfirmationSnackbarText =
Expand Down Expand Up @@ -102,4 +104,10 @@ class AppText {
static const playerPageSearchNoSearchResults =
'''It looks there's no players that match the search phrase ''';
static const playerPageSearchHintText = 'Search for players...';

static const aboutPageTitle = 'About';

static const settingsPageTitle = 'Settings';

static const drawerVersionFormat = 'Version %s';
}
6 changes: 6 additions & 0 deletions board_games_companion/lib/common/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ class AppTheme {
backgroundColor: primaryColorLight,
actionTextColor: accentColor,
),
dividerTheme: ThemeData.light().dividerTheme.copyWith(
color: AppTheme.accentColor,
space: 0.5,
thickness: 0.5,
),
iconTheme: ThemeData.light().iconTheme.copyWith(color: AppTheme.accentColor),
);
}
}
17 changes: 8 additions & 9 deletions board_games_companion/lib/mixins/import_collection.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import 'package:board_games_companion/common/app_text.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../common/app_text.dart';
import '../common/dimensions.dart';
import '../models/collection_import_result.dart';
import '../models/hive/user.dart';
import '../pages/home_page.dart';
import '../stores/board_games_store.dart';
import '../stores/user_store.dart';

Expand All @@ -26,7 +25,7 @@ mixin ImportCollection {
final user = User(name: username);
await userStore.addOrUpdateUser(user);

_showSuccessSnackBar();
_showSuccessSnackBar(context);
} else {
_showFailureSnackBar(context);
}
Expand All @@ -35,8 +34,8 @@ mixin ImportCollection {
}
}

void _showSuccessSnackBar() {
HomePage.homePageGlobalKey.currentState!.showSnackBar(
void _showSuccessSnackBar(BuildContext context) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
margin: Dimensions.snackbarMargin,
behavior: SnackBarBehavior.floating,
Expand All @@ -46,16 +45,16 @@ void _showSuccessSnackBar() {
}

void _showFailureSnackBar(BuildContext context) {
HomePage.homePageGlobalKey.currentState!.showSnackBar(
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
behavior: SnackBarBehavior.floating,
margin: Dimensions.snackbarMargin,
content: const Text(AppText.importCollectionsFailureMessage),
duration: const Duration(seconds: 8),
action: SnackBarAction(
label: 'OK',
label: AppText.ok,
onPressed: () {
HomePage.homePageGlobalKey.currentState
?.hideCurrentSnackBar(reason: SnackBarClosedReason.dismiss);
ScaffoldMessenger.of(context).hideCurrentSnackBar(reason: SnackBarClosedReason.dismiss);
},
),
),
Expand Down
Loading

0 comments on commit dfd829e

Please sign in to comment.