MtgCard class

Represents a full Magic: The Gathering card. If the card has multiple faces, each of its faces is represented by an MtgCardFace instance in cardFaces.

Inheritance

Constructors

MtgCard.fromMap(Map m)
Convert a map to an MtgCard instance. The intended use case is to store or request JSON data and convert that to a Dart Map, then pass that to this constructor.

Properties

artist String?
The name of the illustrator of this card face, such as 'Raymond Swanland'.
finalinherited
cardFaces List<MtgCardFace>?
All of the card's faces as a List of MtgCardFace instances. This will be null if the card does not have any faces (it will never be an empty List).
final
flavorText String?
The flavor text printed on this face, if any.
finalinherited
hashCode int
Necessary for == to work properly.
no setteroverride
hasMultipleFaces bool
Returns true if the card has multiple faces
no setter
images Map<String, String>?
A Map of image URLs for this face.
finalinherited
keywords List<String>
A List of keywords that this card uses, such as 'Flying' and 'Cumulative upkeep'.
final
language String
A language code for this printing.
final
manaCost String?
The mana cost for this face. This value should be any empty String '' if the cost is absent. Remember that per the game rules, a missing mana cost and a mana cost of {0} are different values.
finalinherited
manaValue double?
The mana value of this particular face. This is a double because some "Un" set cards have fractional mana values.
finalinherited
name String
The name of this face, such as 'Spawnsire of Ulamog'.
finalinherited
oracleText String?
The Oracle text for this face, if any.
finalinherited
power String?
This face's power, if any. This is a String because some cards have powers that are not numeric, such as '*'.
finalinherited
rarity Rarity
This card's rarity as a Rarity.
final
releasedAt DateTime
The date this card was first released.
final
reserved bool
Whether this card is on the Reserved List.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setCode String
This card's set code, such as 'blb' for Bloomburrow.
final
setName String
This card's full set name, such as 'Bloomburrow'.
final
toughness String?
This face's toughness, if any. This is a String because some cards have toughnesses that are not numeric, such as '*'.
finalinherited
typeLine String
The type line of this particular face, such as 'Legendary Artifact'.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preparedManaCost({EdgeInsets? padding = const EdgeInsets.symmetric(horizontal: 1.5)}) List<Widget>?
Returns a visual representation of the manaCost using SVGs for valid MTG symbols. Returns null if manaCost is null or it doesn't contain any valid MTG symbols.
inherited
preparedOracleText() TextSpan?
Returns a visual representation of the oracleText using SVGs for valid MTG symbols. Returns null if oracleText is null.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
Allows two instances of MtgCard to be considered equal if the relevant properties are equal.
override

Constants

cornerRatio → const int
Ratio of card height / corner radius: 3.5 inches / (1/8 inch)
sizeRatio → const double
Ratio of card height / width : 3.5 inches / 2.5 inches