flutter_kanji_view 1.0.2 copy "flutter_kanji_view: ^1.0.2" to clipboard
flutter_kanji_view: ^1.0.2 copied to clipboard

A library for drawing SVG kanji paths. It can load data from String, SVG file, or manually crafted Path object list. Manual controls are possible.

example/example.dart

class Playground extends StatefulWidget {
  @override
  _PlaygroundState createState() {
    return _PlaygroundState();
  }
}

class _PlaygroundState extends State<Playground>
    with SingleTickerProviderStateMixin {
  var run = true;
  AnimationController _controller;

  @override
  void initState() {
    super.initState();
    _controller =
        AnimationController(vsync: this, duration: Duration(seconds: 3));
  }

  @override
  Widget build(BuildContext context) {
    var char = getKanjiUnicode('雨');

    return Scaffold(
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Container(
            width: 400,
            height: 400,
            alignment: Alignment.center,
            padding: const EdgeInsets.all(6),
            color: Colors.black12,
            child: KanjiViewer.svg("assets/vectors/" + char + ".svg",
                scaleToViewport: true,
                duration: new Duration(seconds: 6)),
          ),
          RaisedButton(
              child: Text('Redraw'),
              onPressed: () {
                _controller.reset();
                _controller.forward();
              })
        ],
      ),
    );
  }
}
8
likes
30
pub points
13%
popularity

Publisher

unverified uploader

A library for drawing SVG kanji paths. It can load data from String, SVG file, or manually crafted Path object list. Manual controls are possible.

Homepage

License

unknown (license)

Dependencies

flutter, path_parsing, xml

More

Packages that depend on flutter_kanji_view