loadModel method
Loads a Live2D model into the native view identified by viewId.
modelDir must be an absolute filesystem directory; asset paths are
resolved on the Dart side before reaching this method.
modelFileName is the .model3.json entry file inside modelDir.
Resolves to true on success and false when the native side
rejects the model (corrupt files, missing dependencies, …). Throws
PlatformException for transport-level errors.
Implementation
@override
Future<bool> loadModel({
required int viewId,
required String modelDir,
required String modelFileName,
}) async {
final result = await methodChannel.invokeMethod<bool>('loadModel', {
'viewId': viewId,
'modelDir': modelDir,
'modelFileName': modelFileName,
});
return result ?? false;
}