mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 20:30:35 +00:00
Dhcp and dns settings optimizations
This commit is contained in:
parent
4c86727b5d
commit
5d23f3c3e7
8 changed files with 676 additions and 515 deletions
|
@ -1,5 +1,7 @@
|
|||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:animations/animations.dart';
|
||||
|
@ -30,6 +32,8 @@ class DhcpLeases extends StatelessWidget {
|
|||
final serversProvider = Provider.of<ServersProvider>(context);
|
||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||
|
||||
final width = MediaQuery.of(context).size.width;
|
||||
|
||||
void deleteLease(Lease lease) async {
|
||||
ProcessModal processModal = ProcessModal(context: context);
|
||||
processModal.open(AppLocalizations.of(context)!.deleting);
|
||||
|
@ -119,14 +123,26 @@ class DhcpLeases extends StatelessWidget {
|
|||
}
|
||||
|
||||
void openAddStaticLease() {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) => AddStaticLeaseModal(
|
||||
onConfirm: createLease
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
isScrollControlled: true
|
||||
);
|
||||
if (width > 900 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AddStaticLeaseModal(
|
||||
onConfirm: createLease,
|
||||
dialog: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) => AddStaticLeaseModal(
|
||||
onConfirm: createLease,
|
||||
dialog: false,
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
isScrollControlled: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue