showToast method
Implementation
@override
Future<void> showToast(String message) async {
try {
// Invoke the 'showToast' method on the native side with the message as an argument.
await methodChannel.invokeMethod('showToast', {'message': message});
} on PlatformException catch (e) {
// Handle platform-specific exceptions.
if (kDebugMode) {
print("Failed to show toast: '${e.message}'.");
}
}
}