mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-11 04:27:47 +08:00
tweaks (#2032)
* fix: 1080p * opt: import export * opt: downloader * opt: skeleton * opt: parseColor * tweak * opt: sb seek * opt: rxn
This commit is contained in:
committed by
GitHub
parent
b7b40c557e
commit
f5dbfcec79
@@ -2,11 +2,12 @@ import 'package:flutter/rendering.dart' show Color;
|
||||
|
||||
abstract final class ColourUtils {
|
||||
static Color parseColor(String color) =>
|
||||
Color(int.parse('FF${color.substring(1)}', radix: 16));
|
||||
Color(0xFF000000 | int.parse(color.substring(1), radix: 16));
|
||||
|
||||
static Color parseMedalColor(String color) => Color(
|
||||
int.parse('${color.substring(7)}${color.substring(1, 7)}', radix: 16),
|
||||
);
|
||||
static Color parseMedalColor(String color) {
|
||||
final rgba = int.parse(color.substring(1), radix: 16);
|
||||
return Color.fromARGB(rgba, rgba >> 24, rgba >> 16, rgba >> 8);
|
||||
}
|
||||
|
||||
static Color index2Color(int index, Color color) => switch (index) {
|
||||
0 => const Color(0xFFfdad13),
|
||||
|
||||
@@ -14,17 +14,17 @@ abstract final class MaxScreenSize {
|
||||
static Future<void> _initFoldable() async {
|
||||
final isFoldable = await Utils.channel.invokeMethod('isFoldable');
|
||||
if (isFoldable == true) {
|
||||
const MethodChannel('ScreenChannel').setMethodCallHandler((call) async {
|
||||
const MethodChannel('ScreenChannel').setMethodCallHandler((call) {
|
||||
if (call.method == 'onConfigChanged') {
|
||||
_handleRes(call.arguments);
|
||||
}
|
||||
return Future.syncValue(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> _initScreenSize() async {
|
||||
final res = await Utils.channel.invokeMethod('maxScreenSize');
|
||||
_handleRes(res);
|
||||
static Future<void> _initScreenSize() {
|
||||
return Utils.channel.invokeMethod('maxScreenSize').then(_handleRes);
|
||||
}
|
||||
|
||||
static void _handleRes(dynamic res) {
|
||||
|
||||
Reference in New Issue
Block a user