feat: secure home credentials
This commit is contained in:
@@ -33,9 +33,7 @@ class _StatsScreenState extends ConsumerState<StatsScreen> {
|
||||
final groups = (stats['groups'] as List<dynamic>?) ?? [];
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('СТАТИСТИКА'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('СТАТИСТИКА')),
|
||||
body: Column(
|
||||
children: [
|
||||
// ─── Переключатель периода ───
|
||||
@@ -70,26 +68,26 @@ class _StatsScreenState extends ConsumerState<StatsScreen> {
|
||||
child: CircularProgressIndicator(color: Colors.deepOrange),
|
||||
)
|
||||
: groups.isEmpty
|
||||
? const Center(
|
||||
child: Text(
|
||||
'Нет данных',
|
||||
style: TextStyle(color: Colors.white54),
|
||||
),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
color: Colors.deepOrange,
|
||||
onRefresh: _load,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.all(12),
|
||||
itemCount: groups.length,
|
||||
itemBuilder: (context, index) {
|
||||
final g = groups[index];
|
||||
return _StatsCard(data: g is Map
|
||||
? Map<String, dynamic>.from(g)
|
||||
: {});
|
||||
},
|
||||
),
|
||||
),
|
||||
? const Center(
|
||||
child: Text(
|
||||
'Нет данных',
|
||||
style: TextStyle(color: Colors.white54),
|
||||
),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
color: Colors.deepOrange,
|
||||
onRefresh: _load,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.all(12),
|
||||
itemCount: groups.length,
|
||||
itemBuilder: (context, index) {
|
||||
final g = groups[index];
|
||||
return _StatsCard(
|
||||
data: g is Map ? Map<String, dynamic>.from(g) : {},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -105,7 +103,8 @@ class _StatsCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final targetId = (data['target_id'] ?? data['group_id'] ?? data['id'] ?? '').toString();
|
||||
final targetId = (data['target_id'] ?? data['group_id'] ?? data['id'] ?? '')
|
||||
.toString();
|
||||
final name = (data['name'] ?? targetId).toString();
|
||||
final totalCommands = data['total_commands'] ?? 0;
|
||||
final togglesOn = data['toggles_on'] ?? 0;
|
||||
@@ -121,10 +120,7 @@ class _StatsCard extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
name,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_StatRow(
|
||||
|
||||
Reference in New Issue
Block a user