rawg_dart_wrapper 1.0.0 copy "rawg_dart_wrapper: ^1.0.0" to clipboard
rawg_dart_wrapper: ^1.0.0 copied to clipboard

A Dart package to let users easily integrate RAWG API.

example/main.dart

import 'dart:async';
import 'package:rawg_dart_wrapper/rawg_dart_wrapper.dart';

Future<dynamic> main() async {
  // Initialize
  Rawg(apiKey: "0000000000000000");
  // now you can use the static methods

  // get all games
  List<Game> games = await Rawg.getGames(page: 1);

  List<Game> games2 = await Rawg.getGames(order: Ordering.released); // custom order

  // search for games
  games2 = await Rawg.getGames(query: "Call of duty");

  // get details
  Game detail = await Rawg.getGameDetails(id: games2.first.id);

  // get the genres
  List<Genre> genres = await Rawg.getGenres();

  // get the platform
  List<Platform> platforms = await Rawg.getPlatforms();

  // get the achievement for game
  List<Achievement> achievement = await Rawg.getAchievements(id: games.first.id);

  achievement = await Rawg.getAchievements(id: games.first.id);

  print(games);
  print(detail);
  print(platforms);
  print(genres);
  print(achievement);
}
1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A Dart package to let users easily integrate RAWG API.

Homepage
Repository (GitHub)
View/report issues

Topics

#api #wrapper #games #rawg

License

unknown (LICENSE)

Dependencies

dio

More

Packages that depend on rawg_dart_wrapper