mtg_symbology 1.0.3 copy "mtg_symbology: ^1.0.3" to clipboard
mtg_symbology: ^1.0.3 copied to clipboard

Easily display Magic: The Gathering symbols as Flutter SVG widgets.

Easily display Magic: The Gathering symbols as Flutter widgets!

Example #

Develop custom MTG Flutter widgets easily with full support for all MTG symbols:

Image showing all of the supported symbols

Features #

  • SVG assets for all MTG symbols - "Un" sets included!
  • Easy way to display any of these symbols as a Flutter widget
  • Minimal external dependencies - only flutter_svg is used
  • Works on Android, iOS, Linux, MacOS, Web, and 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.

final symbol = mtgSymbology['{W}']!;

Then call its toSvg method to convert the MtgSymbol object into an SvgPicture widget.

final symbolSvg = symbol.toSvg();

Finally, display it in your app like you would any other SvgPicture widget!

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.

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.

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.

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.

0
likes
160
points
217
downloads

Publisher

verified publisherzmuranaka.dev

Weekly Downloads

Easily display Magic: The Gathering symbols as Flutter SVG widgets.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_svg

More

Packages that depend on mtg_symbology