Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-01 10:37:31 +08:00
parent 91a14d8286
commit d27f5f315c
71 changed files with 94 additions and 1561 deletions

View File

@@ -1,25 +1,13 @@
import 'dart:io' show Platform;
import 'package:PiliPlus/utils/utils.dart';
import 'package:flutter/services.dart' show MethodChannel;
abstract final class MaxScreenSize {
static int? _maxWidth;
static int? _maxHeight;
static Future<void> init() {
return Future.wait([_initFoldable(), _initScreenSize()]);
}
static Future<void> _initFoldable() async {
final isFoldable = await Utils.channel.invokeMethod('isFoldable');
if (isFoldable == true) {
const MethodChannel('ScreenChannel').setMethodCallHandler((call) async {
if (call.method == 'onConfigChanged') {
_handleRes(call.arguments);
}
});
}
return _initScreenSize();
}
static Future<void> _initScreenSize() async {