끝난 이클립스 합류 문구 · HOME 헤더 POP · 다국어 HOME 레이아웃 · 캠페인 표시 수정

This commit is contained in:
Sn-Kinos
2026-10-08 19:00:24 +09:00
parent a74edaef6b
commit 40b2c0e6f6
40 changed files with 1649 additions and 845 deletions
+31
View File
@@ -0,0 +1,31 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
const _deviceChannel = MethodChannel('kr.co.fanuzu.app/device');
/// Android API 레벨 — 한 번 읽어 둔다. Android 가 아니거나 채널이 없으면(위젯 테스트) null.
Future<int?>? _sdkInt;
/// 클립보드에 [text] 를 넣고, OS 가 복사를 직접 알리지 않을 때만 [toast] 를 부른다.
///
/// Android 13(API 33)+ 는 시스템이 「클립보드에 복사했어요」를 띄워 앱 토스트와 겹친다
/// (10/8 r11 3-8). iOS · Android 12 이하는 앱이 알린다.
Future<void> copyToClipboard(String text, VoidCallback toast) async {
await Clipboard.setData(ClipboardData(text: text));
if (defaultTargetPlatform == TargetPlatform.android &&
((await (_sdkInt ??= _readSdkInt())) ?? 0) >= 33) {
return;
}
toast();
}
Future<int?> _readSdkInt() async {
try {
return await _deviceChannel.invokeMethod<int>('sdkInt');
} on Object {
return null;
}
}
@visibleForTesting
void resetClipboardSdkCache() => _sdkInt = null;