Сделал экраны Проведения покупки
This commit is contained in:
@@ -31,6 +31,7 @@ const Color textBorderColor = const Color(0xffcfd8dc);
|
|||||||
const Color textFieldBackground = const Color(0xffefefef);
|
const Color textFieldBackground = const Color(0xffefefef);
|
||||||
const Color tokenActiveTextColor = const Color(0xff1f5a1f);
|
const Color tokenActiveTextColor = const Color(0xff1f5a1f);
|
||||||
const Color tokenActivateTextColor = const Color(0xff4e3a19);
|
const Color tokenActivateTextColor = const Color(0xff4e3a19);
|
||||||
|
const Color greenBackground = const Color(0xff8ae28a);
|
||||||
|
|
||||||
// Margins
|
// Margins
|
||||||
const double verticalMargin = 28.0;
|
const double verticalMargin = 28.0;
|
||||||
@@ -71,6 +72,7 @@ startScanner(BuildContext context) async {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Navigator.of(context).pop();
|
||||||
await platform.invokeMethod('startScanner');
|
await platform.invokeMethod('startScanner');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class PurchaseScreenState<T> extends BaseState<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override Widget getScreenContent() {
|
@override Widget getScreenContent() {
|
||||||
return new Container(height: 398.0,
|
return new Container(height: 412.0,
|
||||||
child: new ListView(reverse: true, children: <Widget>[
|
child: new ListView(reverse: true, children: <Widget>[
|
||||||
new Column(children: <Widget>[
|
new Column(children: <Widget>[
|
||||||
getValueWithTitle('ФИО', 'Знаменитый Рокер Паук'),
|
getValueWithTitle('ФИО', 'Знаменитый Рокер Паук'),
|
||||||
@@ -40,38 +40,33 @@ class PurchaseScreenState<T> extends BaseState<T> {
|
|||||||
getValueWithTitle('Вознаграждение', '100%'),
|
getValueWithTitle('Вознаграждение', '100%'),
|
||||||
getHintLabel(),
|
getHintLabel(),
|
||||||
getDecoratedTextWidget(),
|
getDecoratedTextWidget(),
|
||||||
getApprovePurchaseButton(context),
|
buildButton(new EdgeInsets.only(top: 36.0, left: 70.0, right: 70.0), buildRaisedButton(context, 'ЗАВЕРШИТЬ ПОКУПКУ', () => _purchase(context))),
|
||||||
buildScanButton(context)])
|
buildButton(new EdgeInsets.only(top: 24.0, left: 70.0, right: 70.0), buildFlatButton(context, 'СКАНИРОВАТЬ', primaryColor))])
|
||||||
].reversed.toList()));
|
].reversed.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget getValueWithTitle(String title, String value) {
|
Widget getValueWithTitle(String title, String value) {
|
||||||
return new Container(padding: new EdgeInsets.only(left: verticalMargin, right: verticalMargin, top: 12.0),
|
return new Container(padding: new EdgeInsets.only(left: verticalMargin, right: verticalMargin, top: 18.0),
|
||||||
child: new Column(children: <Widget>[
|
child: new Column(children: <Widget>[
|
||||||
new Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[new Text(title, textAlign: TextAlign.left, style: new TextStyle(color: greyTextColor, fontSize: 14.0))]),
|
new Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[new Text(title, textAlign: TextAlign.left, style: new TextStyle(color: greyTextColor, fontSize: 14.0))]),
|
||||||
new Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[new Text(value, textAlign: TextAlign.left, style: new TextStyle(color: Colors.black, fontSize: 20.0))])
|
new Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[new Text(value, textAlign: TextAlign.left, style: new TextStyle(color: Colors.black, fontSize: 20.0))])
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget getApprovePurchaseButton(BuildContext context) {
|
Widget buildButton(EdgeInsets margin, Widget widget) {
|
||||||
return new Container(margin: new EdgeInsets.only(top: 36.0), height: 44.0,
|
return new Container(margin: margin, height: 48.0, child: new Row(children: <Widget>[new Expanded(child: widget)]));
|
||||||
child: new RaisedButton(child: new Text('ЗАВЕРШИТЬ ПОКУПКУ',
|
}
|
||||||
|
|
||||||
|
Widget buildRaisedButton(BuildContext context, String text, VoidCallback onPressed) {
|
||||||
|
return new RaisedButton(child: new Text(text,
|
||||||
style: new TextStyle(color: Colors.white)),
|
style: new TextStyle(color: Colors.white)),
|
||||||
onPressed: () => _purchase(context),
|
onPressed: onPressed,
|
||||||
color: primaryColor));
|
color: primaryColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildScanButton(BuildContext context) {
|
Widget buildFlatButton(BuildContext context, String title, Color textColor) {
|
||||||
return new Container(margin: new EdgeInsets.only(top: 24.0, left: 70.0, right: 70.0), child: _getScanButtonRow(context));
|
return new Container(height: 48.0, child: new FlatButton(child: new Text(title,
|
||||||
}
|
style: new TextStyle(color: textColor)),
|
||||||
|
|
||||||
Widget _getScanButtonRow(BuildContext context) {
|
|
||||||
return new Row(children: <Widget>[new Expanded(child: _getScanButton(context))]);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _getScanButton(BuildContext context) {
|
|
||||||
return new Container(height: 44.0, child: new FlatButton(child: new Text('СКАНИРОВАТЬ',
|
|
||||||
style: new TextStyle(color: primaryColor)),
|
|
||||||
onPressed: () => startScanner(context)),
|
onPressed: () => startScanner(context)),
|
||||||
decoration: _getDecoraionForScanButton());
|
decoration: _getDecoraionForScanButton());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,12 +27,16 @@ class _PurchaseSuccessScreenState<T> extends PurchaseScreenState<T> {
|
|||||||
return new Column(children: <Widget>[
|
return new Column(children: <Widget>[
|
||||||
getValueWithTitle('Покупатель', 'Знаменитый Рокер Паук'),
|
getValueWithTitle('Покупатель', 'Знаменитый Рокер Паук'),
|
||||||
_getSuccessMessage(),
|
_getSuccessMessage(),
|
||||||
getApprovePurchaseButton(context)
|
new Expanded(child: new Center()),
|
||||||
|
buildButton(new EdgeInsets.only(bottom: 74.0, left: 70.0, right: 70.0), buildRaisedButton(context, 'СКАНИРОВАТЬ', () => startScanner(context)))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
_getSuccessMessage() {
|
_getSuccessMessage() {
|
||||||
return new Container(height: 64.0, decoration: new BoxDecoration(color: const Color(0x8ae28aff)), child: new Text('Покупка на сумму 1234.00 руб. проведена', style: new TextStyle(color: tokenActiveTextColor)));
|
return new Row(children: <Widget>[new Expanded(child: new Container(margin: new EdgeInsets.only(top: 20.0), height: 64.0,
|
||||||
|
decoration: new BoxDecoration(color: greenBackground),
|
||||||
|
child: new Center(child: new Text('Покупка на сумму 1234.00 руб. проведена', textAlign: TextAlign.center,
|
||||||
|
style: new TextStyle(fontWeight: FontWeight.bold, color: tokenActiveTextColor)))))]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user