1 Commits

Author SHA1 Message Date
ad04a6317b Make game name selectable 2025-04-04 13:46:05 +02:00

View File

@@ -183,7 +183,10 @@ class _GameCardState extends State<GameCard>
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
child: Opacity( child: Opacity(
opacity: 0.4, opacity: 0.4,
child: Image.memory(widget.game.imageData!, fit: BoxFit.cover), child: Image.memory(
widget.game.imageData!,
fit: BoxFit.cover,
),
), ),
), ),
), ),
@@ -205,7 +208,10 @@ class _GameCardState extends State<GameCard>
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0), padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 24.0,
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -215,17 +221,29 @@ class _GameCardState extends State<GameCard>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
child: TextField( child:
controller: _nameController, widget.isNameEditable
focusNode: _nameFocus, ? TextField(
style: Theme.of(context).textTheme.titleLarge controller: _nameController,
?.copyWith(color: hasImage ? Colors.white : null), focusNode: _nameFocus,
enabled: widget.isNameEditable, style: Theme.of(
decoration: const InputDecoration.collapsed( context,
hintText: 'New Game', ).textTheme.titleLarge?.copyWith(
), color: hasImage ? Colors.white : null,
onSubmitted: (_) => _nameFocus.unfocus(), ),
), decoration: const InputDecoration.collapsed(
hintText: 'New Game',
),
onSubmitted: (_) => _nameFocus.unfocus(),
)
: SelectableText(
widget.game.name,
style: Theme.of(
context,
).textTheme.titleLarge?.copyWith(
color: hasImage ? Colors.white : null,
),
),
), ),
Row( Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,