На экране проведения покупки правильно обрабатывается сумма покупки, передается на экран подтверждения
This commit is contained in:
@@ -7,10 +7,23 @@ import 'purchase.dart';
|
||||
|
||||
/// Экран проведения покупки.
|
||||
class PurchaseSuccessScreen extends StatefulWidget {
|
||||
@override State createState() => new _PurchaseSuccessScreenState();
|
||||
|
||||
String val = '';
|
||||
|
||||
PurchaseSuccessScreen(String val) {
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
@override State createState() => new PurchaseSuccessScreenState(val);
|
||||
}
|
||||
|
||||
class _PurchaseSuccessScreenState<T> extends PurchaseScreenState<T> {
|
||||
class PurchaseSuccessScreenState<T> extends PurchaseScreenState<T> {
|
||||
|
||||
String val = '';
|
||||
|
||||
PurchaseSuccessScreenState(String val) {
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
@override String getTitle() {
|
||||
return "Проведение покупки";
|
||||
@@ -25,17 +38,17 @@ class _PurchaseSuccessScreenState<T> extends PurchaseScreenState<T> {
|
||||
|
||||
@override Widget getScreenContent() {
|
||||
return new Column(children: <Widget>[
|
||||
getValueWithTitle('Покупатель', 'Знаменитый Рокер Паук'),
|
||||
_getSuccessMessage(),
|
||||
new Expanded(child: new Center()),
|
||||
buildButton(new EdgeInsets.only(bottom: 74.0, left: 70.0, right: 70.0), buildRaisedButton(context, 'СКАНИРОВАТЬ', () => startScanner(context)))
|
||||
]);
|
||||
getValueWithTitle('Покупатель', 'Знаменитый Рокер Паук'),
|
||||
getSuccessMessage(),
|
||||
new Expanded(child: new Center()),
|
||||
buildButton(new EdgeInsets.only(bottom: 74.0, left: buttonVerticalMargin, right: buttonVerticalMargin), buildRaisedButton(context, 'СКАНИРОВАТЬ', () => startScanner(context)))
|
||||
]);
|
||||
}
|
||||
|
||||
_getSuccessMessage() {
|
||||
getSuccessMessage() {
|
||||
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,
|
||||
child: new Center(child: new Text('Покупка на сумму ${val} руб. проведена', textAlign: TextAlign.center,
|
||||
style: new TextStyle(fontWeight: FontWeight.bold, color: tokenActiveTextColor)))))]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user