demo_simple_component.dart 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * fluro
  3. * A Posse Production
  4. * http://goposse.com
  5. * Copyright (c) 2017 Posse Productions LLC. All rights reserved.
  6. * See LICENSE for distribution and usage details.
  7. */
  8. import '../../helpers/color_helpers.dart';
  9. import 'package:flutter/material.dart';
  10. class DemoSimpleComponent extends StatelessWidget {
  11. DemoSimpleComponent({String message = "Testing", Color color = const Color(0xFFFFFFFF), String result})
  12. : this.message = message,
  13. this.color = color,
  14. this.result = result;
  15. final String message;
  16. final Color color;
  17. final String result;
  18. @override
  19. Widget build(BuildContext context) {
  20. return new Material(
  21. color: color,
  22. child: new Column(
  23. mainAxisAlignment: MainAxisAlignment.center,
  24. children: [
  25. new Image(
  26. image: new AssetImage("assets/images/acc_boom.png"),
  27. color: ColorHelpers.blackOrWhiteContrastColor(color),
  28. width: 350.0,
  29. ),
  30. new Padding(
  31. padding: new EdgeInsets.only(left: 50.0, right: 50.0, top: 15.0),
  32. child: new Text(
  33. message,
  34. textAlign: TextAlign.center,
  35. style: new TextStyle(
  36. color: ColorHelpers.blackOrWhiteContrastColor(color),
  37. height: 2.0,
  38. ),
  39. ),
  40. ),
  41. new Padding(
  42. padding: new EdgeInsets.only(top: 15.0),
  43. child: new FlatButton(
  44. onPressed: () {
  45. if (result == null) {
  46. Navigator.pop(context);
  47. } else {
  48. Navigator.pop(context, result);
  49. }
  50. },
  51. child: new Text(
  52. "OK",
  53. style: new TextStyle(
  54. fontSize: 18.0,
  55. color: ColorHelpers.blackOrWhiteContrastColor(color),
  56. ),
  57. ),
  58. ),
  59. ),
  60. ],
  61. ),
  62. );
  63. }
  64. }