Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file is auto generated.
// To update all the build.gradle files in the Flutter repo,
// See dev/tools/bin/generate_gradle_lockfiles.dart.

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = "../build"
rootProject.layout.buildDirectory.value(rootProject.layout.buildDirectory.dir("../../build").get())

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.layout.buildDirectory.value(rootProject.layout.buildDirectory.dir(project.name).get())
}
subprojects {
project.evaluationDependsOn(":app")
project.evaluationDependsOn(':app')
dependencyLocking {
ignoredDependencies.add('io.flutter:*')
lockFile = file("${rootProject.projectDir}/project-${project.name}.lockfile")
if (!project.hasProperty('local-engine-repo')) {
lockAllConfigurations()
}
}
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
delete rootProject.layout.buildDirectory
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.14-all.zip
24 changes: 20 additions & 4 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file is auto generated.
// To update all the settings.gradle files in the Flutter repo,
// See dev/tools/bin/generate_gradle_lockfiles.dart.

pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
}
settings.ext.flutterSdkPath = flutterSdkPath()

includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

repositories {
google()
Expand All @@ -16,10 +25,17 @@ pluginManagement {
}
}

buildscript {
dependencyLocking {
lockFile = file("${rootProject.projectDir}/buildscript-gradle.lockfile")
lockAllConfigurations()
}
}

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.9.1" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

include ":app"
2 changes: 2 additions & 0 deletions lib/connect_log.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'dart:io';
import 'package:flutter/material.dart';

class LogPage extends StatefulWidget {
const LogPage({super.key});

@override
_LogPageState createState() => _LogPageState();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/connected_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class _ConnectDetailPageState extends State<ConnectDetailPage> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => LogPage(),
builder: (context) => const LogPage(),
),
);
},
Expand Down
5 changes: 3 additions & 2 deletions lib/custom_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
final Color backgroundColor;
final List<Widget> actions;

