mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-28 01:36:07 +00:00
Unlocked landscape orientation and small bugs fixed
This commit is contained in:
parent
fb9fbbd35e
commit
42f589793c
4 changed files with 33 additions and 27 deletions
|
@ -25,9 +25,6 @@ import 'package:adguard_home_manager/providers/servers_provider.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
SystemChrome.setPreferredOrientations(
|
|
||||||
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
|
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
|
||||||
setWindowMinSize(const Size(500, 500));
|
setWindowMinSize(const Size(500, 500));
|
||||||
|
|
|
@ -816,28 +816,30 @@ class _DhcpWidgetState extends State<DhcpWidget> {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Flexible(
|
||||||
mainAxisSize: MainAxisSize.max,
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisSize: MainAxisSize.max,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
Padding(
|
||||||
child: Text(
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
AppLocalizations.of(context)!.neededSelectInterface,
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
AppLocalizations.of(context)!.neededSelectInterface,
|
||||||
style: TextStyle(
|
textAlign: TextAlign.center,
|
||||||
fontSize: 22,
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.5)
|
fontSize: 22,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.5)
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 30),
|
||||||
const SizedBox(height: 30),
|
ElevatedButton(
|
||||||
ElevatedButton(
|
onPressed: selectInterface,
|
||||||
onPressed: selectInterface,
|
child: Text(AppLocalizations.of(context)!.selectInterface)
|
||||||
child: Text(AppLocalizations.of(context)!.selectInterface)
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -79,8 +79,10 @@ class _DnsSettingsWidgetState extends State<DnsSettingsWidget> {
|
||||||
final serversProvider = Provider.of<ServersProvider>(context);
|
final serversProvider = Provider.of<ServersProvider>(context);
|
||||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||||
|
|
||||||
|
final width = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
void navigate(Widget widget) {
|
void navigate(Widget widget) {
|
||||||
if (!(Platform.isAndroid || Platform.isIOS)) {
|
if (width > 900 || !(Platform.isAndroid || Platform.isIOS)) {
|
||||||
SplitView.of(context).push(widget);
|
SplitView.of(context).push(widget);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -87,9 +87,14 @@ class SettingsWidget extends StatelessWidget {
|
||||||
trailing: trailing,
|
trailing: trailing,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
appConfigProvider.setSelectedSettingsScreen(thisItem);
|
appConfigProvider.setSelectedSettingsScreen(thisItem);
|
||||||
Navigator.of(context).push(
|
if (!(Platform.isIOS || Platform.isAndroid)) {
|
||||||
MaterialPageRoute(builder: (context) => screenToNavigate)
|
SplitView.of(context).setSecondary(screenToNavigate);
|
||||||
);
|
}
|
||||||
|
else {
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(builder: (context) => screenToNavigate)
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue