flutter_kanji_view 1.0.2 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.
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();
})
],
),
);
}
}