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.

StartPage.dart 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import 'package:flutter/material.dart';
  2. import 'package:touch_demonstrator/ui/pageTouchPoints/uiComponents.dart';
  3. import 'package:touch_demonstrator/ui/pageTouchPoints/Logo.dart';
  4. EdgeInsets devicePadding;
  5. class StartPage extends StatelessWidget {
  6. @override
  7. Widget build(BuildContext context) {
  8. devicePadding = MediaQuery.of(context).padding;
  9. return Scaffold(
  10. appBar: AppBar(
  11. leading: null,
  12. title: Text('Demo App'),
  13. ),
  14. body: SafeArea(child: OrientationBuilder(builder: (context, orientation) {
  15. return orientation == Orientation.portrait
  16. ? _buildVerticalLayout(context)
  17. : _buildHorizontalLayout(context);
  18. })),
  19. );
  20. }
  21. }
  22. const heightLogo = 100.0;
  23. _buildVerticalLayout(BuildContext context) => Padding(
  24. padding: const EdgeInsets.only(left: 10.0, right: 10.0),
  25. child: Center(
  26. child: Column(
  27. mainAxisAlignment: MainAxisAlignment.start,
  28. children: <Widget>[
  29. Container(
  30. height: devicePadding.top,
  31. ),
  32. TextAboveLogo(),
  33. Logo(heightLogo),
  34. TouchPad(),
  35. // Sensor(),
  36. Button(),
  37. ],
  38. ),
  39. ),
  40. );
  41. _buildHorizontalLayout(BuildContext context) => Padding(
  42. padding: const EdgeInsets.only(left: 10.0, right: 10.0),
  43. child: Row(
  44. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  45. children: <Widget>[
  46. TouchPad(),
  47. // Sensor(),
  48. Center(
  49. child: Column(
  50. mainAxisAlignment: MainAxisAlignment.center,
  51. children: <Widget>[
  52. TextAboveLogo(),
  53. Logo(heightLogo),
  54. Button(),
  55. ],
  56. ),
  57. ),
  58. ],
  59. ));