mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-28 09:38:08 +00:00
68 lines
2.1 KiB
Dart
68 lines
2.1 KiB
Dart
|
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
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
)
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|