Flutter
Installation
Installation
This page outlines how to install and configure the n2app Flutter plugin and configure Android to interact with a SoftPOS app (production or staging).
1. Add the plugin
Obtain the n2app plugin from your package provider and add it to your pubspec.yaml:
dependencies:
flutter:
sdk: flutter
n2app:
path: path/to/flutter-pluginThen fetch packages:
flutter pub get2. Android requirements
- Minimum Android SDK:
minSdkVersion 26 - Recommended compile/target SDK: 36
Update your Gradle settings.
android {
compileSdk 36
defaultConfig {
minSdk 26
targetSdk 36
}
}3. AndroidManifest configuration (SoftPOS integration)
Edit android/app/src/main/AndroidManifest.xml and add the queries entry (outside <application>) and the meta-data entry (inside <application>):
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Allow querying for the SoftPOS package -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
<package android:name="com.neurogine.softpos.stage" />
</queries>
<application>
<!-- Set SoftPOS package name for the environment -->
<meta-data
android:name="softposName"
android:value="com.neurogine.softpos.stage" />
<!-- existing application config -->
</application>
</manifest>Important placement rules:
<queries>must be outside of<application>but inside<manifest>.<meta-data>must be inside<application>.
4. Environment-specific values
Choose the correct SoftPOS package name for your environment:
- Production:
<meta-data android:name="softposName" android:value="com.neurogine.softpos" />
<queries>
<package android:name="com.neurogine.softpos" />
</queries>- Staging / Testing:
<meta-data android:name="softposName" android:value="com.neurogine.softpos.stage" />
<queries>
<package android:name="com.neurogine.softpos.stage" />
</queries>Make sure the package name matches the actual installed SoftPOS app on the device.
5. Build and run
Clean, fetch, and run:
flutter clean
flutter pub get
flutter runTroubleshooting
- Verify SoftPOS package is installed and its package name:
adb shell pm list packages | grep softpos- If the app cannot find the package, re-check the package name in
AndroidManifest.xmland any build-time flavor/manifest placeholders. - If you get runtime permission or intent failures, ensure the
<queries>entry includes the correct intent/mimeType for your integration.