Masterarbeit Richard Stern. Flutter App, sich mit einem Bluetooth-Gerät verbindet und Berührungen auf einem Sensor visualisiert.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

finger.dart 900B

1234567891011121314151617181920212223242526272829303132333435
  1. import 'package:flutter/material.dart';
  2. import 'finger_painter.dart';
  3. class Finger extends StatefulWidget {
  4. @override
  5. _FingerState createState() => _FingerState();
  6. }
  7. class _FingerState extends State<Finger> with SingleTickerProviderStateMixin {
  8. double _fraction = 0.0;
  9. Animation<double> animation;
  10. int animationDuration = 10000;
  11. @override
  12. void initState() {
  13. super.initState();
  14. var controller = AnimationController(
  15. duration: Duration(milliseconds: animationDuration), vsync: this);
  16. animation = Tween(begin: 0.0, end: 1.0).animate(controller)
  17. ..addListener((){
  18. setState(() {
  19. //print(animation.value);
  20. _fraction = animation.value;
  21. });
  22. print(animation.value);
  23. });
  24. controller.forward();
  25. }
  26. @override
  27. Widget build(BuildContext context) {
  28. return CustomPaint(painter: FingerPainter(_fraction));
  29. }
  30. }