const CustomAppBar({super.key,
const CustomAppBar({
super.key,
required this.title,
this.backgroundColor = Colors.blue,
this.actions = const [],
Expand All @@ -21,5 +22,5 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
}

@override
Size get preferredSize => Size.fromHeight(kToolbarHeight);
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
}
10 changes: 5 additions & 5 deletions lib/network_config_input_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _NetworkConfigInputPageState extends State<NetworkConfigInputPage> {
String _compressionMethod = 'none'; // 默认不压缩
int _compressionLevel = 3; // 默认压缩级别

_NetworkConfigInputPageState() {}
_NetworkConfigInputPageState();

@override
void initState() {
Expand Down Expand Up @@ -706,7 +706,7 @@ class _NetworkConfigInputPageState extends State<NetworkConfigInputPage> {
}
return null;
},
TextInputType.numberWithOptions(decimal: true),
const TextInputType.numberWithOptions(decimal: true),
),
_buildTextFormField(
_simulatedLatencyController,
Expand Down Expand Up @@ -839,7 +839,7 @@ class _NetworkConfigInputPageState extends State<NetworkConfigInputPage> {
),
],
);
}).toList(),
}),
Row(
children: [
Expanded(child: Container()),
Expand Down Expand Up @@ -892,7 +892,7 @@ class _NetworkConfigInputPageState extends State<NetworkConfigInputPage> {
),
],
);
}).toList(),
}),
Row(
children: [
Expanded(child: Container()),
Expand All @@ -913,7 +913,7 @@ class _NetworkConfigInputPageState extends State<NetworkConfigInputPage> {
ValueChanged<String?> onChanged,
) {
return DropdownButtonFormField(
value: value,
initialValue: value,
decoration: InputDecoration(labelText: labelText),
items: items.map((String item) {
return DropdownMenuItem(
Expand Down
4 changes: 3 additions & 1 deletion lib/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:vnt_app/data_persistence.dart';
import 'connect_log.dart';

class SettingsPage extends StatefulWidget {
const SettingsPage({super.key});

@override
_SettingsPageState createState() => _SettingsPageState();
}
Expand Down Expand Up @@ -330,7 +332,7 @@ class _SettingsPageState extends State<SettingsPage> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => LogPage(),
builder: (context) => const LogPage(),
),
);
},
Expand Down
6 changes: 4 additions & 2 deletions lib/src/rust/api/vnt_api.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// This file is automatically generated, so please do not edit it.
// Generated by `flutter_rust_bridge`@ 2.1.0.
// @generated by `flutter_rust_bridge`@ 2.11.1.

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

// These functions are ignored because they are not marked as `pub`: `convert`
// These types are ignored because they are not used by any `pub` functions: `VntApiCallbackInner`
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `VntApiCallbackInner`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `connect`, `create_tun`, `error`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `handshake`, `peer_client_list`, `register`, `stop`, `success`

Future<VntApi> vntInit(
Expand Down Expand Up @@ -230,6 +230,8 @@ enum RustErrorType {
invalidIp,
localIpExists,
unknown,
failedToCrateDevice,
warn,
;
}

Expand Down
43 changes: 36 additions & 7 deletions lib/src/rust/frb_generated.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is automatically generated, so please do not edit it.
// Generated by `flutter_rust_bridge`@ 2.1.0.
// @generated by `flutter_rust_bridge`@ 2.11.1.

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field

Expand All @@ -23,11 +23,23 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
RustLibApi? api,
BaseHandler? handler,
ExternalLibrary? externalLibrary,
bool forceSameCodegenVersion = true,
}) async {
await instance.initImpl(
api: api,
handler: handler,
externalLibrary: externalLibrary,
forceSameCodegenVersion: forceSameCodegenVersion,
);
}

/// Initialize flutter_rust_bridge in mock mode.
/// No libraries for FFI are loaded.
static void initMock({
required RustLibApi api,
}) {
instance.initMockImpl(
api: api,
);
}

Expand Down Expand Up @@ -55,7 +67,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
kDefaultExternalLibraryLoaderConfig;

@override
String get codegenVersion => '2.1.0';
String get codegenVersion => '2.11.1';

@override
int get rustContentHash => 1486497214;
Expand Down Expand Up @@ -1174,6 +1186,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return dcoDecodeI64(raw);
}

@protected
PlatformInt64 dco_decode_isize(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
return dcoDecodeI64(raw);
}

@protected
List<String> dco_decode_list_String(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
Expand Down Expand Up @@ -1606,7 +1624,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
@protected
Object sse_decode_DartOpaque(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var inner = sse_decode_usize(deserializer);
var inner = sse_decode_isize(deserializer);
return decodeDartOpaque(inner, generalizedFrbRustBinding);
}

Expand Down Expand Up @@ -1690,6 +1708,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return deserializer.buffer.getPlatformInt64();
}

@protected
PlatformInt64 sse_decode_isize(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
return deserializer.buffer.getPlatformInt64();
}

@protected
List<String> sse_decode_list_String(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
Expand Down Expand Up @@ -2270,10 +2294,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
@protected
void sse_encode_DartOpaque(Object self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_usize(
BigInt.from(PlatformPointerUtil.ptrToInt(encodeDartOpaque(
self, portManager.dartHandlerPort, generalizedFrbRustBinding)))
.toUnsigned(64),
sse_encode_isize(
PlatformPointerUtil.ptrToPlatformInt64(encodeDartOpaque(
self, portManager.dartHandlerPort, generalizedFrbRustBinding)),
serializer);
}

Expand Down Expand Up @@ -2359,6 +2382,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
serializer.buffer.putPlatformInt64(self);
}

@protected
void sse_encode_isize(PlatformInt64 self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
serializer.buffer.putPlatformInt64(self);
}

@protected
void sse_encode_list_String(List<String> self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
Expand Down
11 changes: 10 additions & 1 deletion lib/src/rust/frb_generated.io.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is automatically generated, so please do not edit it.
// Generated by `flutter_rust_bridge`@ 2.1.0.
// @generated by `flutter_rust_bridge`@ 2.11.1.

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field

Expand Down Expand Up @@ -125,6 +125,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 dco_decode_i_64(dynamic raw);

@protected
PlatformInt64 dco_decode_isize(dynamic raw);

@protected
List<String> dco_decode_list_String(dynamic raw);

Expand Down Expand Up @@ -310,6 +313,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 sse_decode_i_64(SseDeserializer deserializer);

@protected
PlatformInt64 sse_decode_isize(SseDeserializer deserializer);

@protected
List<String> sse_decode_list_String(SseDeserializer deserializer);

Expand Down Expand Up @@ -546,6 +552,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_i_64(PlatformInt64 self, SseSerializer serializer);

@protected
void sse_encode_isize(PlatformInt64 self, SseSerializer serializer);

@protected
void sse_encode_list_String(List<String> self, SseSerializer serializer);

Expand Down
11 changes: 10 additions & 1 deletion lib/src/rust/frb_generated.web.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is automatically generated, so please do not edit it.
// Generated by `flutter_rust_bridge`@ 2.1.0.
// @generated by `flutter_rust_bridge`@ 2.11.1.

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field

Expand Down Expand Up @@ -127,6 +127,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 dco_decode_i_64(dynamic raw);

@protected
PlatformInt64 dco_decode_isize(dynamic raw);

@protected
List<String> dco_decode_list_String(dynamic raw);

Expand Down Expand Up @@ -312,6 +315,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 sse_decode_i_64(SseDeserializer deserializer);

@protected
PlatformInt64 sse_decode_isize(SseDeserializer deserializer);

@protected
List<String> sse_decode_list_String(SseDeserializer deserializer);

Expand Down Expand Up @@ -548,6 +554,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_i_64(PlatformInt64 self, SseSerializer serializer);

@protected
void sse_encode_isize(PlatformInt64 self, SseSerializer serializer);

@protected
void sse_encode_list_String(List<String> self, SseSerializer serializer);

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/ip_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Ipv4Addr {

class IpUtils {
static String toInIpString(int dest, int mask, String ip) {
return '${Ipv4Addr.fromInt(dest).toString()}/${_countBits(mask)},${ip}';
return '${Ipv4Addr.fromInt(dest).toString()}/${_countBits(mask)},$ip';
}

static (int, int, String) parseInIpString(String input) {
Expand Down
Loading