Adds a logout button and script

This commit is contained in:
zontreck 2024-05-16 03:52:45 -07:00
parent 0982ffb504
commit a4ec368d4a
5 changed files with 33 additions and 21 deletions

View file

@ -8,7 +8,7 @@ class Constants {
static const DRAWER_COLOR = Color.fromARGB(148, 0, 97, 97);
static const PORTFOLIO_CARD_COLOR = Color.fromARGB(255, 0, 71, 97);
static const VERSION = "Version 1.0.051624.0201";
static const VERSION = "Version 1.0.051624.0352";
static const COPYRIGHT = "Copyright 2024 - Tara Piccari. All rights Reserved";
static const CLIENTPSK =
"f5c6caf3efe1ec5aa4b7c572f92aa14782b7be34b4c7844fa9c6d47fdf94246";

View file

@ -11,6 +11,7 @@ enum APIEndpoint {
Ping(script: "Ping.php", path: "/ac/home/supports/"),
Setup(script: "Setup.php", path: "/ac/home/supports/"),
Register(script: "Register.php", path: "/ac/home/supports/"),
Logout(script: "Logout.php", path: "/ac/home/supports/"),
Login(script: "Login.php", path: "/ac/home/supports/");
final String script;

View file

@ -113,12 +113,24 @@ class OpenSimPageState extends State<OpenSimPage> {
),
),
ListTile(
title: Text(settings.loggedIn
? "Welcome, ${settings.displayName}"
: "You are not currently logged in"),
title: Text(
settings.loggedIn
? "Welcome, ${settings.displayName}"
: "You are not currently logged in",
),
),
settings.loggedIn
? SizedBox()
? Column(
children: [
ElevatedButton(
onPressed: () async {
settings.loggedIn = false;
await settings.sendPacketToEndpoint(
APIEndpoint.Logout, NullPacket());
},
child: Text("LOGOUT"))
],
)
: Center(
child: Row(
children: [