greip 1.1.0
greip: ^1.1.0 copied to clipboard
The official Flutter package for the Greip API simplifies the integration of Greip services into Flutter applications.
Example #
This example demonstrates how to use the Greip package in a Flutter application.
Getting Started #
-
Add the Greip package to your
pubspec.yaml
file:dependencies: greip: ^1.1.0
copied to clipboard -
Import the Greip package in your Dart code:
import 'package:greip/greip.dart';
copied to clipboard -
Import the Enums you need:
import 'package:greip/src/enums/mode.dart'; import 'package:greip/src/enums/param.dart'; import 'package:greip/src/enums/language.dart';
copied to clipboard -
Initialize the Greip package and use its functionalities:
void main() { Greip greip = Greip(); greip.setToken('your-greip-token'); try { Map<String, dynamic> result = await greip.geoIp(params: [ Param.security, Param.currency, Param.timezone, Param.location, ], lang: Language.en, mode: Mode.live); print(result); } catch (e) { print('Error: $e'); } }
copied to clipboard -
Run your Flutter application to see the package in action.
Additional Information #
- For detailed API documentation, refer to the official API reference.
- Check out the tests included in the package for usage examples.