mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 12:24:47 +00:00
Added server status
This commit is contained in:
parent
4ab8ff760c
commit
b16a1a2a0e
11 changed files with 321 additions and 35 deletions
47
lib/screens/home/status_box.dart
Normal file
47
lib/screens/home/status_box.dart
Normal file
|
@ -0,0 +1,47 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class StatusBox extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String label;
|
||||
final bool isEnabled;
|
||||
|
||||
const StatusBox({
|
||||
Key? key,
|
||||
required this.icon,
|
||||
required this.label,
|
||||
required this.isEnabled
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final width = MediaQuery.of(context).size.width;
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
width: double.maxFinite,
|
||||
height: double.maxFinite,
|
||||
decoration: BoxDecoration(
|
||||
color: isEnabled == true
|
||||
? Colors.green
|
||||
: Colors.red,
|
||||
borderRadius: BorderRadius.circular(10)
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
color: Colors.white,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue