-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add settings page * fix: missed files * fix: remote old code * fix: remove box * fix: move settigns to operations page * fix: remove ugly button from home
- Loading branch information
1 parent
47bf735
commit 8d39eb1
Showing
10 changed files
with
323 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Miscellaneous | ||
.DS_Store |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:package_info_plus/package_info_plus.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:remote/status.dart'; | ||
import 'package:remote/urls.dart'; | ||
|
||
//create new stateful widget settings | ||
class Settings extends StatefulWidget { | ||
const Settings({Key? key}) : super(key: key); | ||
|
||
@override | ||
State<Settings> createState() => _SettingsState(); | ||
} | ||
|
||
class _SettingsState extends State<Settings> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
centerTitle: true, | ||
backgroundColor: const Color.fromARGB(255, 0, 0, 0), | ||
title: const Text('Settings'), | ||
), | ||
body: Consumer(builder: (context, layoutModel, child) { | ||
return ListView( children: [ | ||
ListTile( | ||
title: const Text("Status"), | ||
subtitle: const Text("View the current status of the server"), | ||
//on tap visit the status page | ||
onTap: () { | ||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => const Status())); | ||
}, | ||
), | ||
const Divider(), | ||
ListTile( | ||
title: const Text('Muxable Discord'), | ||
subtitle: const Text("Join the Muxable Discord!"), | ||
trailing: const Icon(Icons.launch), | ||
onTap: () => openUrl(Uri.parse("https://discord.gg/UKHJMQs74u")), | ||
), | ||
ListTile( | ||
title: const Text("Website"), | ||
subtitle: const Text("Get a browser source for OBS"), | ||
trailing: const Icon(Icons.launch), | ||
onTap: () => openUrl(Uri.parse("https://kit.rtirl.com")), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.all(16), | ||
child: Text("Thanks to all the early testers who sent bug reports!", | ||
style: TextStyle( | ||
color: Theme.of(context).colorScheme.secondary, | ||
fontWeight: FontWeight.bold, | ||
)), | ||
), | ||
Column( | ||
children: {"muxfd", "SputNikPlop"}.map((key) { | ||
final url = "https://twitch.tv/$key"; | ||
return ListTile( | ||
leading: const Image( | ||
width: 24, image: AssetImage('assets/providers/twitch.png')), | ||
title: Text("/$key"), | ||
trailing: const Icon(Icons.launch), | ||
onTap: () => openUrl(Uri.parse(url)), | ||
); | ||
}).toList()), | ||
FutureBuilder( | ||
future: PackageInfo.fromPlatform(), | ||
builder: (context, snapshot) { | ||
if (!snapshot.hasData) { | ||
return Container(); | ||
} | ||
final packageInfo = snapshot.data as PackageInfo; | ||
final appName = packageInfo.appName; | ||
final version = packageInfo.version; | ||
final buildNumber = packageInfo.buildNumber; | ||
return AboutListTile( | ||
icon: const Icon(Icons.info), | ||
applicationName: appName, | ||
applicationVersion: 'Version $version ($buildNumber)', | ||
applicationLegalese: '\u{a9} 2023 Muxable', | ||
dense: true, | ||
); | ||
}) | ||
],); | ||
},) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart' as customtabs; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
Future<void> openUrl(Uri url) async { | ||
if (!url.hasScheme) { | ||
await customtabs.launch(url.replace(scheme: 'http').toString()); | ||
} else if (url.isScheme("http") || url.isScheme("https")) { | ||
await customtabs.launch(url.toString()); | ||
} else { | ||
await launchUrl(url); | ||
} | ||
} |
Oops, something went wrong.