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

A Dart & Flutter package to enable users to easily integrate the RAWG API and easily get details on games, trophies, platforms and more.

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

  // get the screenshot
  List<String> screen = await Rawg.getScreenshot(gameID: games2.first.id);

  // 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(screen);
  print(platforms);
  print(genres);
  print(achievement);
}
1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A Dart & Flutter package to enable users to easily integrate the RAWG API and easily get details on games, trophies, platforms and more.

Repository (GitHub)
View/report issues

Topics

#api #wrapper #games #rawg

License

unknown (LICENSE)

Dependencies

dio

More

Packages that depend on rawg_dart_wrapper