fonoapi_dart 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 66

A dart client for FonoAPI.

This is a small API which can provide descriptions of Mobile Devices such as model, brand, processor, weight etc. https://fonoapi.freshpixl.com/

This is an API which can provide mobile device descriptions such as model, brand, CPU, GPU, dimensions, release date etc. It might be helpful if you are building a website like GSMArena, PhoneArena or something similar. This API contains a database of a mobile device descriptions of Android, iOS and some old phones too.. :D

API #

API URL: https://fonoapi.freshpixl.com/v1/

Method getdevice (https://fonoapi.freshpixl.com/v1/getdevice)

Available options

  • brand - Pass the Mobile Device Brand (example : "Samsung", "OnePlus")
  • model - Pass the device name (example : "S10", "G7") This might result multiple results at a time.
  • position - When a set of results is returned you can get a specific device by passing the position of your device on the result set. count starts from 0
  • token - You will need a token to access the Api. no registration, nothing, just grab the key. You can get it here https://fonoapi.freshpixl.com/token/generate

Available options

  • brand - It gives the latest you can filter the brand (example : "samsung", "htc")
  • limit - Limit the result count (Max 100)
  • token* - You will need a token to access the Api. no registration, nothing, just grab the key.
    You can get it here https://fonoapi.freshpixl.com/token/generate

Note: the API will return only 100 devices per request

Usage #

A simple usage example:

import 'package:fonoapi_dart/fonoapi_dart.dart';

main() async {
    String token = "YOUR_API_TOKEN";
  
    final FonoApi fonoApi = FonoApi(token);
  
    final List<Device> devices = await fonoApi.getDevices(
      brand: "Samsung",
      model: "S10",
    );

}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.0 #

  • Initial version.

0.1.1, 0.1.1+1 #

  • Update README.md

0.1.2+1 #

  • Add tests and exceptions

0.1.2+2 #

  • Update description

0.1.3 #

  • Update dependencies for compatibility with older Flutter versions

example/fonoapi_dart_example.dart

import 'package:fonoapi_dart/fonoapi_dart.dart';
import 'package:fonoapi_dart/src/models/device.dart';

import 'secrets.dart';

main() async {
  final FonoApi fonoApi = FonoApi(token);

  final List<Device> devices =
      await fonoApi.getDevices(brand: "Samsung", model: "S10");

  devices.forEach(print);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fonoapi_dart: ^0.1.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:fonoapi_dart/fonoapi_dart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
40
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

We analyzed this package on Apr 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: meta.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
http ^0.12.0+2 0.12.0+4
meta any 1.1.8
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.12
http_parser 3.1.4
path 1.6.4
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.8.0+1 1.9.0
test ^1.9.2