fix:第一轮跑
This commit is contained in:
1 parent
e834ec7586
commit
33235f450b
56 files changed
+4357
-210
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'package:android_intent_plus/android_intent.dart';
|
||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
import '../storage/storage_service.dart';
|
||||
|
||||
/// Clears only disposable presentation data. Credentials and user preferences
|
||||
/// deliberately remain outside this service.
|
||||
class CacheClearService {
|
||||
const CacheClearService._();
|
||||
|
||||
static Future<void> clear() async {
|
||||
await DefaultCacheManager().emptyCache();
|
||||
await SplashAdControllerPlaceholder.clear();
|
||||
}
|
||||
|
||||
static bool get requiresSystemSettings => !kIsWeb && Platform.isAndroid;
|
||||
|
||||
static Future<void> openAndroidSystemSettings() async {
|
||||
final packageName = (await PackageInfo.fromPlatform()).packageName;
|
||||
await AndroidIntent(
|
||||
action: 'android.settings.APPLICATION_DETAILS_SETTINGS',
|
||||
data: 'package:$packageName',
|
||||
).launch();
|
||||
}
|
||||
}
|
||||
|
||||
/// CacheClearService is used outside Riverpod; the splash entry itself lives
|
||||
/// in SharedPreferences and is removed here without touching user data.
|
||||
abstract final class SplashAdControllerPlaceholder {
|
||||
static Future<void> clear() async {
|
||||
await StorageService.to.preferences.remove('ads.splash.entry');
|
||||
await StorageService.to.preferences.remove('ads.splash.daily');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user