Update bundled LibAC-flutter
This commit is contained in:
parent
25f033dab4
commit
b56e9ca2db
5 changed files with 46 additions and 50 deletions
|
@ -1,4 +1,4 @@
|
||||||
class Constants {
|
class Constants {
|
||||||
static const VERSION = "1.0.031525+0137";
|
static const VERSION = "1.0.031525+0227";
|
||||||
static const APP_NAME = "BugVault";
|
static const APP_NAME = "BugVault";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,16 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:bugvault/Constants.dart';
|
|
||||||
import 'package:bugvault/FlutterConstants.dart';
|
import 'package:bugvault/FlutterConstants.dart';
|
||||||
import 'package:bugvault/SessionData.dart';
|
import 'package:bugvault/SessionData.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:libac_dart/nbt/NbtIo.dart';
|
import 'package:libac_dart/nbt/NbtIo.dart';
|
||||||
import 'package:libac_dart/nbt/impl/CompoundTag.dart';
|
import 'package:libac_dart/nbt/impl/CompoundTag.dart';
|
||||||
import 'package:libacflutter/Constants.dart';
|
import 'package:libacflutter/Constants.dart';
|
||||||
|
import 'package:libacflutter/TextFields.dart';
|
||||||
|
|
||||||
class BugVault extends StatefulWidget {
|
class BugVault extends StatefulWidget {
|
||||||
BugVault({super.key});
|
const BugVault({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() {
|
||||||
|
@ -31,7 +29,7 @@ class BugVaultLoader extends State<BugVault> {
|
||||||
}
|
}
|
||||||
|
|
||||||
class BugVaultLoadPage extends StatefulWidget {
|
class BugVaultLoadPage extends StatefulWidget {
|
||||||
BugVaultLoadPage({super.key});
|
const BugVaultLoadPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() {
|
||||||
|
@ -96,8 +94,9 @@ class BugVaultLoadPageState extends State<BugVaultLoadPage> {
|
||||||
g_ixState |= LoadStates.CONFIG_LOADED;
|
g_ixState |= LoadStates.CONFIG_LOADED;
|
||||||
SessionData.g_nbtConfiguration =
|
SessionData.g_nbtConfiguration =
|
||||||
await NbtIo.read("settings.dat") as CompoundTag;
|
await NbtIo.read("settings.dat") as CompoundTag;
|
||||||
} else
|
} else {
|
||||||
g_ixState |= LoadStates.NO_CONFIG;
|
g_ixState |= LoadStates.NO_CONFIG;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_dLoadProgress > 0.15 &&
|
if (g_dLoadProgress > 0.15 &&
|
||||||
|
@ -134,7 +133,12 @@ class BugVaultLoadPageState extends State<BugVaultLoadPage> {
|
||||||
"Your username on the server. Leave blank for anonymous access (if the server allows it)",
|
"Your username on the server. Leave blank for anonymous access (if the server allows it)",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
highlightTextField(USERNAME_CONTROLLER),
|
HighlightTextfield(
|
||||||
|
controller: USERNAME_CONTROLLER,
|
||||||
|
inputStyle: InputType.Text,
|
||||||
|
selected: FlutterConstants.INPUT_TEXTFIELD_SELECTED,
|
||||||
|
inactive: FlutterConstants.INPUT_TEXTFIELD_NOT_SELECTED,
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("URL"),
|
title: Text("URL"),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
|
@ -147,16 +151,25 @@ class BugVaultLoadPageState extends State<BugVaultLoadPage> {
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text("HOST / FQDN :"),
|
Text("HOST / FQDN :"),
|
||||||
Expanded(child: highlightTextField(URL_CONTROLLER)),
|
Expanded(
|
||||||
|
child: HighlightTextfield(
|
||||||
|
controller: URL_CONTROLLER,
|
||||||
|
inputStyle: InputType.Text,
|
||||||
|
selected: FlutterConstants.INPUT_TEXTFIELD_SELECTED,
|
||||||
|
inactive: FlutterConstants.INPUT_TEXTFIELD_NOT_SELECTED,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text("PORT :"),
|
Text("PORT :"),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: highlightTextField(
|
child: HighlightTextfield(
|
||||||
PORT_CONTROLLER,
|
controller: PORT_CONTROLLER,
|
||||||
keyboardType: TextInputType.number,
|
inputStyle: InputType.Number,
|
||||||
|
selected: FlutterConstants.INPUT_TEXTFIELD_SELECTED,
|
||||||
|
inactive: FlutterConstants.INPUT_TEXTFIELD_NOT_SELECTED,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -167,12 +180,21 @@ class BugVaultLoadPageState extends State<BugVaultLoadPage> {
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text("HOST / FQDN :"),
|
Text("HOST / FQDN :"),
|
||||||
Expanded(child: highlightTextField(URL_CONTROLLER)),
|
Expanded(
|
||||||
|
child: HighlightTextfield(
|
||||||
|
controller: URL_CONTROLLER,
|
||||||
|
inputStyle: InputType.Text,
|
||||||
|
selected: FlutterConstants.INPUT_TEXTFIELD_SELECTED,
|
||||||
|
inactive: FlutterConstants.INPUT_TEXTFIELD_NOT_SELECTED,
|
||||||
|
),
|
||||||
|
),
|
||||||
Text("PORT :"),
|
Text("PORT :"),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: highlightTextField(
|
child: HighlightTextfield(
|
||||||
PORT_CONTROLLER,
|
controller: PORT_CONTROLLER,
|
||||||
keyboardType: TextInputType.number,
|
inputStyle: InputType.Number,
|
||||||
|
selected: FlutterConstants.INPUT_TEXTFIELD_SELECTED,
|
||||||
|
inactive: FlutterConstants.INPUT_TEXTFIELD_NOT_SELECTED,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -187,34 +209,6 @@ class BugVaultLoadPageState extends State<BugVaultLoadPage> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget highlightTextField(
|
|
||||||
TextEditingController controller, {
|
|
||||||
TextInputType keyboardType = TextInputType.text,
|
|
||||||
}) {
|
|
||||||
return TextField(
|
|
||||||
controller: controller,
|
|
||||||
keyboardType: keyboardType,
|
|
||||||
inputFormatters: [
|
|
||||||
keyboardType == TextInputType.text
|
|
||||||
? FilteringTextInputFormatter.deny("")
|
|
||||||
: FilteringTextInputFormatter.digitsOnly,
|
|
||||||
],
|
|
||||||
|
|
||||||
decoration: InputDecoration(
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterConstants.INPUT_TEXTFIELD_SELECTED,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterConstants.INPUT_TEXTFIELD_NOT_SELECTED,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
|
@ -15,8 +15,9 @@ class BugVaultServer {
|
||||||
|
|
||||||
static Future<void> InstantiateSettings(CompoundTag ct) async {
|
static Future<void> InstantiateSettings(CompoundTag ct) async {
|
||||||
g_iPortNumber = ct.get("port")?.asInt() ?? 8372;
|
g_iPortNumber = ct.get("port")?.asInt() ?? 8372;
|
||||||
if (ct.containsKey("anonymous"))
|
if (ct.containsKey("anonymous")) {
|
||||||
g_bAllowAnonymousLogin = NbtUtils.readBoolean(ct, "anonymous");
|
g_bAllowAnonymousLogin = NbtUtils.readBoolean(ct, "anonymous");
|
||||||
|
}
|
||||||
|
|
||||||
await _loadUserDB();
|
await _loadUserDB();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,10 +29,11 @@ class DBUser {
|
||||||
late String TOTPSecret;
|
late String TOTPSecret;
|
||||||
|
|
||||||
DBUser({required this.sName, required this.ID, String? totp}) {
|
DBUser({required this.sName, required this.ID, String? totp}) {
|
||||||
if (totp == null)
|
if (totp == null) {
|
||||||
TOTPSecret = generateTOTPSecret();
|
TOTPSecret = generateTOTPSecret();
|
||||||
else
|
} else {
|
||||||
TOTPSecret = totp!;
|
TOTPSecret = totp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
factory DBUser.load({required CompoundTag serialized}) {
|
factory DBUser.load({required CompoundTag serialized}) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.031525+0137
|
version: 1.0.031525+0227
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.7.0
|
sdk: ^3.7.0
|
||||||
|
@ -36,7 +36,7 @@ dependencies:
|
||||||
cupertino_icons: ^1.0.8
|
cupertino_icons: ^1.0.8
|
||||||
libacflutter:
|
libacflutter:
|
||||||
hosted: https://git.zontreck.com/api/packages/Packages/pub/
|
hosted: https://git.zontreck.com/api/packages/Packages/pub/
|
||||||
version: 1.0.20325+1224
|
version: 1.0.031525+0222
|
||||||
libac_dart:
|
libac_dart:
|
||||||
hosted: https://git.zontreck.com/api/packages/Packages/pub/
|
hosted: https://git.zontreck.com/api/packages/Packages/pub/
|
||||||
version: 1.4.20325+1215
|
version: 1.4.20325+1215
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue