scryfall_api 0.3.0
scryfall_api: ^0.3.0 copied to clipboard
A wrapper of the Scryfall API for the Dart programming language.
A wrapper of the Scryfall API for the Dart programming language.
Features #
Query all information about Magic: The Gathering which is provided by the Scryfall API:
- Sets
- Cards
- Rulings
- Card Symbols (planned for v0.4.0)
- Catalogs (planned for v0.5.0)
- Bulk data (planned for v0.6.0)
Installation #
To install this package, just add the scryfall_api
package to your pubspec.yaml
file:
dependencies:
scryfall_api: ^0.3.0
Don't forget to install it by running dart pub get
or flutter pub get
.
After successfully installing the scryfall_api
package, it can be imported with:
import 'package:scryfall_api/scryfall_api.dart';
Usage #
Retrieve the Adventures in the Forgotten Realms set by its unique code (afr
):
final client = ScryfallApiClient();
// [GET] https://api.scryfall.com/sets/afr
final afrSet = await client.getSetByCode('afr'); // MtgSet
afrSet.name // -> 'Adventures in the Forgotten Realms'
Retrieve the Black Lotus card by its id
on Scryfall:
final client = ScryfallApiClient();
// [GET] https://api.scryfall.com/cards/bd8fa327-dd41-4737-8f19-2cf5eb1f7cdd
final blackLotus = await client.getCardById('bd8fa327-dd41-4737-8f19-2cf5eb1f7cdd'); // MtgCard
blackLotus.name // -> 'Black Lotus'
blackLotus.oracleText // -> '{T}, Sacrifice Black Lotus: Add three mana of any one color.'
Features and bugs #
If you encounter a bug or want to file a feature request, feel free to
- open a new issue or
- create a pull request.
Additional information #
The Scryfall API package is unofficial Fan Content permitted under the Fan Content Policy. Not approved/endorsed by Wizards. Portions of the materials used are property of Wizards of the Coast. © Wizards of the Coast LLC.
All the information, literal and graphical, obtained from the Scryfall API which is not © Wizards of the Coast LLC is © Scryfall LLC.
The remaining part of this package is subject to its associated license.