IFP Detector Plugin
A Flutter plugin to detect whether a device is an Interactive Flat Panel (IFP) or a regular tablet. This plugin is useful for applications that need to distinguish between these device types for licensing, feature availability, or UI adaptation purposes.
Features
- Accurate Detection: Uses multiple hardware and software indicators to determine device type
- Confidence Scoring: Provides a confidence score (0.0 to 1.0) for the detection result
- Detailed Analysis: Returns comprehensive information about device characteristics
- Simple API: Easy-to-use methods for both detailed and simple detection
Detection Logic
The plugin analyzes several device characteristics:
- Screen Size: Devices with screens ≥20" are typically IFPs
- Known IFP Brands: Promethean, Newline, ViewSonic, BenQ, CleverTouch, Smart, etc.
- Hardware Features: HDMI CEC support, Android TV Leanback features
- Input Capabilities: Stylus/pen support detection
- Display Properties: Screen size buckets and reliability
Installation
Add this to your package's pubspec.yaml
file:
dependencies:
ifp_detector:
path: ../ifp_detector # or your plugin path
Usage
Simple Detection
import 'package:ifp_detector/ifp_detector.dart';
// Simple boolean check
bool isIFP = await IfpDetector.isIfp();
if (isIFP) {
print('This is an Interactive Flat Panel');
} else {
print('This is a regular tablet');
}
Detailed Detection
import 'package:ifp_detector/ifp_detector.dart';
// Get detailed detection results
IfpDetectionResult result = await IfpDetector.detectIfp();
print('Device Type: ${result.isIFP ? "IFP" : "Tablet"}');
print('Confidence: ${result.confidenceLevel} (${(result.confidenceScore * 100).toStringAsFixed(1)}%)');
print('Screen Size: ${result.screenInches.toStringAsFixed(2)}" inches');
print('Screen Bucket: ${result.screenBucket}');
print('Known IFP Brand: ${result.matchedKnownIFPBrand}');
print('HDMI CEC: ${result.hasHdmiCec}');
print('Leanback UI: ${result.hasLeanback}');
print('Stylus Support: ${result.hasStylus}');
print('Screen Size Reliable: ${result.screenSizeReliable}');
Error Handling
try {
final result = await IfpDetector.detectIfp();
// Use result
} on PlatformException catch (e) {
print('Detection failed: ${e.message}');
} catch (e) {
print('Unexpected error: $e');
}
API Reference
IfpDetector
Main class for IFP detection.
Methods
-
static Future<IfpDetectionResult> detectIfp()
- Returns detailed detection results
- Throws
PlatformException
on failure
-
static Future<bool> isIfp()
- Returns simple boolean result
- Throws
PlatformException
on failure
IfpDetectionResult
Contains detailed information about the detection.
Properties
bool isIFP
- Whether the device is detected as an IFPdouble screenInches
- Screen size in inches (diagonal)String screenBucket
- Screen size bucket (small, normal, large, xlarge)bool matchedKnownIFPBrand
- Whether device matches known IFP brand patternsbool hasHdmiCec
- Whether device supports HDMI CECbool hasLeanback
- Whether device has Android TV Leanback featuresbool hasStylus
- Whether device supports stylus/pen inputbool screenSizeReliable
- Whether screen size calculation is reliabledouble confidenceScore
- Confidence score (0.0 to 1.0)
Methods
String get confidenceLevel
- Human-readable confidence levelMap<String, dynamic> toMap()
- Convert to mapfactory IfpDetectionResult.fromMap(Map<String, dynamic> map)
- Create from map
Platform Support
- ✅ Android
- ❌ iOS (not implemented)
- ❌ Web (not applicable)
- ❌ Desktop (not implemented)
Example App
The plugin includes an example app that demonstrates both simple and detailed detection. Run it with:
flutter run
Use Cases
- Software Licensing: Different licensing models for IFPs vs tablets
- Feature Availability: Enable/disable features based on device type
- UI Adaptation: Optimize interface for large displays
- Analytics: Track usage across different device types
Known IFP Brands
The plugin recognizes these IFP manufacturers:
- Promethean
- Newline
- ViewSonic
- BenQ
- CleverTouch
- Smart Technologies
- Epson
- Hitachi
- Panasonic
- LG
- Samsung
- Sharp
- Ricoh
- Mimio
- QOMO
- Avocor
- TouchIT
- Boxlight
- Triumph Board
- Interactive Technologies
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by Wriety - Enhancing educational technology solutions.