handle method
Implementation
@override
Future<dynamic> handle(MethodCall call) async {
NLogger.i(
'Handling nudge overlay: ${call.method}',
);
switch (call.method) {
case 'nudge_visible':
var targetLabel = call.arguments['target'];
var targetFrame = call.arguments['frame'];
Map<String, dynamic> targetDetails = {};
if (targetLabel != null && targetLabel != "nudge_default") {
targetDetails = await NudgeWidgetTracker.findWidgetDetails(
label: targetLabel,
scaleX: 1.0,
scaleY: 1.0,
statusBarHeight: 0,
);
} else {
targetDetails = {
'x': targetFrame['x'],
'y': targetFrame['y'],
'width': targetFrame['width'],
'height': targetFrame['height'],
};
}
showNudgeOverlay(
Nudge.nudgeNavigatorKey.currentContext!,
const SizedBox.expand(),
targetDetails,
);
break;
case 'nudge_dismissed':
hideNudgeOverlay();
break;
default:
NLogger.i('Unknown method: ${call.method}');
}
}