added game status

This commit is contained in:
2024-02-04 19:14:41 +05:30
parent eda5f77e2d
commit 494b27bf9e
16 changed files with 691 additions and 137 deletions

View File

@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
import 'package:rogapp/widgets/GameState/CheckinState.dart';
import 'package:rogapp/widgets/GameState/game_on_off.dart';
class DashboardWidget extends StatelessWidget {
final bool gameStarted;
final int locationsVisited;
final bool isMinimized;
const DashboardWidget({
Key? key,
required this.gameStarted,
required this.locationsVisited,
this.isMinimized = false,
}) : super(key: key);
@override
Widget build(BuildContext context) {
List<Widget> widgets = [
GameStatusIndicator(gameStarted: gameStarted, minimized: isMinimized),
SizedBox(
height: isMinimized ? 0 : 8, width: isMinimized ? 8 : 0), // Spacing
LocationVisitedWidget(count: locationsVisited, minimized: isMinimized),
];
return Container(
padding: EdgeInsets.all(isMinimized ? 8 : 16),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3),
),
],
borderRadius: BorderRadius.circular(10),
),
child: isMinimized
? Row(
mainAxisSize: MainAxisSize.min,
children: widgets,
)
: Column(
mainAxisSize: MainAxisSize.min,
children: widgets,
),
);
}
}