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
68
lib/screens/home/server_status.dart
Normal file
68
lib/screens/home/server_status.dart
Normal file
|
@ -0,0 +1,68 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/home/status_box.dart';
|
||||
|
||||
import 'package:adguard_home_manager/models/server_status.dart';
|
||||
|
||||
class ServerStatus extends StatelessWidget {
|
||||
final ServerStatusData serverStatus;
|
||||
|
||||
const ServerStatus({
|
||||
Key? key,
|
||||
required this.serverStatus,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.serverStatus,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
height: 140,
|
||||
child: GridView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 10,
|
||||
mainAxisExtent: 65
|
||||
),
|
||||
children: [
|
||||
StatusBox(
|
||||
icon: Icons.filter_list_rounded,
|
||||
label: AppLocalizations.of(context)!.ruleFiltering,
|
||||
isEnabled: serverStatus.filteringEnabled
|
||||
),
|
||||
StatusBox(
|
||||
icon: Icons.vpn_lock_rounded,
|
||||
label: AppLocalizations.of(context)!.safeBrowsing,
|
||||
isEnabled: serverStatus.safeBrowsingEnabled
|
||||
),
|
||||
StatusBox(
|
||||
icon: Icons.block,
|
||||
label: AppLocalizations.of(context)!.parentalFiltering,
|
||||
isEnabled: serverStatus.parentalControlEnabled
|
||||
),
|
||||
StatusBox(
|
||||
icon: Icons.search_rounded,
|
||||
label: AppLocalizations.of(context)!.safeSearch,
|
||||
isEnabled: serverStatus.safeSearchEnabled
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue