croupier: Show the player avatar in the drawer and home screen
Also fixes a bug where you can't change the player's name
Change-Id: I50903522b1150d5c0836ba3d9d1e88ab5f16d588
diff --git a/lib/components/croupier.dart b/lib/components/croupier.dart
index 71c59e1..bb7506a 100644
--- a/lib/components/croupier.dart
+++ b/lib/components/croupier.dart
@@ -49,7 +49,11 @@
new FlatButton(
child: new Text('Join Game', style: style.Text.titleStyle),
onPressed: makeSetStateCallback(
- logic_croupier.CroupierState.JoinGame))
+ logic_croupier.CroupierState.JoinGame)),
+ new CroupierProfileComponent(
+ settings: config.croupier.settings,
+ width: style.Size.settingsSize,
+ height: style.Size.settingsSize)
]));
case logic_croupier.CroupierState.ChooseGame:
// in which we let them pick a game out of the many possible games... There aren't that many.
@@ -131,7 +135,7 @@
// shown if the person has not sat down yet.
Widget _buildPlayerProfiles(bool needsArrangement) {
List<Widget> profileWidgets = new List<Widget>();
- double size = 125.0;
+ double size = style.Size.settingsSize;
config.croupier.players_found.forEach((int userID, int playerNumber) {
if (!needsArrangement || playerNumber == null) {
CroupierSettings cs = config.croupier.settings_everyone[userID];
diff --git a/lib/components/croupier_settings.dart b/lib/components/croupier_settings.dart
index 93181a2..1a7b78f 100644
--- a/lib/components/croupier_settings.dart
+++ b/lib/components/croupier_settings.dart
@@ -123,7 +123,7 @@
Navigator.pop(context);
}),
new FlatButton(child: new Text('SAVE'), onPressed: () {
- Navigator.pop(context);
+ Navigator.pop(context, _tempData[type]);
}),
]);
break;
diff --git a/lib/components/main_route.dart b/lib/components/main_route.dart
index 736561f..7db8c8c 100644
--- a/lib/components/main_route.dart
+++ b/lib/components/main_route.dart
@@ -7,6 +7,7 @@
import '../logic/croupier.dart' show Croupier;
import '../styles/common.dart' as style;
import 'croupier.dart' show CroupierComponent;
+import 'croupier_profile.dart' show CroupierProfileComponent;
final GlobalKey _scaffoldKey = new GlobalKey();
@@ -74,7 +75,13 @@
return new Drawer(
child: new Block(<Widget>[
new DrawerHeader(
- child: new Text('Croupier', style: style.Text.titleStyle)),
+ child: new BlockBody([
+ new CroupierProfileComponent(
+ settings: config.croupier.settings,
+ width: style.Size.settingsSize,
+ height: style.Size.settingsSize),
+ new Text('Croupier', style: style.Text.titleStyle)
+ ])),
new DrawerItem(
icon: 'action/settings',
// TODO(alexfandrianto): Fix the Splash Screen, and we won't need
diff --git a/lib/styles/common.dart b/lib/styles/common.dart
index b2ee9ed..894dcc5 100644
--- a/lib/styles/common.dart
+++ b/lib/styles/common.dart
@@ -25,6 +25,7 @@
class Size {
static const double splashLogo = 75.0;
+ static const double settingsSize = 125.0;
}
class Spacing {