flutter_class_parser 0.0.2
flutter_class_parser: ^0.0.2 copied to clipboard

Flutter Android iOS Linux macOS web Windows

A package for serialize and deserialize common UI data classes in Flutter.

flutter_class_parser #

A package for serialize and deserialize common UI data classes in Flutter.

Getting Started #

To serialize/deserialize a supported class, use:

var gradient=LinearGradient(colors:[Colors.red, Colors.blue]);
String gradientJson=json.encode(gradient.toJson());
var gradient2=parseGradient(json.decode(gradientJson));

Supported Classes #

Color
BlendMode
TileMode
AlignmentGeometry
BoxFit
ImageRepeat
FilterQuality
StackFit
FontWeight
FontStyle
Axis
TextDecoration
TextDecorationStyle
Clip
Curve
TextAlign
MainAxisAlignment
CrossAxisAlignment
WrapAlignment
WrapCrossAlignment
Offset
Size
Rect
Radius
BorderRadius
Gradient
ColorFilter
DecorationImage
BoxDecoration
TextStyle

Some class parsing is not fully supported yet. For example, the Curve class parsing only supports some of the predefined curves.

You can more than welcome to contribute and add more classes to the collection.

2
likes
90
pub points
51%
popularity

Publisher

wenkaifan.com

A package for serialize and deserialize common UI data classes in Flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_class_parser