diff --git a/lib/globals.dart b/lib/globals.dart index e7c099b..c5a70e6 100644 --- a/lib/globals.dart +++ b/lib/globals.dart @@ -1,3 +1,3 @@ // lib/globals.dart -//const String apiurl = "https://api.dthpp.mercurio.moe"; -const String apiurl = "http://10.0.0.10:9134"; +const String apiurl = "https://api.dthpp.mercurio.moe"; +//const String apiurl = "http://10.0.0.10:9134"; diff --git a/lib/pages/home.dart b/lib/pages/home.dart index 0049f83..ff20d5a 100644 --- a/lib/pages/home.dart +++ b/lib/pages/home.dart @@ -40,12 +40,38 @@ class _HomePageState extends State { ); } + Future _showOpenSourceLicenses() async { + showDialog( + context: context, + builder: (BuildContext context) => AboutDialog( + applicationIcon: const Icon(Icons.code), + applicationLegalese: '© 2024 Thomas Bassi @ Defence Tech.', + applicationName: 'DTHPP', + applicationVersion: '#B22AF349A1', + children: [ + Padding( + padding: const EdgeInsets.only(top: 16.0), + child: Text( + "Do people even care about licenses? Is this ever going to be opened? Anywho, i hope you're enjoying the app and having fun on your break :D", + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w400), + ), + ), + ], + ), + ); + } + @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Ping Pong Tracker'), actions: [ + IconButton( + icon: Icon(Icons.info), + onPressed: _showOpenSourceLicenses, + tooltip: 'Open Source Licenses', + ), IconButton( icon: Icon(Icons.logout), onPressed: () => _logout(context), diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 724bb2a..54c4c8d 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,8 +5,10 @@ import FlutterMacOS import Foundation +import package_info import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/pubspec.yaml b/pubspec.yaml index 67df21a..7657d1d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,6 +14,7 @@ dependencies: shared_preferences: ^2.3.3 http: ^1.2.2 logger: ^2.5.0 + package_info: ^2.0.2 dev_dependencies: flutter_test: