loadSchematicFromAsset method
Load schematic from asset bundle.
Implementation
Future<void> loadSchematicFromAsset(
String assetPath, {
String? displayName,
}) async {
setLoading(loading: true);
try {
final jsonData = await rootBundle.loadString(assetPath);
if (displayName != null) {
setFileName(displayName);
}
await computeLayout(jsonData);
} on Exception catch (e) {
setLoading(loading: false, errorMessage: 'Failed to load asset: $e');
}
}