Получение информации о пользователе, разные исправления

This commit is contained in:
Ivan Murashov
2017-07-25 21:27:50 +03:00
parent 8738fbfd39
commit 313dc307dc
16 changed files with 290 additions and 161 deletions

View File

@@ -8,21 +8,22 @@ import 'purchase.dart';
/// Экран проведения покупки.
class PurchaseSuccessScreen extends StatefulWidget {
String val = '';
PurchaseSuccessScreen(this.val, this.name);
String val;
String name;
PurchaseSuccessScreen(String val) {
this.val = val;
}
@override State createState() => new PurchaseSuccessScreenState(val);
@override State createState() => new PurchaseSuccessScreenState(val, name);
}
class PurchaseSuccessScreenState<T> extends PurchaseScreenState<T> {
class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
String val = '';
PurchaseSuccessScreenState(this.sum, this.username);
PurchaseSuccessScreenState(String val) {
this.val = val;
String sum;
String username;
@overide getMenuButtons(BuildContext context) {
return <Widget>[getFaqButton(), getLogoutButton()];
}
@override String getTitle() {
@@ -31,7 +32,7 @@ class PurchaseSuccessScreenState<T> extends PurchaseScreenState<T> {
@override Widget getScreenContent() {
return new Column(children: <Widget>[
getValueWithTitle('Покупатель', 'Знаменитый Рокер Паук'),
getValueWithTitle('Покупатель', username),
getSuccessMessage(),
new Expanded(child: new Center()),
buildButton(new EdgeInsets.only(bottom: 74.0, left: buttonVerticalMargin, right: buttonVerticalMargin), buildRaisedButton(context, 'СКАНИРОВАТЬ', () => startScanner(context)))
@@ -41,7 +42,7 @@ class PurchaseSuccessScreenState<T> extends PurchaseScreenState<T> {
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('Покупка на сумму ${val} руб. проведена', textAlign: TextAlign.center,
child: new Center(child: new Text('Покупка на сумму ${sum} руб. проведена', textAlign: TextAlign.center,
style: new TextStyle(fontWeight: FontWeight.bold, color: tokenActiveTextColor)))))]);
}