Add background images for games
This commit is contained in:
@@ -82,7 +82,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
onRefresh: _refreshGames,
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final cardWidth = constraints.maxWidth / 4;
|
||||
final cardWidth = constraints.maxWidth / 2;
|
||||
final cardHeight = (cardWidth * 215) / 400; // Maintain aspect ratio
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Wrap(
|
||||
@@ -91,7 +92,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
children: [
|
||||
...games.values.map(
|
||||
(game) => SizedBox(
|
||||
width: cardWidth - 10, // Subtract spacing to fit 4 cards
|
||||
width: cardWidth - 10, // Subtract spacing to fit 3 cards
|
||||
height: cardHeight - 10,
|
||||
child: GameCard(
|
||||
game: game,
|
||||
onGameUpdated: (game) async {
|
||||
@@ -110,7 +112,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: cardWidth - 10, // Subtract spacing to fit 4 cards
|
||||
width: cardWidth - 10, // Subtract spacing to fit 3 cards
|
||||
height: cardHeight - 10,
|
||||
child: NewGameCard(
|
||||
onGameCreated: (game) async {
|
||||
game = await GameRepository.upsert(game);
|
||||
|
Reference in New Issue
Block a user