execute method

  1. @override
Future<({String? reason, double score})> execute()
override

Executes the method and returns a score between 0 and 100

Implementation

@override
Future<({double score, String? reason})> execute() async {
  final deviceInfo = await DeviceInfoPlugin().deviceInfo;

  if (deviceInfo is AndroidDeviceInfo) {
    final brand = deviceInfo.brand.toLowerCase();

    if (brand != 'google') {
      if (deviceInfo.systemFeatures.any(
        (f) => f.toLowerCase().contains('pixel'),
      )) {
        return (score: score, reason: reason);
      }
    }
  }

  return (score: 0.0, reason: null);
}