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.

FingerPrintRow.dart 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import 'package:flutter/material.dart';
  2. import 'package:touch_demonstrator/model/touchData.dart';
  3. class FingerPrintRow extends StatefulWidget {
  4. final TouchData touch;
  5. FingerPrintRow(this.touch);
  6. @override
  7. _FingerPrintRowState createState() => _FingerPrintRowState();
  8. }
  9. class _FingerPrintRowState extends State<FingerPrintRow> {
  10. @override
  11. Widget build(BuildContext context) {
  12. return Container(
  13. height: 140.0,
  14. margin: const EdgeInsets.symmetric(
  15. vertical: 16.0,
  16. horizontal: 24.0,
  17. ),
  18. child: Column(
  19. children: <Widget>[
  20. Row(
  21. mainAxisAlignment: MainAxisAlignment.spaceAround,
  22. children: <Widget>[
  23. fingerPrintThumbnail,
  24. _buildTouchCard(),
  25. ],
  26. ),
  27. ],
  28. ),
  29. );
  30. }
  31. Container buildTextFinger() => Container(
  32. child: Text("${widget.touch.fingerNumber}"),
  33. );
  34. final fingerPrintThumbnail = new Container(
  35. margin: new EdgeInsets.symmetric(vertical: 16.0),
  36. alignment: FractionalOffset.centerLeft,
  37. child: new Container(
  38. width: 50.0,
  39. height: 50.0,
  40. decoration: new BoxDecoration(
  41. shape: BoxShape.circle,
  42. image: new DecorationImage(
  43. fit: BoxFit.cover,
  44. image: new AssetImage("lib/assets/fingerPrint2.png"))),
  45. ),
  46. );
  47. Widget _buildTouchCard(){
  48. return Container(
  49. child: Row(
  50. mainAxisAlignment: MainAxisAlignment.start,
  51. children: <Widget>[
  52. Padding(
  53. padding: const EdgeInsets.all(8.0),
  54. child: Column(
  55. children: <Widget>[
  56. Text("Finger #"),
  57. Text("${widget.touch.fingerNumber}"),
  58. ],
  59. ),
  60. ),
  61. Padding(
  62. padding: const EdgeInsets.all(8.0),
  63. child: Column(
  64. children: <Widget>[
  65. Text("Event"),
  66. Text("${widget.touch.event}"),
  67. ],
  68. ),
  69. ),
  70. Padding(
  71. padding: const EdgeInsets.all(8.0),
  72. child: Column(
  73. children: <Widget>[
  74. Text("X"),
  75. Text("${widget.touch.x}"),
  76. ],
  77. ),
  78. ),
  79. Padding(
  80. padding: const EdgeInsets.all(8.0),
  81. child: Column(
  82. children: <Widget>[
  83. Text("Y"),
  84. Text("${widget.touch.y}"),
  85. ],
  86. ),
  87. ),
  88. ],
  89. ),
  90. );
  91. }
  92. }