Update LibAC version, add two new portfolio entries.
This commit is contained in:
parent
043b06dedc
commit
6c066564b9
8 changed files with 45 additions and 29 deletions
|
@ -3,12 +3,12 @@ import 'dart:convert';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:footer/footer.dart';
|
||||
import 'package:footer/footer_view.dart';
|
||||
import 'package:libac_flutter/nbt/NbtIo.dart';
|
||||
import 'package:libac_flutter/nbt/NbtUtils.dart';
|
||||
import 'package:libac_flutter/nbt/impl/CompoundTag.dart';
|
||||
import 'package:libac_flutter/nbt/impl/IntTag.dart';
|
||||
import 'package:libac_flutter/nbt/impl/StringTag.dart';
|
||||
import 'package:libac_flutter/utils/uuid/UUID.dart';
|
||||
import 'package:libac_dart/nbt/NbtIo.dart';
|
||||
import 'package:libac_dart/nbt/NbtUtils.dart';
|
||||
import 'package:libac_dart/nbt/impl/CompoundTag.dart';
|
||||
import 'package:libac_dart/nbt/impl/IntTag.dart';
|
||||
import 'package:libac_dart/nbt/impl/StringTag.dart';
|
||||
import 'package:libac_dart/utils/uuid/UUID.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:zontreck/Constants.dart';
|
||||
import 'package:zontreck/Packets.dart';
|
||||
|
@ -58,26 +58,26 @@ class User {
|
|||
|
||||
CompoundTag save() {
|
||||
CompoundTag tag = CompoundTag();
|
||||
NbtUtils.writeUUID(tag, "id", ID);
|
||||
tag.put("id", StringTag.valueOf(ID.toString()));
|
||||
tag.put("first", StringTag.valueOf(FirstName));
|
||||
tag.put("last", StringTag.valueOf(LastName));
|
||||
tag.put("rez", IntTag.valueOf(createdAt));
|
||||
tag.put("title", StringTag.valueOf(userTitle));
|
||||
NbtUtils.writeBoolean(tag, "active", active);
|
||||
NbtUtils.writeUUID(tag, "token", loginToken);
|
||||
tag.put("token", StringTag.valueOf(loginToken.toString()));
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
static User load(CompoundTag tag) {
|
||||
return User(
|
||||
ID: NbtUtils.readUUID(tag, "id"),
|
||||
ID: UUID.parse(tag.get("id")!.asString()),
|
||||
FirstName: tag.get("first")!.asString(),
|
||||
LastName: tag.get("last")!.asString(),
|
||||
createdAt: tag.get("rez")!.asInt(),
|
||||
userTitle: tag.get("title")!.asString(),
|
||||
active: NbtUtils.readBoolean(tag, "active"),
|
||||
loginToken: NbtUtils.readUUID(tag, "token"));
|
||||
loginToken: UUID.parse(tag.get("token")!.asString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ class OpenSimPageState extends State<OpenSimPage> {
|
|||
if (prefs.containsKey("settings")) {
|
||||
String encoded = prefs.getString("settings")!;
|
||||
CompoundTag tag = await NbtIo.readBase64String(encoded);
|
||||
if (tag.contains("user")) {
|
||||
if (tag.containsKey("user")) {
|
||||
settings.currentUser = User.load(tag.get("user") as CompoundTag);
|
||||
settings.loggedIn = true;
|
||||
}
|
||||
|
@ -256,7 +256,8 @@ class OpenSimPageState extends State<OpenSimPage> {
|
|||
context, "/opensim/register");
|
||||
didChangeDependencies();
|
||||
},
|
||||
child: const Text("Register Account"))
|
||||
child:
|
||||
const Text("Register Account"))
|
||||
],
|
||||
))
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue