mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 14:47:23 +00:00
16 lines
321 B
Dart
16 lines
321 B
Dart
import 'package:flutter/services.dart';
|
|
|
|
class AssetValidator {
|
|
static Future<bool> isValidAsset(String? assetPath) async {
|
|
if (assetPath == null || assetPath.isEmpty) {
|
|
return false;
|
|
}
|
|
try {
|
|
await rootBundle.load(assetPath);
|
|
return true;
|
|
} catch (_) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|