52 lines
1.4 KiB
Dart
52 lines
1.4 KiB
Dart
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,
|
|
),
|
|
);
|
|
}
|
|
}
|