Add a portfolio entry for NBT Editor, and update all dependencies.
This commit is contained in:
parent
9e5ab72b94
commit
071a5ccea4
37 changed files with 247 additions and 117 deletions
2
android/.gitignore
vendored
2
android/.gitignore
vendored
|
@ -7,7 +7,7 @@ gradle-wrapper.jar
|
|||
GeneratedPluginRegistrant.java
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
# See https://flutter.dev/to/reference-keystore
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
|
|
|
@ -1,67 +1,44 @@
|
|||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "com.example.zontreck"
|
||||
compileSdk flutter.compileSdkVersion
|
||||
ndkVersion flutter.ndkVersion
|
||||
namespace = "dev.zontreck.zontreck"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
jvmTarget = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.example.zontreck"
|
||||
applicationId = "dev.zontreck.zontreck"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
signingConfig = signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
source = "../.."
|
||||
}
|
||||
|
||||
dependencies {}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
|
@ -31,7 +32,7 @@
|
|||
android:value="2" />
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility?hl=en and
|
||||
https://developer.android.com/training/package-visibility and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.example.zontreck
|
||||
package dev.zontreck.zontreck
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
|
@ -5,12 +5,12 @@ allprojects {
|
|||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
rootProject.buildDir = "../build"
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register("clean", Delete) {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
org.gradle.jvmargs=-Xmx4G
|
||||
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
|
|
|
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
|
||||
|
|
|
@ -5,10 +5,9 @@ pluginManagement {
|
|||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
return flutterSdkPath
|
||||
}
|
||||
settings.ext.flutterSdkPath = flutterSdkPath()
|
||||
}()
|
||||
|
||||
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
|
@ -19,8 +18,8 @@ pluginManagement {
|
|||
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "7.3.0" apply false
|
||||
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
|
||||
id "com.android.application" version "8.1.0" apply false
|
||||
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
||||
|
|
BIN
images/nbteditor_icon.png
Normal file
BIN
images/nbteditor_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 MiB |
BIN
images/nbteditor_menu.png
Normal file
BIN
images/nbteditor_menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
BIN
images/nbteditor_snbt.png
Normal file
BIN
images/nbteditor_snbt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
BIN
images/nbteditor_tagdisplay.png
Normal file
BIN
images/nbteditor_tagdisplay.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 101 KiB |
|
@ -368,7 +368,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
@ -384,7 +384,7 @@
|
|||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
|
@ -401,7 +401,7 @@
|
|||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
|
@ -416,7 +416,7 @@
|
|||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
|
@ -547,7 +547,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
|
@ -569,7 +569,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import UIKit
|
||||
import Flutter
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
|
|
|
@ -8,9 +8,9 @@ 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.082424+0827";
|
||||
static const VERSION = "Version 1.0.013025+2009";
|
||||
static const COPYRIGHT =
|
||||
"Copyright 2024 - Piccari Creations. All rights Reserved";
|
||||
"Copyright 2024-2025 - Piccari Creations. All rights Reserved";
|
||||
static const CLIENTPSK =
|
||||
"f5c6caf3efe1ec5aa4b7c572f92aa14782b7be34b4c7844fa9c6d47fdf94246";
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import 'package:zontreck/pages/OpenSim.dart';
|
|||
import 'package:zontreck/pages/Portfolio.dart';
|
||||
import 'package:zontreck/pages/RegisterAccount.dart';
|
||||
import 'package:zontreck/pages/libac.dart';
|
||||
import 'package:zontreck/pages/nbt/NBTEditor.dart';
|
||||
|
||||
class MainPage extends StatelessWidget {
|
||||
const MainPage({super.key});
|
||||
|
@ -22,7 +23,8 @@ class MainPage extends StatelessWidget {
|
|||
"/opensim/login": (context) => const LoginAccountPage(),
|
||||
"/portfolio": (context) => const PortfolioPage(),
|
||||
"/portfolio/coun": (context) => const CardsOfUtterNonsense(),
|
||||
"/portfolio/libac": (context) => const LibACAbout()
|
||||
"/portfolio/libac": (context) => const LibACAbout(),
|
||||
"/portfolio/nbteditor": (context) => AboutNBTEditor()
|
||||
},
|
||||
theme: ThemeData.dark(),
|
||||
);
|
||||
|
|
|
@ -37,7 +37,7 @@ class PortfolioPage extends StatelessWidget {
|
|||
PortfolioEntry(
|
||||
title: const Text("Zontreck.com"),
|
||||
body: const Text(
|
||||
("This website, which is written entirely in Flutter, with some supporting API files in PHP")),
|
||||
("Hey! It's me! Written entirely in Flutter, with some supporting API files in PHP")),
|
||||
onTap: () {}),
|
||||
PortfolioEntry(
|
||||
title: const Text("Minecraft Modding"),
|
||||
|
@ -55,7 +55,10 @@ class PortfolioPage extends StatelessWidget {
|
|||
title: const Text("NBT Editor"),
|
||||
body: const Text(
|
||||
"This utilizes the NBT implementation in LibAC. It's a Named Binary Tag editor written entirely in dart or flutter."),
|
||||
onTap: () {})
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context, "/portfolio/nbteditor");
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
120
lib/pages/nbt/NBTEditor.dart
Normal file
120
lib/pages/nbt/NBTEditor.dart
Normal file
|
@ -0,0 +1,120 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:libac_dart/nbt/SnbtIo.dart';
|
||||
import 'package:libac_dart/nbt/impl/CompoundTag.dart';
|
||||
import 'package:libac_dart/nbt/impl/IntTag.dart';
|
||||
import 'package:libac_dart/nbt/impl/ShortTag.dart';
|
||||
import 'package:libac_dart/nbt/impl/StringTag.dart';
|
||||
import 'package:zontreck/Constants.dart';
|
||||
|
||||
class AboutNBTEditor extends StatelessWidget {
|
||||
TextStyle style = TextStyle(fontSize: 18);
|
||||
CompoundTag ct = CompoundTag();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (ct.isEmpty) {
|
||||
ct.put("sample", ShortTag.valueOf(4));
|
||||
CompoundTag ct2 = CompoundTag();
|
||||
ct2.put("intTest", IntTag.valueOf(8891));
|
||||
ct2.put("name", StringTag.valueOf("str"));
|
||||
ct.put("sample_nested", ct2);
|
||||
}
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Project: Named Binary Tag Editor"),
|
||||
backgroundColor: Constants.TITLEBAR_COLOR),
|
||||
body: Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 600,
|
||||
child: ListTile(
|
||||
title: Text("About the NBT Editor"),
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
"images/nbteditor_icon.png",
|
||||
width: 128,
|
||||
height: 128,
|
||||
)
|
||||
],
|
||||
),
|
||||
Text(
|
||||
"This editor began out of a need for being able to edit NBT data on a Linux system. I could not find a single editor for Linux. All of them required either outdated versions of Java and were unmaintained with poor interfaces, or required Wine and were barely even usable, if at all.",
|
||||
style: style,
|
||||
),
|
||||
Text(
|
||||
"As I explore my options, I decided on one thing: Cross Platform. You see, every editor up to this point was designed with one platform in mind, Windows. I wanted mine to be independent of all platforms.",
|
||||
style: style,
|
||||
),
|
||||
Text(
|
||||
"How did I accomplish this though?",
|
||||
style: style,
|
||||
),
|
||||
Text(
|
||||
"That answer is simple. I decided on Flutter. It has a programming language that was easy to pick up. One code base for all platforms, and on top of all of that, the language is similar to others I already knew. I was sold. So i began to learn the ins and outs of Dart. I quickly discovered however, that no NBT Library existed for Dart.. This would be a problem. So, to solve this problem, I created a brand new NBT library. I designed it based upon my knowledge and experience of coding Minecraft Mods. I knew how i expected the API to work, so i based it upon that. Now to make a Compound Tag, it is literally as simple as `CompoundTag ct = CompoundTag()`. The difference here between my implementation and Mojang's is significant, but the usage of the API is near identical. You just leave out the 'new' keyword as Dart does not require it.",
|
||||
style: style,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Text(
|
||||
"So, next we come across the first significant hurdle in this entire project. Java's implementation of UUIDs. NBT allows serializing a UUID and deserializing it using helper methods. If my implementation was to be truely compatible, I would require a UUID implementation that was identical. So my painful journey began, I researched how Java's UUID worked, looked through Java source code. Finally after much trial and error, the library had a fully functional UUID implementation with a working generator that could actually accept two longs. See in Java, a UUID constists of two long values 'MSB' and 'LSB'. And dart's internal implementation does not expose these values, if it even uses them at all. The only problem is dart's web code does not actually support MSB and LSB. I had to create a secondary uuid class just for the web which operates on strings instead of the proper implementation using two long values.",
|
||||
style: style),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Text(
|
||||
"The next challenge in my project was SNBT. This came with a significant number of problems. For one, the SNBT protocol is completely undocumented. Which meant much trial and error, saving SNBT documents from a sample minecraft mod, testing import, etc. I had to get everything just right. The tag element below is infact a SNBT tag.",
|
||||
style: style),
|
||||
ListTile(
|
||||
title: Text("Sample SNBT"),
|
||||
subtitle: Text(SnbtIo.writeToString(ct)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Text(
|
||||
"The next challenge was the layout of the editor and the tag icons! I quickly grabbed the public domain icons for the tags from the Minecraft Wiki, then proceeded to embed them. And have a look below, You be the judge on if I accomplished my task.",
|
||||
style: style),
|
||||
Image.asset(
|
||||
"images/nbteditor_tagdisplay.png",
|
||||
width: 1024,
|
||||
height: 1024,
|
||||
),
|
||||
Image.asset(
|
||||
"images/nbteditor_menu.png",
|
||||
width: 1024,
|
||||
height: 1024,
|
||||
),
|
||||
Row(children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"And finally.. now that everything was in place, it was time to add the NBT Editor's raw data editor... which lets you edit it as SNBT!",
|
||||
style: style,
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
"images/nbteditor_snbt.png",
|
||||
width: 800,
|
||||
height: 800,
|
||||
)
|
||||
]),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Text(
|
||||
"Now.. it is important to edit this off with a note. This project is far from complete. I am a single person who made something I care deeply about, a utility for linux. I am not a UX designer. This was the best I could do with the limited knowledge on UX design that i have. I am far better at backend coding where I do not need to give the user any amount of controls or info. That being said, my CI server builds changes to the editor with every commit. Builds are produced for Windows and Linux, but not for Mac at this time. An android build is produced, but that is mostly as a for fun type of deal, as it is fairly useless on a phone without open or save functionality.",
|
||||
style: style,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
# Project-level configuration.
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(runner LANGUAGES CXX)
|
||||
|
||||
# The name of the executable created for the application. Change this to change
|
||||
|
@ -7,7 +7,7 @@ project(runner LANGUAGES CXX)
|
|||
set(BINARY_NAME "zontreck")
|
||||
# The unique GTK application identifier for this application. See:
|
||||
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
||||
set(APPLICATION_ID "com.zontreck.zontreck")
|
||||
set(APPLICATION_ID "dev.zontreck.zontreck")
|
||||
|
||||
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
||||
# versions of CMake.
|
||||
|
@ -54,25 +54,8 @@ add_subdirectory(${FLUTTER_MANAGED_DIR})
|
|||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
||||
|
||||
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
||||
|
||||
# Define the application target. To change its name, change BINARY_NAME above,
|
||||
# not the value here, or `flutter run` will no longer work.
|
||||
#
|
||||
# Any new source files that you add to the application should be added here.
|
||||
add_executable(${BINARY_NAME}
|
||||
"main.cc"
|
||||
"my_application.cc"
|
||||
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
||||
)
|
||||
|
||||
# Apply the standard set of build settings. This can be removed for applications
|
||||
# that need different build settings.
|
||||
apply_standard_settings(${BINARY_NAME})
|
||||
|
||||
# Add dependency libraries. Add any application-specific dependencies here.
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
||||
# Application build; see runner/CMakeLists.txt.
|
||||
add_subdirectory("runner")
|
||||
|
||||
# Run the Flutter tool portions of the build. This must not be removed.
|
||||
add_dependencies(${BINARY_NAME} flutter_assemble)
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
||||
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
url_launcher_linux
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
|
26
linux/runner/CMakeLists.txt
Normal file
26
linux/runner/CMakeLists.txt
Normal file
|
@ -0,0 +1,26 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
project(runner LANGUAGES CXX)
|
||||
|
||||
# Define the application target. To change its name, change BINARY_NAME in the
|
||||
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
|
||||
# work.
|
||||
#
|
||||
# Any new source files that you add to the application should be added here.
|
||||
add_executable(${BINARY_NAME}
|
||||
"main.cc"
|
||||
"my_application.cc"
|
||||
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
||||
)
|
||||
|
||||
# Apply the standard set of build settings. This can be removed for applications
|
||||
# that need different build settings.
|
||||
apply_standard_settings(${BINARY_NAME})
|
||||
|
||||
# Add preprocessor definitions for the application ID.
|
||||
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
||||
|
||||
# Add dependency libraries. Add any application-specific dependencies here.
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
||||
|
||||
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
|
@ -117,6 +117,12 @@ static void my_application_class_init(MyApplicationClass* klass) {
|
|||
static void my_application_init(MyApplication* self) {}
|
||||
|
||||
MyApplication* my_application_new() {
|
||||
// Set the program name to the application ID, which helps various systems
|
||||
// like GTK and desktop environments map this running application to its
|
||||
// corresponding .desktop file. This ensures better integration by allowing
|
||||
// the application to be recognized beyond its binary name.
|
||||
g_set_prgname(APPLICATION_ID);
|
||||
|
||||
return MY_APPLICATION(g_object_new(my_application_get_type(),
|
||||
"application-id", APPLICATION_ID,
|
||||
"flags", G_APPLICATION_NON_UNIQUE,
|
|
@ -6,7 +6,9 @@ import FlutterMacOS
|
|||
import Foundation
|
||||
|
||||
import shared_preferences_foundation
|
||||
import url_launcher_macos
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
}
|
||||
|
|
|
@ -385,7 +385,7 @@
|
|||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zontreck.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zontreck";
|
||||
|
@ -399,7 +399,7 @@
|
|||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zontreck.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zontreck";
|
||||
|
@ -413,7 +413,7 @@
|
|||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck.RunnerTests;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zontreck.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zontreck";
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import Cocoa
|
||||
import FlutterMacOS
|
||||
|
||||
@NSApplicationMain
|
||||
@main
|
||||
class AppDelegate: FlutterAppDelegate {
|
||||
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
PRODUCT_NAME = zontreck
|
||||
|
||||
// The application's bundle identifier
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.zontreck
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.zontreck.zontreck
|
||||
|
||||
// The copyright displayed in application information
|
||||
PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved.
|
||||
PRODUCT_COPYRIGHT = Copyright © 2025 dev.zontreck. All rights reserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import FlutterMacOS
|
||||
import Cocoa
|
||||
import FlutterMacOS
|
||||
import XCTest
|
||||
|
||||
class RunnerTests: XCTestCase {
|
||||
|
|
28
pubspec.yaml
28
pubspec.yaml
|
@ -1,8 +1,8 @@
|
|||
name: zontreck
|
||||
description: "A new Flutter project."
|
||||
description: "The zontreck.com website"
|
||||
# The following line prevents the package from being accidentally published to
|
||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
|
||||
# The following defines the version and build number for your application.
|
||||
# A version number is three numbers separated by dots, like 1.2.43
|
||||
|
@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||
version: 1.0.082924+0758
|
||||
|
||||
environment:
|
||||
sdk: '>=3.3.4 <4.0.0'
|
||||
sdk: ^3.6.1
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
|
@ -31,18 +31,17 @@ dependencies:
|
|||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.6
|
||||
cupertino_icons: ^1.0.8
|
||||
libac_dart:
|
||||
hosted: https://git.zontreck.com/api/packages/AriasCreations/pub/
|
||||
version: ^1.2.082924+0756
|
||||
dio: ^5.4.3+1
|
||||
shared_preferences: ^2.2.3
|
||||
version: ^1.4.012225+0413
|
||||
dio: ^5.8.0+1
|
||||
shared_preferences: ^2.5.1
|
||||
footer: ^0.0.4
|
||||
crypto: ^3.0.3
|
||||
url_launcher: ^6.3.0
|
||||
crypto: ^3.0.6
|
||||
url_launcher: ^6.3.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
@ -53,19 +52,24 @@ dev_dependencies:
|
|||
# activated in the `analysis_options.yaml` file located at the root of your
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^3.0.0
|
||||
flutter_lints: ^5.0.0
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
# The following section is specific to Flutter packages.
|
||||
flutter:
|
||||
|
||||
# The following line ensures that the Material Icons font is
|
||||
# included with your application, so that you can use the icons in
|
||||
# the material Icons class.
|
||||
uses-material-design: true
|
||||
|
||||
assets:
|
||||
- images/nbteditor_icon.png
|
||||
- images/nbteditor_tagdisplay.png
|
||||
- images/nbteditor_menu.png
|
||||
- images/nbteditor_snbt.png
|
||||
|
||||
# To add assets to your application, add an assets section, like this:
|
||||
# assets:
|
||||
# - images/a_dot_burr.jpeg
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
|
||||
<meta charset="UTF-8">
|
||||
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||
<meta name="description" content="Zontreck.com">
|
||||
<meta name="description" content="A new Flutter project.">
|
||||
|
||||
<!-- iOS meta tags & icons -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="apple-mobile-web-app-title" content="zontreck">
|
||||
<link rel="apple-touch-icon" href="icons/Icon-192.png">
|
||||
|
@ -29,10 +29,10 @@
|
|||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/png" href="favicon.png"/>
|
||||
|
||||
<title>Zontreck.com</title>
|
||||
<title>zontreck.com</title>
|
||||
<link rel="manifest" href="manifest.json">
|
||||
</head>
|
||||
<body>
|
||||
<script src="flutter_bootstrap.js" async></script>
|
||||
<script src="flutter_bootstrap.js" async></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <url_launcher_windows/url_launcher_windows.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
UrlLauncherWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
url_launcher_windows
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
|
|
@ -89,11 +89,11 @@ BEGIN
|
|||
BEGIN
|
||||
BLOCK "040904e4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "com.example" "\0"
|
||||
VALUE "CompanyName", "dev.zontreck" "\0"
|
||||
VALUE "FileDescription", "zontreck" "\0"
|
||||
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
||||
VALUE "InternalName", "zontreck" "\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2025 dev.zontreck. All rights reserved." "\0"
|
||||
VALUE "OriginalFilename", "zontreck.exe" "\0"
|
||||
VALUE "ProductName", "zontreck" "\0"
|
||||
VALUE "ProductVersion", VERSION_AS_STRING "\0"
|
||||
|
|
|
@ -9,12 +9,6 @@
|
|||
<application>
|
||||
<!-- Windows 10 and Windows 11 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
|
|
|
@ -45,13 +45,13 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) {
|
|||
if (utf16_string == nullptr) {
|
||||
return std::string();
|
||||
}
|
||||
int target_length = ::WideCharToMultiByte(
|
||||
unsigned int target_length = ::WideCharToMultiByte(
|
||||
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
|
||||
-1, nullptr, 0, nullptr, nullptr)
|
||||
-1; // remove the trailing null character
|
||||
int input_length = (int)wcslen(utf16_string);
|
||||
std::string utf8_string;
|
||||
if (target_length <= 0 || target_length > utf8_string.max_size()) {
|
||||
if (target_length == 0 || target_length > utf8_string.max_size()) {
|
||||
return utf8_string;
|
||||
}
|
||||
utf8_string.resize(target_length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue