learnAppPackage method
Records the focused package as the app's own; call only while Flutter reports resumed, when its activity has focus.
Implementation
Future<void> learnAppPackage() async {
final c = await focusedComponent();
if (c != null) appPackage = c.split('/').first;
}