This was originally built by Bolaji Ayodeji so all rights goes to him, I only interpreted the javascript code to Dart
Add the dependency to your pubspec.yaml
dependencies:
nettyfinder: <latest-version>
// Import the package
import 'package:nettyfinder/nettyfinder.dart';
void main() {
// This is a callable class
// Just instantiate the class with the number
var netFinder = NetworkTypeDetect("+2347012345678");
// Return null if number is valid but not recognized else throw a descriptive exception
print('Network Type: ${netFinder() ?? 'Not a recognized number'}');
}
Contributions are welcome.