Move stuff around again
This commit is contained in:
parent
399d884681
commit
52c6fff445
151 changed files with 0 additions and 72 deletions
105
lib/home.dart
Normal file
105
lib/home.dart
Normal file
|
@ -0,0 +1,105 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:file_selector/file_selector.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:servermanager/Constants.dart';
|
||||
import 'package:servermanager/settings.dart';
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
Settings settings;
|
||||
HomePage({super.key, required this.settings});
|
||||
|
||||
@override
|
||||
HomePageState createState() => HomePageState(settings: settings);
|
||||
}
|
||||
|
||||
class HomePageState extends State<HomePage> {
|
||||
Settings settings = Settings();
|
||||
|
||||
HomePageState({required this.settings});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Conan Exiles Server Manager"),
|
||||
backgroundColor: Constants.TITLEBAR_COLOR),
|
||||
drawer: Drawer(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
DrawerHeader(
|
||||
child: Column(
|
||||
children: [
|
||||
Icon(Icons.computer),
|
||||
Text("Conan Exiles Server Manager")
|
||||
],
|
||||
)),
|
||||
Column(
|
||||
children: [
|
||||
ListTile(
|
||||
title: Text("S E R V E R"),
|
||||
leading: Icon(Icons.cloud),
|
||||
subtitle: Text("The game server!"),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, "/server");
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
]),
|
||||
)),
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
if (Platform.isLinux)
|
||||
ListTile(
|
||||
title: Text("Proton"),
|
||||
leading: Icon(CupertinoIcons.gear),
|
||||
subtitle: Text("Linux Proton"),
|
||||
onTap: () {
|
||||
if (settings.steamcmd_path.isNotEmpty) {
|
||||
Navigator.pushNamed(context, "/proton");
|
||||
}
|
||||
},
|
||||
), // Not yet implemented
|
||||
ListTile(
|
||||
title: Text("SteamCMD"),
|
||||
leading: Icon(Icons.comment_rounded),
|
||||
subtitle: settings.steamcmd_path.isEmpty
|
||||
? Text("Path Not Set")
|
||||
: Text(settings.steamcmd_path),
|
||||
onTap: () {
|
||||
if (settings.steamcmd_path.isNotEmpty) {
|
||||
Navigator.pushNamed(context, "/steamcmd");
|
||||
}
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text("Server Path"),
|
||||
leading: Icon(CupertinoIcons.folder),
|
||||
subtitle: settings.game_path.isEmpty
|
||||
? Text("Not Set")
|
||||
: Text(settings.game_path),
|
||||
onTap: () async {
|
||||
var path = await getDirectoryPath();
|
||||
setState(() {
|
||||
if (path != null && path.isNotEmpty) {
|
||||
settings.game_path = path;
|
||||
settings.steamcmd_path =
|
||||
"$path${Platform.pathSeparator}scmd";
|
||||
|
||||
Directory.current = Directory(settings.game_path);
|
||||
}
|
||||
});
|
||||
|
||||
await settings.Open();
|
||||
settings.Read();
|
||||
},
|
||||
)
|
||||
],
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue