setCustomLayout method
Implementation
@override
Future<bool?> setCustomLayout(int customWidth, int customHeight) async {
if (kDebugMode) {
print('invoking setCustomLayout');
}
try {
// Pass arguments as a Map
final bool? result = await methodChannel.invokeMethod<bool>(
'setCustomLayout',
{
'customWidth': customWidth, // Use key-value pairs
'customHeight': customHeight
},
);
return result;
} catch (e) {
if (kDebugMode) {
print('Error invoking setCustomLayout: $e');
}
return null; // Return null in case of an error
}
}