2017-05-14 00:28:28 -04:00
|
|
|
/*
|
2017-05-14 01:01:02 -04:00
|
|
|
* fluro
|
2018-10-25 13:48:02 -04:00
|
|
|
* Created by Yakka
|
|
|
|
* https://theyakka.com
|
|
|
|
*
|
|
|
|
* Copyright (c) 2018 Yakka, LLC. All rights reserved.
|
2017-05-14 00:28:28 -04:00
|
|
|
* See LICENSE for distribution and usage details.
|
|
|
|
*/
|
2017-05-28 13:13:36 -04:00
|
|
|
import '../../helpers/color_helpers.dart';
|
2017-05-14 00:28:28 -04:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2017-05-28 13:13:36 -04:00
|
|
|
class DemoSimpleComponent extends StatelessWidget {
|
2018-07-27 21:15:51 -04:00
|
|
|
DemoSimpleComponent(
|
|
|
|
{String message = "Testing",
|
|
|
|
Color color = const Color(0xFFFFFFFF),
|
|
|
|
String result})
|
2017-05-14 00:28:28 -04:00
|
|
|
: this.message = message,
|
2017-10-13 20:10:21 -04:00
|
|
|
this.color = color,
|
|
|
|
this.result = result;
|
2017-05-14 00:28:28 -04:00
|
|
|
|
|
|
|
final String message;
|
|
|
|
final Color color;
|
2017-10-13 20:10:21 -04:00
|
|
|
final String result;
|
2017-05-14 00:28:28 -04:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return new Material(
|
|
|
|
color: color,
|
|
|
|
child: new Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
new Image(
|
|
|
|
image: new AssetImage("assets/images/acc_boom.png"),
|
|
|
|
color: ColorHelpers.blackOrWhiteContrastColor(color),
|
2018-01-17 00:12:32 -05:00
|
|
|
width: 260.0,
|
|
|
|
),
|
2017-05-14 00:28:28 -04:00
|
|
|
new Padding(
|
|
|
|
padding: new EdgeInsets.only(left: 50.0, right: 50.0, top: 15.0),
|
|
|
|
child: new Text(
|
|
|
|
message,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: new TextStyle(
|
|
|
|
color: ColorHelpers.blackOrWhiteContrastColor(color),
|
|
|
|
height: 2.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
new Padding(
|
|
|
|
padding: new EdgeInsets.only(top: 15.0),
|
2018-01-17 00:12:32 -05:00
|
|
|
child: new ConstrainedBox(
|
|
|
|
constraints: new BoxConstraints(minHeight: 42.0),
|
|
|
|
child: new FlatButton(
|
2018-07-27 21:15:51 -04:00
|
|
|
highlightColor:
|
|
|
|
ColorHelpers.blackOrWhiteContrastColor(color).withAlpha(17),
|
|
|
|
splashColor:
|
|
|
|
ColorHelpers.blackOrWhiteContrastColor(color).withAlpha(34),
|
2018-01-17 00:12:32 -05:00
|
|
|
onPressed: () {
|
|
|
|
if (result == null) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
} else {
|
|
|
|
Navigator.pop(context, result);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: new Text(
|
|
|
|
"OK",
|
|
|
|
style: new TextStyle(
|
|
|
|
fontSize: 18.0,
|
|
|
|
color: ColorHelpers.blackOrWhiteContrastColor(color),
|
|
|
|
),
|
2017-05-14 00:28:28 -04:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2018-07-27 21:15:51 -04:00
|
|
|
}
|