Build native Flutter Linux manager and deb release 0.2.5

This commit is contained in:
tongtong committed 2026-11-13 19:28:09 +08:00
1 parent 3c6c4a0e90
commit 03e729a60b
35 files changed
+757 -69

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:ads_manager/data/app_paths.dart';
void main() {
test('Linux config and logs respect separate XDG directories', () {
const env = {
'HOME': '/home/tt',
'XDG_CONFIG_HOME': '/config',
'XDG_STATE_HOME': '/state',
};
expect(
AppPaths.configuration(environment: env, windows: false),
'/config/ads-flutter',
);
expect(
AppPaths.logs(environment: env, windows: false),
'/state/ads-flutter/logs',
);
});
test('Linux default locations persist outside temporary directories', () {
const env = {'HOME': '/home/tt'};
expect(
AppPaths.configuration(environment: env, windows: false),
'/home/tt/.config/ads-flutter',
);
expect(
AppPaths.logs(environment: env, windows: false),
'/home/tt/.local/state/ads-flutter/logs',
);
});
test('Windows keeps existing settings and log paths', () {
const env = {'LOCALAPPDATA': r'C:\Users\TT\AppData\Local'};
expect(
AppPaths.configuration(environment: env, windows: true),
r'C:\Users\TT\AppData\Local\TTSTD\ADS-Flutter',
);
expect(
AppPaths.logs(environment: env, windows: true),
r'C:\Users\TT\AppData\Local\TTSTD\ADS-Flutter\logs',
);
});
}
+1 -1
View File
@@ -33,7 +33,7 @@ void main() {
),
);
final buttons = find.byTooltip('选择文件并保存');
expect(buttons, findsNWidgets(5));
expect(buttons, findsNWidgets(Platform.isWindows ? 5 : 4));
await tester.ensureVisible(buttons.at(2));
await tester.runAsync(() async {
await tester.tap(buttons.at(2));
+1 -1
View File
@@ -127,7 +127,7 @@ void main() {
repo.listing = '${session.endpoint}\tdevice\n';
await repo.monitor();
expect(repo.screens, 1);
expect(repo.resumedEmbedded, true);
expect(repo.resumedEmbedded, Platform.isWindows);
expect(session.screenWanted, true);
await repo.stopScreen(session);
await repo.monitor();
@@ -30,6 +30,13 @@ void main() {
ads.SwitchListTile,
'挂载为 USB 设备 · Windows',
);
if (!Platform.isWindows) {
expect(tester.widget<ads.SwitchListTile>(toggle).onChanged, isNull);
expect(find.textContaining('Linux 当前使用网络 ADB'), findsOneWidget);
await tester.pumpWidget(const SizedBox());
model.dispose();
return;
}
await tester.ensureVisible(toggle);
await tester.tap(toggle);
await tester.pumpAndSettle();