74 lines
2.2 KiB
Dart
74 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'status_card.dart';
|
|
import '../../../product/extension/context_extension.dart';
|
|
import '../../../product/services/language_services.dart';
|
|
|
|
class OverviewCard extends StatelessWidget {
|
|
final bool isOwner;
|
|
final int total;
|
|
final int active;
|
|
final int inactive;
|
|
final int warning;
|
|
final int unused;
|
|
|
|
const OverviewCard(
|
|
{super.key,
|
|
required this.isOwner,
|
|
required this.total,
|
|
required this.active,
|
|
required this.inactive,
|
|
required this.warning,
|
|
required this.unused});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
elevation: 8,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
|
|
child: Padding(
|
|
padding: context.paddingNormal,
|
|
child: Column(
|
|
children: [
|
|
Text(
|
|
isOwner
|
|
? appLocalization(context).overview_message
|
|
: appLocalization(context).interfamily_page_name,
|
|
style: context.h2,
|
|
),
|
|
SizedBox(height: context.normalValue),
|
|
Column(
|
|
children: [
|
|
StatusCard(
|
|
label: appLocalization(context).total_nof_devices_message,
|
|
count: total,
|
|
color: Colors.blue,
|
|
),
|
|
StatusCard(
|
|
label: appLocalization(context).active_devices_message,
|
|
count: active,
|
|
color: Colors.green,
|
|
),
|
|
StatusCard(
|
|
label: appLocalization(context).inactive_devices_message,
|
|
count: inactive,
|
|
color: Colors.grey,
|
|
),
|
|
StatusCard(
|
|
label: appLocalization(context).warning_devices_message,
|
|
count: warning,
|
|
color: Colors.orange,
|
|
),
|
|
StatusCard(
|
|
label: appLocalization(context).unused_devices_message,
|
|
count: unused,
|
|
color: Colors.yellow,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|