Easily display Magic: The Gathering symbols as Flutter widgets!
Example
Develop custom MTG Flutter widgets easily with full support for all MTG symbols:

Features
- SVGs for all MTG symbols - "Un" sets included!
- Easy class and methods to display any of the MTG symbols as a Flutter widget
- Works on Android, iOS, Linux, MacOS, Web, Windows
Getting started
First, import the library in one of your files.
import 'package:mtg_symbology/mtg_symbology.dart';
Retrieve an MtgSymbol instance using the mtgSymbology Map.
Then call its toSvg method to convert the MtgSymbol object into an SvgPicture widget.
API
MtgSymbol
Represents a single Magic: The Gathering symbol.
Methods
| Method | Description | Return Type |
|---|---|---|
| toSvg | Converts the MtgSymbol object into an SVG widget | SvgPicture |
Properties
| Property | Description | Return Type |
|---|---|---|
| regex | Matches text that can be converted to an MtgSymbol | RegExp |
mtgSymbology
A Map of String keys and MtgSymbol instance values. The keys are based on the notation used in Magic: The Gathering's Comprehensive Rules.
Example
final symbol = mtgSymbology['{W}']!;
final symbolSvg = symbol.toSvg();
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text('Mtg Symbology Example'),
),
body: SafeArea(
child: Center(child: symbolSvg),
),
);
For a more detailed example, look in the example directory.
Contributing
Contributions are welcome, but keep in mind that the scope of this package will stay limited to just providing the SVG assets and the ways to display them.
In order for a contribution to be considered, it must follow the linter rules defined in the analysis_options file.
Legal
As part of the Wizards of the Coast Fan Content Policy, this package is provided free of charge to view, access, share, and use without paying for anything, obtaining any approval, or giving anyone credit.
mtg_symbology 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.